diff options
| author | Dmitri Pal <dpal@redhat.com> | 2012-12-23 16:13:14 -0500 |
|---|---|---|
| committer | Ondrej Kos <okos@redhat.com> | 2013-01-07 09:24:26 +0100 |
| commit | 75fb29de5f180ff7a672865629c83367c10ae5ee (patch) | |
| tree | fc807fdb512b4dbc74db461c320efc3787e5ef19 /ini | |
| parent | e984e914b6aced5dabe250ad769c63186f21f8b8 (diff) | |
| download | ding-libs2-75fb29de5f180ff7a672865629c83367c10ae5ee.tar.gz ding-libs2-75fb29de5f180ff7a672865629c83367c10ae5ee.tar.xz ding-libs2-75fb29de5f180ff7a672865629c83367c10ae5ee.zip | |
Fix CLANG errors in unit test
Diffstat (limited to 'ini')
| -rw-r--r-- | ini/ini_config_ut.c | 5 | ||||
| -rw-r--r-- | ini/ini_parse_ut.c | 9 | ||||
| -rw-r--r-- | ini/ini_valueobj_ut.c | 2 |
3 files changed, 7 insertions, 9 deletions
diff --git a/ini/ini_config_ut.c b/ini/ini_config_ut.c index 362a941..ab0b1f7 100644 --- a/ini/ini_config_ut.c +++ b/ini/ini_config_ut.c @@ -467,7 +467,7 @@ int get_test(void) double number_double; unsigned number_unsigned; unsigned long number_ulong; - unsigned char logical; + unsigned char logical = 0; char *str; const char *cstr; const char *cstrn; @@ -637,7 +637,6 @@ int get_test(void) COLOUT(printf("Convert item to number without strict conversion.\n")); error = 0; - number = 1; number = get_int_config_value(item, 0, 10, &error); if (error) { /* We expected error in this case */ @@ -779,7 +778,7 @@ int get_test(void) error = 0; logical = get_bool_config_value(item, 1, &error); if (!error) { - printf("Expect error. Got success.\n"); + printf("Expect error. Got success. Value %d\n", (int) logical); free_ini_config(ini_config); return -1; } diff --git a/ini/ini_parse_ut.c b/ini/ini_parse_ut.c index 61f8d5b..521c2f7 100644 --- a/ini/ini_parse_ut.c +++ b/ini/ini_parse_ut.c @@ -919,7 +919,7 @@ int merge_file_test(void) msecflags[i], m2flags[j], m1flags[j]); - INIOUT(printf(msg)); + INIOUT(printf("%s", msg)); error = simplebuffer_add_str(sbobj, msg, strlen(msg), @@ -948,7 +948,7 @@ int merge_file_test(void) msecflags[i], m2flags[j], m1flags[j]); - INIOUT(printf(msg)); + INIOUT(printf("%s", msg)); error = simplebuffer_add_str(sbobj, msg, strlen(msg), @@ -1353,7 +1353,7 @@ int get_test(void) double number_double; unsigned number_unsigned; unsigned long number_ulong; - unsigned char logical; + unsigned char logical = 0; char *str; const char *cstr; const char *cstrn; @@ -1579,7 +1579,6 @@ int get_test(void) INIOUT(printf("Convert value to number without strict conversion.\n")); error = 0; - number = 1; number = ini_get_int_config_value(vo, 0, 10, &error); if (error) { printf("Did not expect error.\n"); @@ -1723,7 +1722,7 @@ int get_test(void) error = 0; logical = ini_get_bool_config_value(vo, 1, &error); if (!error) { - printf("Expect error. Got success.\n"); + printf("Expect error. Got success. Value %d\n", (int) logical); ini_config_destroy(ini_config); return -1; } diff --git a/ini/ini_valueobj_ut.c b/ini/ini_valueobj_ut.c index 05f649b..a35b239 100644 --- a/ini/ini_valueobj_ut.c +++ b/ini/ini_valueobj_ut.c @@ -62,7 +62,7 @@ static int create_comment(int i, struct ini_comment **ic) (error = ini_comment_build(new_ic, "#This is the second line")) || (error = ini_comment_build(new_ic, ";This is the third line")) || (error = ini_comment_build(new_ic, ""))) { - printf("Failed to create comment object\n"); + printf("Failed to create comment object. Error %d.\n", error); ini_comment_destroy(new_ic); return -1; } |
