From fd0fa061c30021396571beb1cfadd0aa464825b3 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Sun, 28 Aug 2016 17:35:54 +0200 Subject: linux kernel coding style, fix deprecated libraries --- minctest.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'minctest.h') diff --git a/minctest.h b/minctest.h index 64b4519..0170480 100644 --- a/minctest.h +++ b/minctest.h @@ -15,21 +15,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef MINCTEST_MINCTEST_H -#define MINCTEST_MINCTEST_H +#ifndef MINCTEST_H +#define MINCTEST_H -#include +#include #include #include -typedef struct { +struct tester { uint16_t passed; // Number of passed tests uint16_t failed; // Number of failed tests bool show_pass; // Whether or not to print a message when a test passes struct timeval start_last_test; // Time last test was started struct timeval created; // Time this was created __suseconds_t used; // usecs used for tests -} tester; +}; /** * Initialize a tester struct @@ -39,7 +39,7 @@ typedef struct { * * @return a struct on the heap for use in the other test_* functions */ -tester* test_initialize(void); +struct tester *test_initialize(void); /** * Show summarised data about the tester @@ -49,7 +49,7 @@ tester* test_initialize(void); * * @param tester* a pointer to a tester from test_initialize */ -void test_wrapup(tester*); +void test_wrapup(struct tester *); /** * Destroy a tester struct @@ -58,7 +58,7 @@ void test_wrapup(tester*); * * @param tester* a pointer to a tester from test_initialize */ -void test_destroy(tester*); +void test_destroy(struct tester *); /** * Exit the program with an appropriate return value @@ -68,12 +68,12 @@ void test_destroy(tester*); * @param tester* a pointer to a tester from test_initialize * @return don't expect this to return */ -void test_exit(tester*); +void test_exit(struct tester *); /** * Start the timer for a test */ -void test_start_timer(tester*); +void test_start_timer(struct tester *); /** * Test for truth on a bool @@ -86,6 +86,6 @@ void test_start_timer(tester*); * @param check the boolean that should be true * @param test a custom message to show */ -void test_true(tester* tester, bool check, const char* text); +void test_true(struct tester *tester, bool check, const char* text); -#endif // MINCTEST_MINCTEST_H +#endif // MINCTEST_H -- cgit v1.2.3 From 0dd9c013078286896824a2a17624c6e79f1e5d36 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Sun, 28 Aug 2016 17:41:29 +0200 Subject: tabs>spacE' --- example.c | 16 ++++++++-------- minctest.h | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'minctest.h') diff --git a/example.c b/example.c index 9fcc46c..170b200 100644 --- a/example.c +++ b/example.c @@ -20,15 +20,15 @@ #include "minctest.h" int main(void) { - struct tester *tester = test_initialize(); - tester->show_pass = false; + struct tester *tester = test_initialize(); + tester->show_pass = false; - test_true(tester, 1 == 1, "1 = 1"); - test_true(tester, 42 == 6 * 7, "42 = 6*7"); - test_true(tester, !NULL, "NULL is false"); - test_true(tester, -10 > 10, "Negative is greater than positive"); + test_true(tester, 1 == 1, "1 = 1"); + test_true(tester, 42 == 6 * 7, "42 = 6*7"); + test_true(tester, !NULL, "NULL is false"); + test_true(tester, -10 > 10, "Negative is greater than positive"); - test_wrapup(tester); - test_exit(tester); + test_wrapup(tester); + test_exit(tester); } diff --git a/minctest.h b/minctest.h index 0170480..071a5af 100644 --- a/minctest.h +++ b/minctest.h @@ -23,12 +23,12 @@ #include struct tester { - uint16_t passed; // Number of passed tests - uint16_t failed; // Number of failed tests - bool show_pass; // Whether or not to print a message when a test passes - struct timeval start_last_test; // Time last test was started - struct timeval created; // Time this was created - __suseconds_t used; // usecs used for tests + uint16_t passed; // Number of passed tests + uint16_t failed; // Number of failed tests + bool show_pass; // Whether or not to print a message when a test passes + struct timeval start_last_test; // Time last test was started + struct timeval created; // Time this was created + __suseconds_t used; // usecs used for tests }; /** -- cgit v1.2.3