add common test support routines and reporting
This commit was SVN r1981.
Этот коммит содержится в:
родитель
01bedc62e1
Коммит
33c1952c79
@ -25,7 +25,8 @@ ompi_numtostr_LDADD = \
|
||||
$(top_builddir)/src/threads/mutex_pthread.lo \
|
||||
$(top_builddir)/src/threads/mutex_spinlock.lo \
|
||||
$(top_builddir)/src/threads/mutex_spinwait.lo \
|
||||
$(top_builddir)/src/util/numtostr.lo
|
||||
$(top_builddir)/src/util/numtostr.lo \
|
||||
$(top_builddir)/test/support/libsupport.la
|
||||
ompi_numtostr_DEPENDENCIES = $(ompi_numtostr_LDADD)
|
||||
|
||||
ompi_argv_SOURCES = ompi_argv.c
|
||||
|
@ -4,19 +4,26 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "support.h"
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
char * tst;
|
||||
char * expected;
|
||||
|
||||
test_init("ompi_numtostr_t");
|
||||
|
||||
tst = ltostr(10);
|
||||
expected = malloc(sizeof(long) * 8);
|
||||
snprintf(expected, sizeof(long) * 8, "%d", 10);
|
||||
if (strcmp(tst, expected) != 0) {
|
||||
exit(1);
|
||||
test_failure("ltostr test failed");
|
||||
}
|
||||
|
||||
else {
|
||||
test_success();
|
||||
}
|
||||
|
||||
free(tst);
|
||||
free(expected);
|
||||
|
||||
@ -24,8 +31,13 @@ main(int argc, char *argv[])
|
||||
expected = malloc(sizeof(long) * 8);
|
||||
snprintf(expected, sizeof(long) * 8, "%f", 5.32);
|
||||
if (strcmp(tst, expected) != 0) {
|
||||
exit(1);
|
||||
test_failure("dtostr test failed");
|
||||
}
|
||||
else {
|
||||
test_success();
|
||||
}
|
||||
|
||||
test_finalize();
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user