mirror of
https://github.com/falk-werner/webfuse-provider
synced 2026-03-02 04:09:18 +00:00
added implementation of json parser
This commit is contained in:
@@ -5,7 +5,7 @@ TEST(jsonrpc_util, get_int)
|
||||
{
|
||||
json_t * object = json_object();
|
||||
json_object_set_new(object, "key", json_integer(23));
|
||||
int value = wfp_impl_json_get_int(object, "key", 42);
|
||||
int value = wfp_impl_json_get_integer(object, "key", 42);
|
||||
ASSERT_EQ(23, value);
|
||||
|
||||
json_decref(object);
|
||||
@@ -13,7 +13,7 @@ TEST(jsonrpc_util, get_int)
|
||||
|
||||
TEST(jsonrpc_util, failed_to_get_null_object)
|
||||
{
|
||||
int value = wfp_impl_json_get_int(nullptr, "key", 42);
|
||||
int value = wfp_impl_json_get_integer(nullptr, "key", 42);
|
||||
|
||||
ASSERT_EQ(42, value);
|
||||
}
|
||||
@@ -21,7 +21,7 @@ TEST(jsonrpc_util, failed_to_get_null_object)
|
||||
TEST(jsonrpc_util, failed_to_get_not_object)
|
||||
{
|
||||
json_t * object = json_array();
|
||||
int value = wfp_impl_json_get_int(nullptr, "key", 42);
|
||||
int value = wfp_impl_json_get_integer(nullptr, "key", 42);
|
||||
ASSERT_EQ(42, value);
|
||||
|
||||
json_decref(object);
|
||||
@@ -30,7 +30,7 @@ TEST(jsonrpc_util, failed_to_get_not_object)
|
||||
TEST(jsonrpc_util, failed_to_get_invalid_key)
|
||||
{
|
||||
json_t * object = json_object();
|
||||
int value = wfp_impl_json_get_int(object, "key", 42);
|
||||
int value = wfp_impl_json_get_integer(object, "key", 42);
|
||||
ASSERT_EQ(42, value);
|
||||
|
||||
json_decref(object);
|
||||
@@ -40,7 +40,7 @@ TEST(jsonrpc_util, failed_to_get_invalid_value_type)
|
||||
{
|
||||
json_t * object = json_object();
|
||||
json_object_set_new(object, "key", json_string("42"));
|
||||
int value = wfp_impl_json_get_int(object, "key", 42);
|
||||
int value = wfp_impl_json_get_integer(object, "key", 42);
|
||||
ASSERT_EQ(42, value);
|
||||
|
||||
json_decref(object);
|
||||
|
||||
Reference in New Issue
Block a user