X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=opt%2Fnothread%2Ftss_get.c;h=3e9917b83c3b508fee8c211ed9f0e06732f3e154;hb=bb22ff7ecd9fe8f4641484df12ad629cd8ee27ac;hp=7077ac68dbe21113ee5b94874d2551f4493123a0;hpb=a38d56a6a13dbb89022b5448d2d5247f3f99ea41;p=pdclib.old diff --git a/opt/nothread/tss_get.c b/opt/nothread/tss_get.c index 7077ac6..3e9917b 100644 --- a/opt/nothread/tss_get.c +++ b/opt/nothread/tss_get.c @@ -3,4 +3,22 @@ void *tss_get(tss_t key) { return key.value; -} \ No newline at end of file +} + +#ifdef TEST +#include <_PDCLIB_test.h> + +static tss_t key; +static char v; + +int main( void ) +{ + 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); + return TEST_RESULTS; +} + +#endif \ No newline at end of file