diff --git a/src/bin/sb.c b/src/bin/sb.c index 9b55ef40..cceb4465 100644 --- a/src/bin/sb.c +++ b/src/bin/sb.c @@ -174,7 +174,7 @@ ty_sb_free(struct ty_sb *sb) } #if defined(BINARY_TYTEST) -static int +int tytest_sb_skip(void) { struct ty_sb sb = {}; @@ -229,7 +229,7 @@ tytest_sb_skip(void) return 0; } -static int +int tytest_sb_trim(void) { struct ty_sb sb = {}; @@ -253,7 +253,7 @@ tytest_sb_trim(void) return 0; } -static int +int tytest_sb_gap(void) { struct ty_sb sb = {}; @@ -286,7 +286,7 @@ tytest_sb_gap(void) return 0; } -static int +int tytest_sb_steal(void) { struct ty_sb sb = {}; @@ -307,15 +307,4 @@ tytest_sb_steal(void) ty_sb_free(&sb); return 0; } - - -int -tytest_sb(void) -{ - assert(tytest_sb_skip() == 0); - assert(tytest_sb_trim() == 0); - assert(tytest_sb_gap() == 0); - assert(tytest_sb_steal() == 0); - return 0; -} #endif diff --git a/src/bin/tytest.c b/src/bin/tytest.c index 5e06ca7a..c692d1aa 100644 --- a/src/bin/tytest.c +++ b/src/bin/tytest.c @@ -29,7 +29,10 @@ static struct { tytest_func func; } _tytests[] = { { "dummy", tytest_dummy }, - { "sb", tytest_sb}, + { "sb_skip", tytest_sb_skip}, + { "sb_trim", tytest_sb_trim}, + { "sb_gap", tytest_sb_gap}, + { "sb_steal", tytest_sb_steal}, { NULL, NULL}, }; diff --git a/src/bin/unit_tests.h b/src/bin/unit_tests.h index ff377d14..813441cb 100644 --- a/src/bin/unit_tests.h +++ b/src/bin/unit_tests.h @@ -6,6 +6,9 @@ typedef int (*tytest_func)(void); /* list of tests */ int tytest_dummy(void); -int tytest_sb(void); +int tytest_sb_skip(void); +int tytest_sb_trim(void); +int tytest_sb_gap(void); +int tytest_sb_steal(void); #endif