Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(878)

Unified Diff: nih/tests/test_string.c

Issue 524041: Changes to make upstart log performance stats to a file. (Closed)
Patch Set: More tab/space stuff Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « nih/string.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nih/tests/test_string.c
diff --git a/nih/tests/test_string.c b/nih/tests/test_string.c
index 82c20f66895a689d6834758cd860cae770664136..2e16f97291cd6bbfbb13dd61eaca0ddc868155eb 100644
--- a/nih/tests/test_string.c
+++ b/nih/tests/test_string.c
@@ -663,6 +663,25 @@ test_str_split (void)
nih_free (array);
}
+
+ /* Check that we can give a string with only repeating
+ * delimiters, enable repeat, and we end up with a one-element
+ * array that only contains a NULL pointer.
+ */
+ TEST_FEATURE ("with empty string except for delimiters");
+ TEST_ALLOC_FAIL {
+ array = nih_str_split (NULL, " ", " ", TRUE);
+
+ if (test_alloc_failed) {
+ TEST_EQ_P (array, NULL);
+ continue;
+ }
+
+ TEST_ALLOC_SIZE (array, sizeof (char *));
+ TEST_EQ_P (array[0], NULL);
+
+ nih_free (array);
+ }
}
void
« no previous file with comments | « nih/string.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698