reference: add test case for empty restriction
@@ -277,6 +277,13 @@ static void test_restriction (void)
TEST_SET (positive, ELEKTRA_PLUGIN_STATUS_NO_UPDATE)
RESET (positive)
+ WITH_KEYS (empty_positive, 2,
+ keyNew (BASE_KEY "/ref", KEY_VALUE, "", KEY_META, CHECK_REFERENCE_KEYNAME, CHECK_REFERNCE_VALUE_SINGLE,
+ KEY_META, CHECK_REFERENCE_RESTRICT_KEYNAME, "", KEY_END),
+ KS_END)
+ TEST_SET (empty_positive, ELEKTRA_PLUGIN_STATUS_NO_UPDATE)
+ RESET (empty_positive)
+
WITH_KEYS (negative, 2,
keyNew (BASE_KEY "/ref", KEY_VALUE, BASE_KEY "/no/target", KEY_META, CHECK_REFERENCE_KEYNAME,
CHECK_REFERNCE_VALUE_SINGLE, KEY_META, CHECK_REFERENCE_RESTRICT_KEYNAME, "../yes/**", KEY_END),
@@ -285,6 +292,14 @@ static void test_restriction (void)
EXPECT_ERROR (negative, ELEKTRA_ERROR_REFERENCE_RESTRICTION)
RESET (negative)
+ WITH_KEYS (empty_negative, 2,
+ keyNew (BASE_KEY "/ref", KEY_VALUE, BASE_KEY "/target", KEY_META, CHECK_REFERENCE_KEYNAME, CHECK_REFERNCE_VALUE_SINGLE,
+ KEY_META, CHECK_REFERENCE_RESTRICT_KEYNAME, "", KEY_END),
+ keyNew (BASE_KEY "/target", KEY_END), KS_END)
+ TEST_SET (empty_negative, ELEKTRA_PLUGIN_STATUS_ERROR)
+ EXPECT_ERROR (empty_negative, ELEKTRA_ERROR_REFERENCE_RESTRICTION)
+ RESET (empty_negative)
+
TEARDOWN ()
}
