X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=opt%2Fnothread%2Ftss_get.c;h=c302fffb62c389bf4024dcd436f5b7483caced29;hb=219271fd548949abce8bd75c34dd42e519418fc4;hp=7077ac68dbe21113ee5b94874d2551f4493123a0;hpb=b41576197133c1211d6ec353faf93f505f573b8a;p=pdclib diff --git a/opt/nothread/tss_get.c b/opt/nothread/tss_get.c index 7077ac6..c302fff 100644 --- a/opt/nothread/tss_get.c +++ b/opt/nothread/tss_get.c @@ -1,6 +1,30 @@ +#ifndef REGTEST #include void *tss_get(tss_t key) { return key.value; -} \ No newline at end of file +} +#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 \ No newline at end of file