Created SILC Runtime Toolkit git repository Part II.
[runtime.git] / lib / silcutil / tests / test_silcthread.c
index d59ed4e043066bea2b2a6e3e131e8def680aa8db..75546654c0303eabee2af9bb02ef6aeaa560a026 100644 (file)
@@ -1,12 +1,13 @@
 /* SilcThreadPool tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 SilcSchedule schedule;
 
 static void func(SilcSchedule schedule, void *context)
 {
-  SILC_LOG_DEBUG(("func: %d", (int)context));
+  silc_thread_tls_set(context);
+  SILC_LOG_DEBUG(("func: %d", (int)silc_thread_tls_get()));
   sleep(1);
 }
 
@@ -27,10 +28,10 @@ int main(int argc, char **argv)
     silc_log_debug(TRUE);
     silc_log_quick(TRUE);
     silc_log_debug_hexdump(TRUE);
-    silc_log_set_debug_string("*thread*");
+    silc_log_set_debug_string("*thread*,*errno*");
   }
 
-  schedule = silc_schedule_init(0, NULL, NULL);
+  schedule = silc_schedule_init(0, NULL, NULL, NULL);
   if (!schedule)
     goto err;
 
@@ -102,5 +103,5 @@ int main(int argc, char **argv)
   SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
   fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
 
-  return success;
+  return !success;
 }