tests: modify smoother-test to use 'check' framework

This commit is contained in:
Deng Zhengrong 2012-07-29 05:59:46 +08:00 committed by Arun Raghavan
parent ca5ea07c42
commit 23fac14278
2 changed files with 25 additions and 5 deletions

View file

@ -476,8 +476,8 @@ remix_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
smoother_test_SOURCES = tests/smoother-test.c
smoother_test_LDADD = $(AM_LDADD) libpulsecore-@PA_MAJORMINOR@.la libpulse.la libpulsecommon-@PA_MAJORMINOR@.la
smoother_test_CFLAGS = $(AM_CFLAGS)
smoother_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
smoother_test_CFLAGS = $(AM_CFLAGS) $(LIBCHECK_CFLAGS)
smoother_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS) $(LIBCHECK_LIBS)
proplist_test_SOURCES = tests/proplist-test.c
proplist_test_LDADD = $(AM_LDADD) libpulsecore-@PA_MAJORMINOR@.la libpulse.la libpulsecommon-@PA_MAJORMINOR@.la

View file

@ -24,12 +24,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <check.h>
#include <pulse/timeval.h>
#include <pulsecore/log.h>
#include <pulsecore/time-smoother.h>
int main(int argc, char*argv[]) {
START_TEST (smoother_test) {
pa_usec_t x;
unsigned u = 0;
pa_smoother *s;
@ -80,6 +82,24 @@ int main(int argc, char*argv[]) {
}
pa_smoother_free(s);
return 0;
}
END_TEST
int main(int argc, char *argv[]) {
int failed = 0;
Suite *s;
TCase *tc;
SRunner *sr;
s = suite_create("Smoother");
tc = tcase_create("smoother");
tcase_add_test(tc, smoother_test);
suite_add_tcase(s, tc);
sr = srunner_create(s);
srunner_run_all(sr, CK_NORMAL);
failed = srunner_ntests_failed(sr);
srunner_free(sr);
return (failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}