Added SILC Server library.
[silc.git] / lib / silcutil / tests / test_silcstrutil.c
index f7b4faf81078facbe9bf9244cad13d352080ffe5..343ab714fc9e93048561f2134c59ae8f55385ff3 100644 (file)
@@ -1,6 +1,6 @@
 /* UTF-8 decoding tests */
 
-#include "silcincludes.h"
+#include "silc.h"
 
 #define utf8fail(n, data, len)                 \
 const unsigned char u##n[] = (data);           \
@@ -50,14 +50,33 @@ utf8fail(30, "\xf0\x20\xf9\x20\xfa\x20\xfb\x20", 8);
 
 int main(int argc, char **argv)
 {
-  bool success = FALSE;
+  SilcBool success = FALSE;
   unsigned char *s1, *s2, *s3, *s4;
-  int l;
-
-  if (argc > 1 && !strcmp(argv[1], "-d")) {
-    silc_debug = 1;
-    silc_debug_hexdump = 1;
-    silc_log_set_debug_string("*strutil*");
+  int l, opt;
+
+  while ((opt = getopt(argc, argv, "hVd")) != EOF) {
+      switch(opt) {
+        case 'h':
+          printf("usage: test_silcstrutil\n");
+         exit(0);
+          break;
+        case 'V':
+          printf("Secure Internet Live Conferencing\n");
+          exit(0);
+          break;
+        case 'd':
+          silc_log_debug(TRUE);
+         silc_log_debug_hexdump(TRUE);
+         silc_log_quick(TRUE);
+          if (optarg)
+            silc_log_set_debug_string(optarg);
+         else
+           silc_log_set_debug_string("*strutil*");
+          break;
+       default:
+         exit(1);
+         break;
+      }
   }
 
   /* Failure tests */