You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by rb...@apache.org on 2002/10/13 04:20:35 UTC
cvs commit: apr/test Makefile.in test_apr.h testall.c testvsn.c
rbb 2002/10/12 19:20:34
Modified: test Makefile.in test_apr.h testall.c testvsn.c
Log:
Convert testvsn to the new test suite.
Revision Changes Path
1.92 +2 -2 apr/test/Makefile.in
Index: Makefile.in
===================================================================
RCS file: /home/cvs/apr/test/Makefile.in,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -r1.91 -r1.92
--- Makefile.in 15 Sep 2002 22:51:28 -0000 1.91
+++ Makefile.in 13 Oct 2002 02:20:34 -0000 1.92
@@ -209,8 +209,8 @@
testtable@EXEEXT@: testtable.lo $(LOCAL_LIBS)
$(LINK) testtable.lo $(LOCAL_LIBS) $(ALL_LIBS)
-testall: testall.lo testtime.lo teststr.lo CuTest.lo $(LOCAL_LIBS)
- $(LINK) testall.lo testtime.lo teststr.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS)
+testall: testall.lo testtime.lo teststr.lo testvsn.lo CuTest.lo $(LOCAL_LIBS)
+ $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS)
# DO NOT REMOVE
1.11 +1 -0 apr/test/test_apr.h
Index: test_apr.h
===================================================================
RCS file: /home/cvs/apr/test/test_apr.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- test_apr.h 10 Oct 2002 13:21:19 -0000 1.10
+++ test_apr.h 13 Oct 2002 02:20:34 -0000 1.11
@@ -75,6 +75,7 @@
CuSuite *teststr(void);
CuSuite *testtime(void);
+CuSuite *testvsn(void);
1.3 +3 -2 apr/test/testall.c
Index: testall.c
===================================================================
RCS file: /home/cvs/apr/test/testall.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- testall.c 16 Sep 2002 11:08:46 -0000 1.2
+++ testall.c 13 Oct 2002 02:20:34 -0000 1.3
@@ -57,7 +57,7 @@
#include "test_apr.h"
-#define NUM_TESTS 2
+#define NUM_TESTS 3
apr_pool_t *p;
@@ -65,7 +65,8 @@
testfunc *tests[NUM_TESTS] = {
teststr,
- testtime
+ testtime,
+ testvsn
};
int main(int argc, char *argv[])
1.4 +27 -15 apr/test/testvsn.c
Index: testvsn.c
===================================================================
RCS file: /home/cvs/apr/test/testvsn.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- testvsn.c 30 Apr 2002 05:07:03 -0000 1.3
+++ testvsn.c 13 Oct 2002 02:20:34 -0000 1.4
@@ -54,28 +54,40 @@
#include <stdio.h>
+#include "test_apr.h"
#include "apr_version.h"
#include "apr_general.h"
-int main(int argc, char **argv)
+static void test_strings(CuTest *tc)
{
- apr_version_t vsn;
+ CuAssertStrEquals(tc, APR_VERSION_STRING, apr_version_string());
+}
- printf("compiled integer form: %d.%d.%d%s\ncompiled string form: %s\n",
- APR_MAJOR_VERSION, APR_MINOR_VERSION, APR_PATCH_VERSION,
-#ifdef APR_IS_DEV_VERSION
- "-dev",
-#else
- "",
-#endif
- APR_VERSION_STRING);
+static void test_ints(CuTest *tc)
+{
+ apr_version_t vsn;
apr_version(&vsn);
- printf("runtime integer form: %d.%d.%d%s\nruntime string form: %s\n",
- vsn.major, vsn.minor, vsn.patch,
- vsn.is_dev ? "-dev" : "",
- apr_version_string());
- return 0;
+ CuAssertIntEquals(tc, APR_MAJOR_VERSION, vsn.major);
+ CuAssertIntEquals(tc, APR_MINOR_VERSION, vsn.minor);
+ CuAssertIntEquals(tc, APR_PATCH_VERSION, vsn.patch);
+}
+
+CuSuite *testvsn(void)
+{
+ CuSuite *suite = CuSuiteNew("Test Versioning");
+
+ SUITE_ADD_TEST(suite, test_strings);
+ SUITE_ADD_TEST(suite, test_ints);
+
+ return suite;
}
+
+#ifdef SINGLE_PROG
+CuSuite *getsuite(void)
+{
+ return testvsn();
+}
+#endif