static void test_simpleCutOnGet () { Key *parentKey = keyNew ("user/tests/rename", KEY_END); KeySet *conf = ksNew (20, keyNew ("system/cut", KEY_VALUE, "will/be/stripped", KEY_END), KS_END); PLUGIN_OPEN("rename"); KeySet *ks = createSimpleTestKeys(); ksAppendKey(ks, parentKey); succeed_if(plugin->kdbGet (plugin, ks, parentKey) >= 1, "call to kdbGet was not successful"); succeed_if(output_error (parentKey), "error in kdbGet"); succeed_if(output_warnings (parentKey), "warnings in kdbGet"); checkSimpleTestKeys (ks); ksDel(ks); /* * this has to be done because the parentKey is not * part of ks anymore due to renaming */ keyDel(parentKey); PLUGIN_CLOSE (); }
static void test_metaCutOnGet () { Key * parentKey = keyNew ("user/tests/rename", KEY_END); KeySet * conf = ksNew (0, KS_END); PLUGIN_OPEN ("rename"); KeySet * ks = createSimpleMetaTestKeys (); ksAppendKey (ks, parentKey); succeed_if (plugin->kdbGet (plugin, ks, parentKey) >= 1, "call to kdbGet was not successful"); succeed_if (output_error (parentKey), "error in kdbGet"); succeed_if (output_warnings (parentKey), "warnings in kdbGet"); checkSimpleTestKeys (ks); keyDel (parentKey); ksDel (ks); PLUGIN_CLOSE (); }