test structure too
authorAndrew Tridgell <tridge@samba.org>
Thu, 10 Mar 2011 03:25:40 +0000 (14:25 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 10 Mar 2011 03:25:40 +0000 (14:25 +1100)
nttime/nttime_test.c

index 48993955aed14aef3b6afc7a96b476a50942e9ad..163a7cc841c9df49fb812dbfd9388bc49036e285 100644 (file)
@@ -4,37 +4,50 @@
 #include <sys/time.h>
 
 typedef uint64_t NTTIME;
+typedef struct {
+       uint64_t t;
+} NTTIME_s;
 
 
 static void test1(time_t t) { }
 
 static void test2(NTTIME t) {}
 
+static void test3(NTTIME_s t) {}
+
 static time_t test1_r(void) { return 0; }
 
 static NTTIME test2_r(void) { return 0; }
 
+static NTTIME_s test3_r(void) { NTTIME_s t = { 0 }; return t; }
+
+
 
 int main(void)
 {
        NTTIME nt = 0;
+       NTTIME_s nts = { 0 };
        time_t t = 0;
 
        test1(t);
-
        test1(nt);
+       test1(nts);
 
        test2(t);
-
        test2(nt);
+       test2(nts);
 
-       t = test1_r();
-
-       nt = test1_r();
+       t   = test1_r();
+       nt  = test1_r();
+       nts = test1_r();
 
-       t = test2_r();
+       t   = test2_r();
+       nt  = test2_r();
+       nts = test2_r();
 
-       nt = test2_r();
+       t   = test3_r();
+       nt  = test3_r();
+       nts = test3_r();
 
        return 0;
 }