test: added metakey test for arrays
@@ -190,6 +190,20 @@ static void testexportmissing (const char * file)
PLUGIN_CLOSE ();
}
+static void testKeyMetaKeyIsSet (const char * file)
+{
+ Key * parentKey = keyNew ("user:/tests/csvstorage", KEY_VALUE, srcdir_file (file), KEY_END);
+ KeySet * conf = ksNew (10, keyNew ("system:/delimiter", KEY_VALUE, ";", KEY_END), keyNew ("system:/export", KEY_VALUE, "", KEY_END),
+ keyNew ("system:/export/a", KEY_VALUE, "", KEY_END), KS_END);
+ PLUGIN_OPEN ("csvstorage");
+ KeySet * ks = ksNew (0, KS_END);
+ succeed_if (plugin->kdbGet (plugin, ks, parentKey) > 0, "call to kdbGet was not successful");
+ Key * key;
+ key = ksLookupByName (ks, "user:/tests/csvstorage/#0", 0);
+ succeed_if (keyGetMeta (key, "array") != 0, "metakey not found");
+}
+
+
int main (int argc, char ** argv)
{
printf ("CSVSTORAGE TESTS\n");
@@ -208,6 +222,7 @@ int main (int argc, char ** argv)
testreadwritecomplicated ("csvstorage/complicated.csv");
testreadunescapedDQuote ("csvstorage/unescapedQuote.csv");
testexportmissing ("csvstorage/exporttest.csv");
+ testKeyMetaKeyIsSet ("csvstorage/metakey.csv");
print_result ("testmod_csvstorage");
return nbError;
