diff options
author | Denis Kenzior <denkenz@gmail.com> | 2018-12-20 15:54:40 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2018-12-27 18:18:51 -0600 |
commit | 71544d7fe1a293f829ace3aea327311e0eb17c8a (patch) | |
tree | 6e8a207b89597ace2bbcea0b1ff1418cc2134662 /unit/test-common.c | |
parent | 538804e1918accd2f6b286db5cc0e1de40cb83f2 (diff) | |
download | ofono-71544d7fe1a293f829ace3aea327311e0eb17c8a.tar.gz |
unit: convert usage of g_test_verbose
Convert all usages of this function in favor of using a static VERBOSE
variable. We almost never use verbose output except while debugging.
Additionally this allows us to more easily convert all unit tests to the
ell unit test framework
Diffstat (limited to 'unit/test-common.c')
-rw-r--r-- | unit/test-common.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/unit/test-common.c b/unit/test-common.c index 63355eae..cb229a42 100644 --- a/unit/test-common.c +++ b/unit/test-common.c @@ -29,10 +29,14 @@ #include <assert.h> #include <glib.h> +#include <ell/ell.h> + #include <ofono/types.h> #include "common.h" +static const bool VERBOSE = false; + static const char *invalid_strings[] = { "33", "*", @@ -71,8 +75,8 @@ static void test_invalid(void) gboolean ret; for (i = 0; invalid_strings[i]; i++) { - if (g_test_verbose()) - g_print("%s...\n", invalid_strings[i]); + if (VERBOSE) + printf("%s...\n", invalid_strings[i]); str = strdup(invalid_strings[i]); @@ -122,8 +126,8 @@ static void test_valid(void) int i; for (i = 0; valid_strings[i]; i++) { - if (g_test_verbose()) - g_print("%s...", valid_strings[i]); + if (VERBOSE) + printf("%s...", valid_strings[i]); str = strdup(valid_strings[i]); @@ -134,8 +138,8 @@ static void test_valid(void) g_assert(ret == TRUE); - if (g_test_verbose()) - g_print("parsed as: %d, %s, %s, %s, %s, %s\n", + if (VERBOSE) + printf("parsed as: %d, %s, %s, %s, %s, %s\n", type, sc, sia, sib, sic, dn); free(str); @@ -164,8 +168,8 @@ static void test_apn(void) gboolean res; for (i = 0; valid_apns[i]; i++) { - if (g_test_verbose()) - g_print("Test Valid:%s\n", valid_apns[i]); + if (VERBOSE) + printf("Test Valid:%s\n", valid_apns[i]); res = is_valid_apn(valid_apns[i]); @@ -173,8 +177,8 @@ static void test_apn(void) } for (i = 0; invalid_apns[i]; i++) { - if (g_test_verbose()) - g_print("Test Invalid:%s\n", invalid_apns[i]); + if (VERBOSE) + printf("Test Invalid:%s\n", invalid_apns[i]); res = is_valid_apn(invalid_apns[i]); |