billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=eba80af2ead751778f369d4005c179a590c69d4f

commit eba80af2ead751778f369d4005c179a590c69d4f
Author: Boris Faure <[email protected]>
Date:   Sun May 24 19:00:24 2020 +0200

    sb: extract tests
---
 src/bin/sb.c         | 19 ++++---------------
 src/bin/tytest.c     |  5 ++++-
 src/bin/unit_tests.h |  5 ++++-
 3 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/src/bin/sb.c b/src/bin/sb.c
index 9b55ef4..cceb446 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 5e06ca7..c692d1a 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 ff377d1..813441c 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

-- 


Reply via email to