diff options
author | Arun Raghavan <git@arunraghavan.net> | 2016-06-01 17:18:32 +0530 |
---|---|---|
committer | Arun Raghavan <arun@arunraghavan.net> | 2016-06-22 21:04:47 +0530 |
commit | c692ec3afdba560398fd9a6871cddcca6d5c9cc5 (patch) | |
tree | 428f564579764b015a32f451d6e4d5c63b1c55d0 /src/tests/json-test.c | |
parent | 6741e5ae760715c3294908ffd38dfdc71c0b1cd7 (diff) |
format: Drop dependency on json-c
json-c has a symbol clash (json_object_get_type) with json-glib (which
at least a number of our GNOME clients use). This patch moves to our own
JSON parser so that we can avoid this kind of situation altogether.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=95135
Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
Diffstat (limited to 'src/tests/json-test.c')
-rw-r--r-- | src/tests/json-test.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/tests/json-test.c b/src/tests/json-test.c index e028e6801..2e1ca6b92 100644 --- a/src/tests/json-test.c +++ b/src/tests/json-test.c @@ -26,8 +26,6 @@ #include <pulse/json.h> #include <pulsecore/core-util.h> -#define IS_EQUAL(x, y) (((x) - (y)) < 0.000001 && ((x) - (y)) > -0.000001) - START_TEST (string_test) { pa_json_object *o; unsigned int i; @@ -85,7 +83,7 @@ START_TEST(double_test) { fail_unless(o != NULL); fail_unless(pa_json_object_get_type(o) == PA_JSON_TYPE_DOUBLE); - fail_unless(IS_EQUAL(pa_json_object_get_double(o), doubles_compare[i])); + fail_unless(PA_DOUBLE_IS_EQUAL(pa_json_object_get_double(o), doubles_compare[i])); pa_json_object_unref(o); } @@ -149,7 +147,7 @@ START_TEST(object_test) { v = pa_json_object_get_object_member(o, "age"); fail_unless(v != NULL); fail_unless(pa_json_object_get_type(v) == PA_JSON_TYPE_DOUBLE); - fail_unless(IS_EQUAL(pa_json_object_get_double(v), -45.3)); + fail_unless(PA_DOUBLE_IS_EQUAL(pa_json_object_get_double(v), -45.3)); pa_json_object_unref(o); @@ -205,7 +203,7 @@ START_TEST(array_test) { v = pa_json_object_get_array_member(o, 1); fail_unless(v != NULL); fail_unless(pa_json_object_get_type(v) == PA_JSON_TYPE_DOUBLE); - fail_unless(IS_EQUAL(pa_json_object_get_double(v), 1234.5)); + fail_unless(PA_DOUBLE_IS_EQUAL(pa_json_object_get_double(v), 1234.5)); v = pa_json_object_get_array_member(o, 2); fail_unless(v != NULL); fail_unless(pa_json_object_get_type(v) == PA_JSON_TYPE_OBJECT); |