/* Copyright (c) 2015-2018 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
#include "json-tree.h"
struct {
const char *value;
} test_input[] = {
{ JSON_TYPE_OBJECT_KEY, "key-str" },
{ JSON_TYPE_STRING, "string" },
{ JSON_TYPE_OBJECT_KEY, "key-num" },
{ JSON_TYPE_NUMBER, "1234" },
{ JSON_TYPE_OBJECT_KEY, "key-true" },
{ JSON_TYPE_TRUE, "true" },
{ JSON_TYPE_OBJECT_KEY, "key-false" },
{ JSON_TYPE_FALSE, "false" },
{ JSON_TYPE_OBJECT_KEY, "key-null" },
{ JSON_TYPE_NULL, NULL },
{ JSON_TYPE_OBJECT_KEY, "key-obj-empty" },
{ JSON_TYPE_OBJECT, NULL },
{ JSON_TYPE_OBJECT_END, NULL },
{ JSON_TYPE_OBJECT_KEY, "key-obj" },
{ JSON_TYPE_OBJECT, NULL },
{ JSON_TYPE_OBJECT_KEY, "sub" },
{ JSON_TYPE_STRING, "value" },
{ JSON_TYPE_OBJECT_END, NULL },
{ JSON_TYPE_OBJECT_KEY, "key-arr-empty" },
{ JSON_TYPE_ARRAY, NULL },
{ JSON_TYPE_ARRAY_END, NULL },
{ JSON_TYPE_OBJECT_KEY, "key-arr" },
{ JSON_TYPE_ARRAY, NULL },
{ JSON_TYPE_STRING, "foo" },
{ JSON_TYPE_ARRAY, NULL },
{ JSON_TYPE_TRUE, "true" },
{ JSON_TYPE_ARRAY_END, NULL },
{ JSON_TYPE_OBJECT, NULL },
{ JSON_TYPE_OBJECT_KEY, "aobj" },
{ JSON_TYPE_ARRAY, NULL },
{ JSON_TYPE_ARRAY_END, NULL },
{ JSON_TYPE_OBJECT_END, NULL },
{ JSON_TYPE_OBJECT, NULL },
{ JSON_TYPE_OBJECT_KEY, "aobj-key" },
{ JSON_TYPE_STRING, "value1" },
{ JSON_TYPE_OBJECT_END, NULL },
{ JSON_TYPE_OBJECT, NULL },
{ JSON_TYPE_OBJECT_KEY, "aobj-key" },
{ JSON_TYPE_STRING, "value2" },
{ JSON_TYPE_OBJECT_END, NULL },
{ JSON_TYPE_ARRAY_END, NULL }
};
void test_json_tree(void)
{
unsigned int i;
test_begin("json tree");
tree = json_tree_init();
for (i = 0; i < N_ELEMENTS(test_input); i++) {
test_input[i].value) == 0, i);
}
for (i = 0; i < 10+2; i += 2) {
}
test_end();
}