diff options
author | Brendan Taylor <whateley@gmail.com> | 2011-02-15 11:36:03 -0700 |
---|---|---|
committer | Brendan Taylor <whateley@gmail.com> | 2011-02-15 11:36:03 -0700 |
commit | 681cb249c31e4e17e3ae9b8f68b10d7f33fea402 (patch) | |
tree | 2ec13d9a2713dc5a3923badc90ce0941dceaae2e /tests/test-expand.c | |
parent | e5c2785c5de5230d49be57e172e925a99895b52f (diff) |
replace itos() with g_strdup_printf()
Diffstat (limited to 'tests/test-expand.c')
-rw-r--r-- | tests/test-expand.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/tests/test-expand.c b/tests/test-expand.c index bf7e171..d823cfa 100644 --- a/tests/test-expand.c +++ b/tests/test-expand.c @@ -66,14 +66,12 @@ test_useragent (void) { void test_WEBKIT_VERSION (void) { - GString* expected = g_string_new(""); - g_string_append(expected, itos(webkit_major_version())); - g_string_append(expected, " "); - g_string_append(expected, itos(webkit_minor_version())); - g_string_append(expected, " "); - g_string_append(expected, itos(webkit_micro_version())); + gchar *expected = g_strdup_printf("%d %d %d", webkit_major_version(), + webkit_minor_version(), + webkit_micro_version()); - g_assert_cmpstr(expand("@WEBKIT_MAJOR @WEBKIT_MINOR @WEBKIT_MICRO", 0), ==, g_string_free(expected, FALSE)); + g_assert_cmpstr(expand("@WEBKIT_MAJOR @WEBKIT_MINOR @WEBKIT_MICRO", 0), ==, expected); + g_free(expected); } void @@ -89,11 +87,11 @@ test_COMMIT (void) { void test_cmd_useragent_full (void) { GString* expected = g_string_new("Uzbl (Webkit "); - g_string_append(expected, itos(WEBKIT_MAJOR_VERSION)); + g_string_append(expected, g_strdup_printf("%d", WEBKIT_MAJOR_VERSION)); g_string_append(expected, "."); - g_string_append(expected, itos(WEBKIT_MINOR_VERSION)); + g_string_append(expected, g_strdup_printf("%d", WEBKIT_MINOR_VERSION)); g_string_append(expected, "."); - g_string_append(expected, itos(WEBKIT_MICRO_VERSION)); + g_string_append(expected, g_strdup_printf("%d", WEBKIT_MICRO_VERSION)); g_string_append(expected, ") ("); struct utsname unameinfo; |