projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Diagnostic map tweaks for "Database does not exist"
[yaz-moved-to-github.git]
/
test
/
test_nmem.c
diff --git
a/test/test_nmem.c
b/test/test_nmem.c
index
1fac283
..
a9d1363
100644
(file)
--- a/
test/test_nmem.c
+++ b/
test/test_nmem.c
@@
-1,5
+1,5
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2011 Index Data
+ * Copyright (C) 1995-2012 Index Data
* See the file LICENSE for details.
*/
* See the file LICENSE for details.
*/
@@
-102,11
+102,19
@@
void tst_nmem_strsplit(void)
YAZ_CHECK(num > 1 && !strcmp(array[1], "b,"));
YAZ_CHECK(num > 2 && !strcmp(array[2], "cd"));
YAZ_CHECK(num > 1 && !strcmp(array[1], "b,"));
YAZ_CHECK(num > 2 && !strcmp(array[2], "cd"));
- nmem_strsplit_escape(nmem, ",", "\\,a,b\\,\\,c\\\\\\|d", &array, &num, 0, '\\');
+ nmem_strsplit_escape2(nmem, ",", "\\,a,b\\,\\,c\\\\\\|d",
+ &array, &num, 0, '\\', 1);
YAZ_CHECK(num == 2);
YAZ_CHECK(num > 0 && !strcmp(array[0], ",a"));
YAZ_CHECK(num > 1 && !strcmp(array[1], "b,,c\\|d"));
YAZ_CHECK(num == 2);
YAZ_CHECK(num > 0 && !strcmp(array[0], ",a"));
YAZ_CHECK(num > 1 && !strcmp(array[1], "b,,c\\|d"));
+
+ nmem_strsplit_escape2(nmem, ",", "\\,a,b\\,\\,c\\\\\\|d",
+ &array, &num, 0, '\\', 0);
+ YAZ_CHECK(num == 2);
+ YAZ_CHECK(num > 0 && !strcmp(array[0], "\\,a"));
+ YAZ_CHECK(num > 1 && !strcmp(array[1], "b\\,\\,c\\\\\\|d"));
+
nmem_destroy(nmem);
}
nmem_destroy(nmem);
}