joes 2004/07/01 19:52:45
Modified: t Makefile.am test_apreq.h testall.c
Added: t version.c
Log:
Add version test to ensure include file APIs match linked library API
Revision Changes Path
1.18 +1 -1 httpd-apreq-2/t/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/httpd-apreq-2/t/Makefile.am,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- Makefile.am 28 Feb 2004 05:19:39 -0000 1.17
+++ Makefile.am 2 Jul 2004 02:52:45 -0000 1.18
@@ -2,7 +2,7 @@
LIBS = ../src/libapreq2.la @APR_LTLIBS@ @APU_LTLIBS@
noinst_LIBRARIES = libapreq2_tests.a
-libapreq2_tests_a_SOURCES = CuTest.h test_apreq.h CuTest.c cookie.c params.c
parsers.c
+libapreq2_tests_a_SOURCES = CuTest.h test_apreq.h CuTest.c version.c
cookie.c params.c parsers.c
check_PROGRAMS = testall
testall_LDADD = libapreq2_tests.a
1.8 +1 -1 httpd-apreq-2/t/test_apreq.h
Index: test_apreq.h
===================================================================
RCS file: /home/cvs/httpd-apreq-2/t/test_apreq.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- test_apreq.h 28 Feb 2004 07:48:15 -0000 1.7
+++ test_apreq.h 2 Jul 2004 02:52:45 -0000 1.8
@@ -30,7 +30,7 @@
extern apr_pool_t *p;
CuSuite *getsuite(void);
-
+CuSuite *testversion(void);
CuSuite *testtable(void);
CuSuite *testcookie(void);
CuSuite *testenv(void);
1.14 +1 -1 httpd-apreq-2/t/testall.c
Index: testall.c
===================================================================
RCS file: /home/cvs/httpd-apreq-2/t/testall.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- testall.c 1 Jul 2004 14:39:30 -0000 1.13
+++ testall.c 2 Jul 2004 02:52:45 -0000 1.14
@@ -42,7 +42,7 @@
const char *testname;
CuSuite *(*func)(void);
} tests[] = {
-// {"tables", testtable},
+ {"version", testversion},
{"cookies", testcookie},
{"params", testparam},
{"parsers", testparser},
1.1 httpd-apreq-2/t/version.c
Index: version.c
===================================================================
/*
** Copyright 2003-2004 The Apache Software Foundation
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#include "apreq_version.h"
#include "test_apreq.h"
#include "apreq.h"
apr_version_t v;
const char *vstring;
static void version_string(CuTest *tc)
{
vstring = apreq_version_string();
CuAssertPtrNotNull(tc, vstring);
CuAssertStrEquals(tc, APREQ_VERSION_STRING, vstring);
}
static void version_number(CuTest *tc)
{
apreq_version(&v);
CuAssertIntEquals(tc, APREQ_MAJOR_VERSION, v.major);
CuAssertIntEquals(tc, APREQ_MINOR_VERSION, v.minor);
CuAssertIntEquals(tc, APREQ_PATCH_VERSION, v.patch);
#ifdef APREQ_IS_DEV_VERSION
CuAssertIntEquals(tc, 1, v.is_dev);
#endif
}
CuSuite *testversion(void)
{
CuSuite *suite = CuSuiteNew("Version");
SUITE_ADD_TEST(suite, version_string);
SUITE_ADD_TEST(suite, version_number);
return suite;
}