Add json_add_number manually overloaded function
This commit is contained in:
parent
a449c00f16
commit
0a0a6d918d
2 changed files with 20 additions and 0 deletions
|
|
@ -64,6 +64,18 @@ void test_json_add_double()
|
|||
TEST_ASSERT_EQUAL_STRING("3.14", buffer);
|
||||
}
|
||||
|
||||
void test_json_add_number()
|
||||
{
|
||||
json_add_number(&json, 3.14f);
|
||||
fflush(tmp);
|
||||
rewind(tmp);
|
||||
|
||||
auto n = fread(buffer, 1, sizeof(buffer) - 1, tmp);
|
||||
buffer[n] = '\0';
|
||||
|
||||
TEST_ASSERT_EQUAL_STRING("3.14", buffer);
|
||||
}
|
||||
|
||||
void test_json_add_bool()
|
||||
{
|
||||
json_add_bool(&json, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue