Add test for user
authorJelmer Vernooij <jelmer@samba.org>
Fri, 16 Jun 2006 14:26:25 +0000 (16:26 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Fri, 16 Jun 2006 14:26:25 +0000 (16:26 +0200)
.bzrignore
Makefile
testsuite/test-cmp.c
testsuite/test-user.c [new file with mode: 0644]
testsuite/torture.c

index a147de4507885e95859b3987041a30f701bc6fec..6765750df0fab3b5c919fedb7d16ca80bf4c08fa 100644 (file)
@@ -4,7 +4,6 @@ autom4te.cache
 config.h
 config.h.in
 config.log
-config.log
 config.status
 configure
 ctrlproxy
@@ -40,13 +39,10 @@ po/Makefile.in
 po/POTFILES
 po/ctrlproxy.pot
 po/stamp-po
-rfctester/ircdtorture
-rfctester/test-*.so
 tags
 testlinestack
 testsuite/*.so
 testsuite/ctrlproxyrc.torture
-testsuite/torture
 mods/python2/__init__.py
 testsuite/test-state
 doc/*.html
index 2ebab48f1873b072c62cdd54e8eff07c0130f61b..40da24366f5fd60f314de84b137edafdec1e5b34 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -162,7 +162,7 @@ rfctest: testsuite/ctrlproxyrc.torture
 
 # Unit tests
 
-testsuite/check: testsuite/test-cmp.o testsuite/test-isupport.o testsuite/test-parser.o testsuite/test-state.o testsuite/test-util.o testsuite/torture.o $(objs)
+testsuite/check: testsuite/test-cmp.o testsuite/test-user.o testsuite/test-isupport.o testsuite/test-parser.o testsuite/test-state.o testsuite/test-util.o testsuite/torture.o $(objs)
        @echo Linking $@
        @$(CC) $(LIBS) -o $@ $^ -lcheck
 
index 9a99fc18e804dab5f3ea885151103476515d280f..59192c76ef70ce27fa08ef1c589f23c8be075ed7 100644 (file)
@@ -27,6 +27,8 @@ START_TEST(test_rfccmp)
        fail_if (str_rfc1459cmp("abcde", "ABCDE") != 0);
        fail_if (str_rfc1459cmp("abcde~{}", "ABCDE^[]") != 0);
        fail_if (str_asciicmp("abcde", "ABCDE") != 0);
+       fail_if (str_asciicmp("abcde[]", "ABCDE[]") != 0);
+       fail_if (str_asciicmp("abcde{}", "ABCDE[]") == 0);
        fail_if (str_strictrfc1459cmp("abcde{}", "ABCDE[]") != 0);
        fail_if (str_strictrfc1459cmp("abcde{}^", "ABCDE[]~") == 0);
        fail_if (str_strictrfc1459cmp("abcde{}", "abcde{}") != 0);
diff --git a/testsuite/test-user.c b/testsuite/test-user.c
new file mode 100644 (file)
index 0000000..02eeb4b
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+    ircdtorture: an IRC RFC compliancy tester
+       (c) 2005 Jelmer Vernooij <jelmer@nl.linux.org>
+
+       This program is free software; you can redistribute it and/or modify
+       it under the terms of the GNU General Public License as published by
+       the Free Software Foundation; either version 2 of the License, or
+       (at your option) any later version.
+
+       This program is distributed in the hope that it will be useful,
+       but WITHOUT ANY WARRANTY; without even the implied warranty of
+       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+       GNU General Public License for more details.
+
+       You should have received a copy of the GNU General Public License
+       along with this program; if not, write to the Free Software
+       Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <check.h>
+#include "internals.h"
+
+START_TEST(test_create)
+       struct global *gl;
+       
+       gl = new_global(DEFAULT_CONFIG_DIR);
+
+       fail_if(gl == NULL, "new_global returned NULL");
+
+       free_global(gl);
+END_TEST
+
+Suite *user_suite()
+{
+       Suite *s = suite_create("testsuite");
+       TCase *tc_core = tcase_create("core");
+       suite_add_tcase(s, tc_core);
+       tcase_add_test(tc_core, test_create);
+       return s;
+}
+
index 308920543ec7d042b713c85eda6c3167b51f725e..6ecba57e5a48d00905eab2e1b1423f1fb56c19dd 100644 (file)
@@ -34,6 +34,7 @@ Suite *state_suite(void);
 Suite *isupport_suite(void);
 Suite *cmp_suite(void);
 Suite *parser_suite(void);
+Suite *user_suite(void);
 
 int main (void)
 {
@@ -43,6 +44,7 @@ int main (void)
        srunner_add_suite(sr, isupport_suite());
        srunner_add_suite(sr, cmp_suite());
        srunner_add_suite(sr, parser_suite());
+       srunner_add_suite(sr, user_suite());
        srunner_run_all (sr, CK_NORMAL);
        nf = srunner_ntests_failed(sr);
        srunner_free(sr);