tests CHANGE remove duplicit test
@@ -474,59 +474,6 @@ test_ns(void **state)
assert_null(lyxml_ns_get(&ctx, NULL, 0));
}
-static void
-test_simple_xml(void **state)
-{
- (void)state; /* unused */
- size_t name_len, prefix_len;
- const char *prefix, *name;
- char *test_in = NULL, *to_free = NULL;
- struct lyxml_context ctx;
-
- char *buf = NULL, *output = NULL;
- size_t buf_size, length;
- int dynamic;
- char *test_input = "<elem1 attr1=\"value\"> <elem2 attr2=\"value\"/> </elem1>";
-
- memset(&ctx, 0, sizeof ctx);
- ctx.line = 1;
- to_free = test_in = malloc(strlen(test_input) + 1);
- /* test input */
- strcpy(test_in, test_input);
-
- assert_int_equal(LY_SUCCESS, lyxml_get_element(&ctx, (const char **)&test_in, &prefix, &prefix_len, &name, &name_len)); /* <elem1 */
- assert_int_equal(ctx.status, LYXML_ATTRIBUTE);
-
- assert_int_equal(LY_SUCCESS, lyxml_get_attribute(&ctx, (const char **)&test_in, &prefix, &prefix_len, &name, &name_len)); /* attr1= */
- assert_int_equal(ctx.status, LYXML_ATTR_CONTENT);
-
- assert_int_equal(LY_SUCCESS, lyxml_get_string(&ctx, (const char **)&test_in, &buf, &buf_size, &output, &length, &dynamic)); /* "value" */
- assert_int_equal(ctx.status, LYXML_ELEM_CONTENT);
-
- /* try to get string content of elem1 whitespace is removed and EINVAL is expected in this case */
- assert_int_equal(LY_EINVAL, lyxml_get_string(&ctx, (const char **)&test_in, &buf, &buf_size, &output, &length, &dynamic));
- assert_int_equal(ctx.status, LYXML_ELEM_CONTENT);
-
- assert_int_equal(LY_SUCCESS, lyxml_get_element(&ctx, (const char **)&test_in, &prefix, &prefix_len, &name, &name_len)); /* <elem2 */
- assert_int_equal(ctx.status, LYXML_ATTRIBUTE);
-
- assert_int_equal(LY_SUCCESS, lyxml_get_attribute(&ctx, (const char **)&test_in, &prefix, &prefix_len, &name, &name_len)); /* attr2= */
- assert_int_equal(ctx.status, LYXML_ATTR_CONTENT);
-
- assert_int_equal(LY_SUCCESS, lyxml_get_string(&ctx, (const char **)&test_in, &buf, &buf_size, &output, &length, &dynamic)); /* "value" */
- assert_int_equal(ctx.status, LYXML_ELEMENT);
-
- assert_int_equal(LY_SUCCESS, lyxml_get_element(&ctx, (const char **)&test_in, &prefix, &prefix_len, &name, &name_len)); /* </elem1> */
- assert_int_equal(ctx.status, LYXML_ELEMENT);
-
- assert_int_equal(LY_SUCCESS, lyxml_get_element(&ctx, (const char **)&test_in, &prefix, &prefix_len, &name, &name_len));
- assert_ptr_equal(name, NULL);
- assert_int_equal(ctx.status, LYXML_END);
-
- lyxml_context_clear(&ctx);
- free(to_free);
-}
-
static void
test_ns2(void **state)
{
