nttime test
authorAndrew Tridgell <tridge@samba.org>
Thu, 10 Mar 2011 03:18:21 +0000 (14:18 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 10 Mar 2011 03:18:21 +0000 (14:18 +1100)
nttime/Makefile [new file with mode: 0644]
nttime/nttime_test.c [new file with mode: 0644]

diff --git a/nttime/Makefile b/nttime/Makefile
new file mode 100644 (file)
index 0000000..cd73438
--- /dev/null
@@ -0,0 +1,7 @@
+CFLAGS=-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k -Wmissing-prototypes -Wconversion
+
+all: nttime_test.o
+
+clean:
+       rm -f *.o *~
+
diff --git a/nttime/nttime_test.c b/nttime/nttime_test.c
new file mode 100644 (file)
index 0000000..4899395
--- /dev/null
@@ -0,0 +1,40 @@
+#include <stdio.h>
+#include <stdint.h>
+#include <time.h>
+#include <sys/time.h>
+
+typedef uint64_t NTTIME;
+
+
+static void test1(time_t t) { }
+
+static void test2(NTTIME t) {}
+
+static time_t test1_r(void) { return 0; }
+
+static NTTIME test2_r(void) { return 0; }
+
+
+int main(void)
+{
+       NTTIME nt = 0;
+       time_t t = 0;
+
+       test1(t);
+
+       test1(nt);
+
+       test2(t);
+
+       test2(nt);
+
+       t = test1_r();
+
+       nt = test1_r();
+
+       t = test2_r();
+
+       nt = test2_r();
+
+       return 0;
+}