Created SILC Runtime Toolkit git repository Part II.
[runtime.git] / lib / silcutil / tests / test_silctime.c
index bcfa713ebd44e839aafd8f978d19a9d060023858..822899019393d2ee190756293556152a002e9e3e 100644 (file)
@@ -1,17 +1,18 @@
 /* SilcTime tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 int main(int argc, char **argv)
 {
   SilcBool success = FALSE;
   SilcTimeStruct curtime;
+  unsigned char ts[32];
 
   if (argc > 1 && !strcmp(argv[1], "-d")) {
     silc_log_debug(TRUE);
     silc_log_quick(TRUE);
     silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*time*");
+    silc_log_set_debug_string("*time*,*errno*");
   }
 
   SILC_LOG_DEBUG(("Get current time"));
@@ -29,11 +30,16 @@ int main(int argc, char **argv)
   SILC_LOG_DEBUG(("utc_east  : %d", curtime.utc_east));
   SILC_LOG_DEBUG(("dst       : %d", curtime.dst));
 
+  silc_time_universal_string(&curtime, ts, sizeof(ts));
+  SILC_LOG_DEBUG(("Universal: %s", ts));
+  silc_time_generalized_string(&curtime, ts, sizeof(ts));
+  SILC_LOG_DEBUG(("Generaliz: %s", ts));
+
   success = TRUE;
 
  err:
   SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
   fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
 
-  return success;
+  return !success;
 }