]> pd.if.org Git - pdclib/blobdiff - opt/nothread/tss_get.c
dos2unix
[pdclib] / opt / nothread / tss_get.c
index 7077ac68dbe21113ee5b94874d2551f4493123a0..483088a252afd0c5ce9b4f2bb4292647272f2f24 100644 (file)
@@ -1,6 +1,30 @@
-#include <threads.h>\r
-\r
-void *tss_get(tss_t key)\r
-{\r
-       return key.value;\r
-}
\ No newline at end of file
+#ifndef REGTEST
+#include <threads.h>
+
+void *tss_get(tss_t key)
+{
+       return key.value;
+}
+#endif
+
+#ifdef TEST
+#include "_PDCLIB_test.h"
+
+#ifndef REGTEST
+static tss_t key;
+static char v;
+#endif
+
+int main( void )
+{
+#ifndef REGTEST
+    TESTCASE(tss_create(&key, NULL) == thrd_success);
+    TESTCASE(tss_get(key) == NULL);
+    TESTCASE(tss_set(key, &v) == thrd_success);
+    TESTCASE(tss_get(key) == &v);
+    tss_delete(key);
+#endif
+    return TEST_RESULTS;
+}
+
+#endif