Protocol test stub.
This commit is contained in:
parent
caf2349a64
commit
3cca318f8e
@ -68,8 +68,9 @@ AC_FUNC_MALLOC
|
||||
AC_FUNC_REALLOC
|
||||
AC_CHECK_FUNCS([clock_gettime gettimeofday memmove memset select strdup png_get_io_ptr nanosleep])
|
||||
|
||||
# Check for "Check" (for unit tests)
|
||||
PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
|
||||
# Check for unit testing library
|
||||
AC_CHECK_LIB([cunit], [CU_run_test], [CUNIT_LIBS=-lcunit])
|
||||
AC_SUBST(CUNIT_LIBS)
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
src/Makefile
|
||||
|
@ -40,6 +40,5 @@ ACLOCAL_AMFLAGS = -I m4
|
||||
TESTS = test_protocol
|
||||
check_PROGRAMS = test_protocol
|
||||
test_protocol_SOURCES = test_protocol.c
|
||||
test_protocol_CFLAGS = @CHECK_CFLAGS@
|
||||
test_protocol_LDADD = $(top_builddir)/src/libguac.la @CHECK_LIBS@
|
||||
test_protocol_LDADD = $(top_builddir)/src/libguac.la @CUNIT_LIBS@
|
||||
|
||||
|
@ -35,7 +35,47 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
int main() {
|
||||
#include <CUnit/Basic.h>
|
||||
|
||||
int init_suite() {
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user