svn commit: r1934299 - in apr/apr/trunk: . test
[email protected] Sun, 17 May 2026 14:04:25 -0000
| Newsgroups | gmane.comp.apache.apr.cvs |
|---|---|
| Message-ID | <177902666595.4018785.601216045691388447@svn03-he-fi> |
Author: ivan
Date: Sun May 17 14:04:25 2026
New Revision: 1934299
Log:
Add minimal test for apr_os_default_encoding() and apr_os_locale_encoding().
Added:
apr/apr/trunk/test/testcharset.c (contents, props changed)
Modified:
apr/apr/trunk/CMakeLists.txt
apr/apr/trunk/test/Makefile.in
apr/apr/trunk/test/abts_tests.h
apr/apr/trunk/test/testutil.h
Modified: apr/apr/trunk/CMakeLists.txt
==============================================================================
--- apr/apr/trunk/CMakeLists.txt Sun May 17 13:37:55 2026 (r1934298)
+++ apr/apr/trunk/CMakeLists.txt Sun May 17 14:04:25 2026 (r1934299)
@@ -417,6 +417,7 @@ set(APR_TEST_SUITES
testbase64
testbuckets
testbuffer
+ testcharset
testcond
testcrypto
testdate
Modified: apr/apr/trunk/test/Makefile.in
==============================================================================
--- apr/apr/trunk/test/Makefile.in Sun May 17 13:37:55 2026 (r1934298)
+++ apr/apr/trunk/test/Makefile.in Sun May 17 14:04:25 2026 (r1934299)
@@ -38,7 +38,7 @@ TESTS = testtime.lo teststr.lo testvsn.l
testreslist.lo testbase64.lo testhooks.lo testlfsabi.lo \
testlfsabi32.lo testlfsabi64.lo testescape.lo testskiplist.lo \
testsiphash.lo testredis.lo testencode.lo testjson.lo \
- testjose.lo testbuffer.lo testldap.lo
+ testjose.lo testbuffer.lo testldap.lo testcharset.lo
OTHER_PROGRAMS = \
echod@EXEEXT@ \
Modified: apr/apr/trunk/test/abts_tests.h
==============================================================================
--- apr/apr/trunk/test/abts_tests.h Sun May 17 13:37:55 2026 (r1934298)
+++ apr/apr/trunk/test/abts_tests.h Sun May 17 14:04:25 2026 (r1934299)
@@ -24,6 +24,7 @@ const struct testlist {
abts_suite *(*func)(abts_suite *suite);
} alltests[] = {
{testatomic},
+ {testcharset},
{testdir},
{testdso},
{testdup},
Added: apr/apr/trunk/test/testcharset.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ apr/apr/trunk/test/testcharset.c Sun May 17 14:04:25 2026 (r1934299)
@@ -0,0 +1,60 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "apr_portable.h"
+
+#include "abts.h"
+#include "testutil.h"
+
+static void test_os_default_encoding(abts_case *tc, void *data)
+{
+ apr_pool_t *pool;
+ const char *encoding;
+
+ apr_pool_create(&pool, NULL);
+
+ encoding = apr_os_default_encoding(pool);
+
+ /* We cannot assert for actual value, so just log it. */
+ abts_log_message("apr_os_default_encoding() = %s", encoding);
+}
+
+static void test_os_locale_encoding(abts_case *tc, void *data)
+{
+ apr_pool_t *pool;
+ const char *encoding;
+
+ apr_pool_create(&pool, NULL);
+
+ encoding = apr_os_locale_encoding(pool);
+
+ /* We cannot assert for actual value, so just log it. */
+ abts_log_message("apr_os_locale_encoding() = %s", encoding);
+}
+
+abts_suite *testcharset(abts_suite *suite)
+{
+ suite = ADD_SUITE(suite);
+
+ abts_run_test(suite, test_os_default_encoding, NULL);
+ abts_run_test(suite, test_os_locale_encoding, NULL);
+
+ return suite;
+}
Modified: apr/apr/trunk/test/testutil.h
==============================================================================
--- apr/apr/trunk/test/testutil.h Sun May 17 13:37:55 2026 (r1934298)
+++ apr/apr/trunk/test/testutil.h Sun May 17 14:04:25 2026 (r1934299)
@@ -65,6 +65,7 @@ void apr_assert_failure(abts_case* tc, c
void initialize(void);
abts_suite *testatomic(abts_suite *suite);
+abts_suite *testcharset(abts_suite *suite);
abts_suite *testdir(abts_suite *suite);
abts_suite *testdso(abts_suite *suite);
abts_suite *testdup(abts_suite *suite);