cleanup in ipc_msg test, update some string tests
authornsz <nsz@port70.net>
Mon, 22 Oct 2012 18:25:17 +0000 (20:25 +0200)
committernsz <nsz@port70.net>
Mon, 22 Oct 2012 18:25:17 +0000 (20:25 +0200)
src/general/ipc_msg.c
src/general/string_strchr.c
src/general/string_strcspn.c

index cbff705..dee4b82 100644 (file)
@@ -102,6 +102,9 @@ static void rcv()
        errno = 0;
        if (msgrcv(qid, &msg, sizeof msg.data, msgtyp, MSG_NOERROR|IPC_NOWAIT) != -1 || errno != ENOMSG)
                error("msgrcv should have failed when ther is no msg with ENOMSG, got %s\n", strerror(errno));
+
+       /* cleanup */
+       T(msgctl(qid, IPC_RMID, 0));
 }
 
 int main(void)
index 9ee4ca8..c05d881 100644 (file)
@@ -38,6 +38,12 @@ int main(void)
        T("a", 'a', 0)
        T("a", 'a'+256, 0)
        T("a", 0, 1)
+       T("ab", 'b', 1)
+       T("aab", 'b', 2)
+       T("aaab", 'b', 3)
+       T("aaaab", 'b', 4)
+       T("aaaaab", 'b', 5)
+       T("aaaaaab", 'b', 6)
        T("abc abc", 'c', 2)
        T(s, 1, 0)
        T(s, 2, 1)
index 39b907e..87fcd10 100644 (file)
@@ -25,6 +25,7 @@ int main(void)
        T("a", "", 1)
        T("", "a", 0)
        T("abc", "cde", 2)
+       T("abc", "ccc", 2)
        T("abc", a, 0)
        T("\xff\x80 abc", a, 2)
        T(s, "\xff", 254)