You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/08/29 10:30:34 UTC

svn commit: r809098 - /commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c

Author: mturk
Date: Sat Aug 29 08:30:34 2009
New Revision: 809098

URL: http://svn.apache.org/viewvc?rev=809098&view=rev
Log:
Add time test

Modified:
    commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c

Modified: commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c?rev=809098&r1=809097&r2=809098&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c Sat Aug 29 08:30:34 2009
@@ -404,6 +404,14 @@
     return 0;
 }
 
+/* The time value is used throughout the tests, so just make this a global.
+ * Also, we need a single value that we can test for the positive tests, so
+ * I chose the number below, it corresponds to:
+ *           2002-08-14 12:05:36.186711 -25200 [257 Sat].
+ * Which happens to be when I wrote the new tests.
+ */
+static acr_time_t test_now = ACR_INT64_C(1032030336186711);
+
 static int test_times(int argc, const char *const argv[])
 {
     int failed = 0;
@@ -424,10 +432,10 @@
             failed++;
         }
     }
-    d2 = ACR_Acr2DosTime(0);
+    d2 = ACR_Acr2DosTime(test_now);
     printf("Dos Time 0 is %d\n",  d2);
     printf("Acr Time 0 is %ld\n", ACR_Dos2AcrTime(d2));
-    printf("Acr Time 0 is %ld\n", ACR_Dos2AcrTime(0));
+    printf("Acr Time 0 is %ld\n", ACR_Dos2AcrTime(d2+1));
     tests_failed += failed;
     if (failed)
         fprintf(stderr, "times:         Failed (%d)\n", failed);