Protocol test stub.

This commit is contained in:
Michael Jumper 2012-07-22 22:08:01 -07:00
parent caf2349a64
commit 3cca318f8e
3 changed files with 45 additions and 5 deletions

View File

@ -68,8 +68,9 @@ AC_FUNC_MALLOC
AC_FUNC_REALLOC AC_FUNC_REALLOC
AC_CHECK_FUNCS([clock_gettime gettimeofday memmove memset select strdup png_get_io_ptr nanosleep]) AC_CHECK_FUNCS([clock_gettime gettimeofday memmove memset select strdup png_get_io_ptr nanosleep])
# Check for "Check" (for unit tests) # Check for unit testing library
PKG_CHECK_MODULES([CHECK], [check >= 0.9.4]) AC_CHECK_LIB([cunit], [CU_run_test], [CUNIT_LIBS=-lcunit])
AC_SUBST(CUNIT_LIBS)
AC_CONFIG_FILES([Makefile AC_CONFIG_FILES([Makefile
src/Makefile src/Makefile

View File

@ -40,6 +40,5 @@ ACLOCAL_AMFLAGS = -I m4
TESTS = test_protocol TESTS = test_protocol
check_PROGRAMS = test_protocol check_PROGRAMS = test_protocol
test_protocol_SOURCES = test_protocol.c test_protocol_SOURCES = test_protocol.c
test_protocol_CFLAGS = @CHECK_CFLAGS@ test_protocol_LDADD = $(top_builddir)/src/libguac.la @CUNIT_LIBS@
test_protocol_LDADD = $(top_builddir)/src/libguac.la @CHECK_LIBS@

View File

@ -35,7 +35,47 @@
* *
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
int main() { #include <CUnit/Basic.h>
int init_suite() {
return 0; return 0;
} }
int cleanup_suite() {
return 0;
}
void test_unicode() {
}
int main() {
CU_pSuite pSuite;
/* Init registry */
if (CU_initialize_registry() != CUE_SUCCESS)
return CU_get_error();
/* Add protocol test suite */
pSuite = CU_add_suite("protocol", init_suite, cleanup_suite);
if (pSuite == NULL) {
CU_cleanup_registry();
return CU_get_error();
}
/* Add tests */
if (
CU_add_test(pSuite, "unicode-support", test_unicode) == NULL
) {
CU_cleanup_registry();
return CU_get_error();
}
/* Run tests */
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
CU_cleanup_registry();
return CU_get_error();
}