summaryrefslogtreecommitdiff
path: root/srclib/apr-util/test
diff options
context:
space:
mode:
Diffstat (limited to 'srclib/apr-util/test')
-rw-r--r--srclib/apr-util/test/NWGNUaputest (renamed from srclib/apr-util/test/nwgnuaputest)0
-rw-r--r--srclib/apr-util/test/nw_misc.c13
-rw-r--r--srclib/apr-util/test/testdbd.c8
-rw-r--r--srclib/apr-util/test/testxlate.c35
4 files changed, 49 insertions, 7 deletions
diff --git a/srclib/apr-util/test/nwgnuaputest b/srclib/apr-util/test/NWGNUaputest
index e2f4f845..e2f4f845 100644
--- a/srclib/apr-util/test/nwgnuaputest
+++ b/srclib/apr-util/test/NWGNUaputest
diff --git a/srclib/apr-util/test/nw_misc.c b/srclib/apr-util/test/nw_misc.c
index cf68692b..d00ef0e0 100644
--- a/srclib/apr-util/test/nw_misc.c
+++ b/srclib/apr-util/test/nw_misc.c
@@ -1,10 +1,21 @@
+#include <stdlib.h>
#include <netware.h>
#include <screen.h>
+/*
#include "testutil.h"
+*/
+/* function to keep the screen open if not launched from bash */
void _NonAppStop( void )
{
- pressanykey();
+ if (getenv("_IN_NETWARE_BASH_") == NULL) {
+ uint16_t row, col;
+
+ GetScreenSize(&row, &col);
+ gotorowcol(row-1, 0);
+ printf("<Press any key to close screen> ");
+ getcharacter();
+ }
}
/*
diff --git a/srclib/apr-util/test/testdbd.c b/srclib/apr-util/test/testdbd.c
index 682599eb..b94c491b 100644
--- a/srclib/apr-util/test/testdbd.c
+++ b/srclib/apr-util/test/testdbd.c
@@ -180,7 +180,7 @@ static void test_dbd_sqlite2(abts_case *tc, void *data)
apr_dbd_t* handle = NULL;
rv = apr_dbd_get_driver(pool, "sqlite2", &driver);
- ABTS_ASSERT(tc, "failed to fetch driver", rv == APR_SUCCESS);
+ ABTS_ASSERT(tc, "failed to fetch sqlite2 driver", rv == APR_SUCCESS);
ABTS_PTR_NOTNULL(tc, driver);
if (!driver) {
return;
@@ -189,7 +189,7 @@ static void test_dbd_sqlite2(abts_case *tc, void *data)
ABTS_STR_EQUAL(tc, "sqlite2", apr_dbd_name(driver));
rv = apr_dbd_open(driver, pool, "data/sqlite2.db:600", &handle);
- ABTS_ASSERT(tc, "failed to open database", rv == APR_SUCCESS);
+ ABTS_ASSERT(tc, "failed to open sqlite2 atabase", rv == APR_SUCCESS);
ABTS_PTR_NOTNULL(tc, handle);
if (!handle) {
return;
@@ -208,7 +208,7 @@ static void test_dbd_sqlite3(abts_case *tc, void *data)
apr_dbd_t* handle = NULL;
rv = apr_dbd_get_driver(pool, "sqlite3", &driver);
- ABTS_ASSERT(tc, "failed to fetch driver", rv == APR_SUCCESS);
+ ABTS_ASSERT(tc, "failed to fetch sqlite3 driver", rv == APR_SUCCESS);
ABTS_PTR_NOTNULL(tc, driver);
if (!driver) {
return;
@@ -217,7 +217,7 @@ static void test_dbd_sqlite3(abts_case *tc, void *data)
ABTS_STR_EQUAL(tc, "sqlite3", apr_dbd_name(driver));
rv = apr_dbd_open(driver, pool, "data/sqlite3.db", &handle);
- ABTS_ASSERT(tc, "failed to open database", rv == APR_SUCCESS);
+ ABTS_ASSERT(tc, "failed to open sqlite3 database", rv == APR_SUCCESS);
ABTS_PTR_NOTNULL(tc, handle);
if (!handle) {
return;
diff --git a/srclib/apr-util/test/testxlate.c b/srclib/apr-util/test/testxlate.c
index 89c26090..6981eff6 100644
--- a/srclib/apr-util/test/testxlate.c
+++ b/srclib/apr-util/test/testxlate.c
@@ -71,6 +71,33 @@ static void one_test(abts_case *tc, const char *cs1, const char *cs2,
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
}
+#if APU_HAVE_APR_ICONV
+/* it is a bug if iconv_open() fails */
+static int is_transform_supported(abts_case *tc, const char *cs1,
+ const char *cs2, apr_pool_t *pool) {
+ return 1;
+}
+#else
+/* some iconv implementations don't support all tested transforms;
+ * example: 8859-1 <-> 8859-2 using native Solaris iconv
+ */
+static int is_transform_supported(abts_case *tc, const char *cs1,
+ const char *cs2, apr_pool_t *pool) {
+ apr_status_t rv;
+ apr_xlate_t *convset;
+
+ rv = apr_xlate_open(&convset, cs2, cs1, pool);
+ if (rv != APR_SUCCESS) {
+ return 0;
+ }
+
+ rv = apr_xlate_close(convset);
+ ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+
+ return 1;
+}
+#endif
+
static void test_transformation(abts_case *tc, void *data)
{
/* 1. Identity transformation: UTF-8 -> UTF-8 */
@@ -81,8 +108,12 @@ static void test_transformation(abts_case *tc, void *data)
one_test(tc, "ISO-8859-1", "UTF-8", test_latin1, test_utf8, p);
/* 3. ISO-8859-1 <-> ISO-8859-2, identity */
- one_test(tc, "ISO-8859-1", "ISO-8859-2", test_latin1, test_latin2, p);
- one_test(tc, "ISO-8859-2", "ISO-8859-1", test_latin2, test_latin1, p);
+ if (is_transform_supported(tc, "ISO-8859-1", "ISO-8859-2", p)) {
+ one_test(tc, "ISO-8859-1", "ISO-8859-2", test_latin1, test_latin2, p);
+ }
+ if (is_transform_supported(tc, "ISO-8859-2", "ISO-8859-1", p)) {
+ one_test(tc, "ISO-8859-2", "ISO-8859-1", test_latin2, test_latin1, p);
+ }
/* 4. Transformation using charset aliases */
one_test(tc, "UTF-8", "UTF-7", test_utf8, test_utf7, p);