diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2013-12-02 14:34:20 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2013-12-02 14:34:20 +0000 |
commit | b3072da5a2e897b2b87f84d30485bf316c4476fb (patch) | |
tree | e67cccb3c64297404264d5522e395537f689d0b4 /json-glib/tests | |
parent | 64b4f936617e781e9a3677cf98b2abde94b8ef2a (diff) | |
download | json-glib-b3072da5a2e897b2b87f84d30485bf316c4476fb.tar.gz |
tests/gvariant: Use G_N_ELEMENTS
Instead of sizeof(array)/sizeof(type).
Diffstat (limited to 'json-glib/tests')
-rw-r--r-- | json-glib/tests/gvariant.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/json-glib/tests/gvariant.c b/json-glib/tests/gvariant.c index 3ef4b98..38c56b7 100644 --- a/json-glib/tests/gvariant.c +++ b/json-glib/tests/gvariant.c @@ -12,7 +12,7 @@ typedef struct /* each entry in this list spawns to a GVariant-to-JSON and JSON-to-GVariant test */ -const TestCase two_way_test_cases[] = +static const TestCase two_way_test_cases[] = { /* boolean */ { "/boolean", "(b)", "(true,)", "[true]" }, @@ -145,7 +145,7 @@ const TestCase two_way_test_cases[] = "[{\"true\":1,\"false\":0},[\"do\",null,\"did\"],[],null,{\"10000\":[\"yes\",\"august\"],\"0\":null}]" }, }; -const TestCase json_to_gvariant_test_cases[] = +static const TestCase json_to_gvariant_test_cases[] = { { "/string-to-boolean", "(b)", "(true,)", "[\"true\"]" }, { "/string-to-byte", "(y)", "(byte 0xff,)", "[\"255\"]" }, @@ -219,7 +219,7 @@ main (gint argc, gchar *argv[]) g_test_init (&argc, &argv, NULL); /* GVariant to JSON */ - for (i = 0; i < sizeof (two_way_test_cases) / sizeof (TestCase); i++) + for (i = 0; i < G_N_ELEMENTS (two_way_test_cases); i++) { test_case = two_way_test_cases[i]; test_name = g_strdup_printf ("/gvariant/to-json/%s", test_case.test_name); @@ -230,7 +230,7 @@ main (gint argc, gchar *argv[]) } /* JSON to GVariant */ - for (i = 0; i < sizeof (two_way_test_cases) / sizeof (TestCase); i++) + for (i = 0; i < G_N_ELEMENTS (two_way_test_cases); i++) { test_case = two_way_test_cases[i]; test_name = g_strdup_printf ("/gvariant/from-json/%s", test_case.test_name); @@ -241,7 +241,7 @@ main (gint argc, gchar *argv[]) } /* JSON to GVariant one way tests */ - for (i = 0; i < sizeof (json_to_gvariant_test_cases) / sizeof (TestCase); i++) + for (i = 0; i < G_N_ELEMENTS (json_to_gvariant_test_cases); i++) { test_case = json_to_gvariant_test_cases[i]; test_name = g_strdup_printf ("/gvariant/from-json/%s", test_case.test_name); |