summaryrefslogtreecommitdiff
path: root/test/testvsn.c
diff options
context:
space:
mode:
authorRyan Bloom <rbb@apache.org>2002-10-13 02:20:34 +0000
committerRyan Bloom <rbb@apache.org>2002-10-13 02:20:34 +0000
commit7bb8fef195e4c1f58d08e237612e8cb6da033174 (patch)
treec16a5b18ec6e5bc80310093c5cade45d63bb1132 /test/testvsn.c
parentd6664612e59a63b6a0b268603ae2090b1179ade7 (diff)
downloadapr-7bb8fef195e4c1f58d08e237612e8cb6da033174.tar.gz
Convert testvsn to the new test suite.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63907 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testvsn.c')
-rw-r--r--test/testvsn.c42
1 files changed, 27 insertions, 15 deletions
diff --git a/test/testvsn.c b/test/testvsn.c
index ad4b7d722..9ac9d2ff1 100644
--- a/test/testvsn.c
+++ b/test/testvsn.c
@@ -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