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