Adding upstream version 3.4.2+dfsg.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
cfcebb1a7d
commit
338ffded6d
75 changed files with 1082 additions and 878 deletions
|
@ -1712,7 +1712,7 @@ test_extension_compile(void **state)
|
|||
LY_ARRAY_NEW_GOTO(UTEST_LYCTX, ext_p.substmts, substmtp, rc, cleanup);
|
||||
|
||||
substmtp->stmt = LY_STMT_ERROR_MESSAGE;
|
||||
substmtp->storage = (uintptr_t)(void *)&ext_p.parsed;
|
||||
substmtp->storage_p = &ext_p.parsed;
|
||||
/* fake parse */
|
||||
lydict_insert(UTEST_LYCTX, "my error", 0, (const char **)&ext_p.parsed);
|
||||
|
||||
|
@ -1721,7 +1721,7 @@ test_extension_compile(void **state)
|
|||
LY_ARRAY_NEW_GOTO(UTEST_LYCTX, ext_c.substmts, substmt, rc, cleanup);
|
||||
|
||||
substmt->stmt = LY_STMT_ERROR_MESSAGE;
|
||||
substmt->storage = (uintptr_t)(void *)&ext_c.compiled;
|
||||
substmt->storage_p = &ext_c.compiled;
|
||||
|
||||
/*
|
||||
* error-message
|
||||
|
|
|
@ -1233,6 +1233,7 @@ test_type_instanceid(void **state)
|
|||
{
|
||||
struct lys_module *mod;
|
||||
struct lysc_type *type;
|
||||
char *str;
|
||||
|
||||
assert_int_equal(LY_SUCCESS, lys_parse_mem(UTEST_LYCTX, "module a {namespace urn:a;prefix a;typedef mytype {type instance-identifier {require-instance false;}}"
|
||||
"leaf l1 {type instance-identifier {require-instance true;}}"
|
||||
|
@ -1252,12 +1253,22 @@ test_type_instanceid(void **state)
|
|||
assert_int_equal(LY_TYPE_INST, type->basetype);
|
||||
assert_int_equal(1, ((struct lysc_type_instanceid *)type)->require_instance);
|
||||
|
||||
/* default value */
|
||||
str = "module b1 {namespace urn:b1;prefix b1;"
|
||||
"leaf l1 {type string;}}";
|
||||
ly_ctx_set_module_imp_clb(UTEST_LYCTX, test_imp_clb, str);
|
||||
ly_ctx_set_options(UTEST_LYCTX, LY_CTX_REF_IMPLEMENTED);
|
||||
assert_int_equal(LY_SUCCESS, lys_parse_mem(UTEST_LYCTX, "module b2 {namespace urn:b2;prefix b2;"
|
||||
"import b1 {prefix b1;}"
|
||||
"leaf l1 {type instance-identifier; default \"/b1:l1\";}}", LYS_IN_YANG, NULL));
|
||||
ly_ctx_set_options(UTEST_LYCTX, 0);
|
||||
|
||||
/* invalid cases */
|
||||
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa; leaf l {type instance-identifier {require-instance yes;}}}", LYS_IN_YANG, &mod));
|
||||
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa; leaf l {type instance-identifier {require-instance yes;}}}", LYS_IN_YANG, NULL));
|
||||
CHECK_LOG_CTX("Parsing module \"aa\" failed.", NULL, 0);
|
||||
CHECK_LOG_CTX("Invalid value \"yes\" of \"require-instance\".", NULL, 1);
|
||||
|
||||
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa; leaf l {type instance-identifier {fraction-digits 1;}}}", LYS_IN_YANG, &mod));
|
||||
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa; leaf l {type instance-identifier {fraction-digits 1;}}}", LYS_IN_YANG, NULL));
|
||||
CHECK_LOG_CTX("Invalid type restrictions for instance-identifier type.", "/aa:l", 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -284,8 +284,6 @@ test_arg(void **state)
|
|||
|
||||
TEST_GET_ARGUMENT_SUCCESS("hello ", YCTX, Y_STR_ARG, "hello ", 5, " ", 1);
|
||||
|
||||
TEST_GET_ARGUMENT_SUCCESS("hello/*comment*/\n", YCTX, Y_STR_ARG, "hello/*comment*/\n", 5, "\n", 1);
|
||||
|
||||
TEST_GET_ARGUMENT_SUCCESS("\"hello\\n\\t\\\"\\\\\";", YCTX, Y_STR_ARG, "hello\n\t\"\\", 9, ";", 1);
|
||||
free(buf);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue