mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
build
cmake_modules
conf
debian
docs
dtd
freeswitch.xcodeproj
htdocs
libs
apr
atomic
build
docs
dso
file_io
helpers
images
include
locks
memory
misc
mmap
network_io
passwd
poll
random
shmem
strings
support
tables
test
data
internal
Makefile.in
Makefile.win
NWGNUmakefile
README
abts.c
abts.h
abts_tests.h
aprtest.def
aprtest.dsp
aprtest.win
globalmutexchild.c
mod_test.c
nw_misc.c
nwgnuaprtest
nwgnuglobalmutexchild
nwgnumod_test
nwgnuproc_child
nwgnureadchild
nwgnusockchild
nwgnutestatmc
nwgnutryread
occhild.c
proc_child.c
readchild.c
sendfile.c
sockchild.c
testall.dsp
testall.dsw
testapp.c
testapp.dsp
testappnt.dsp
testargs.c
testatomic.c
testdir.c
testdso.c
testdup.c
testenv.c
testfile.c
testfilecopy.c
testfileinfo.c
testflock.c
testflock.h
testfmt.c
testfnmatch.c
testglobalmutex.c
testglobalmutex.h
testhash.c
testipsub.c
testlfs.c
testlock.c
testlockperf.c
testmmap.c
testmutexscope.c
testnames.c
testoc.c
testpath.c
testpipe.c
testpoll.c
testpools.c
testproc.c
testprocmutex.c
testrand.c
testrand2.c
testshm.c
testshm.h
testshmconsumer.c
testshmproducer.c
testsleep.c
testsock.c
testsock.h
testsockets.c
testsockopt.c
teststr.c
teststrnatcmp.c
testtable.c
testtemp.c
testthread.c
testtime.c
testud.c
testuser.c
testutil.c
testutil.h
testvsn.c
tryread.c
threadproc
time
user
.update
CHANGES
CMakeLists.txt
LICENSE
Makefile.in
NOTICE
NWGNUmakefile
README.dev
apr-config.in
apr.dsp
apr.dsw
apr.pc.in
apr.spec
build-outputs.mk
build.conf
buildconf
config.layout
configure.gnu
configure.in
emacs-mode
libapr.dsp
libapr.rc
libaprnw.mcp.zip
renames_pending
apr-util
curl
esl
iksemel
ilbc
js
libdingaling
libedit
libg722_1
libsndfile
libteletone
pcre
portaudio
sofia-sip
spandsp
speex
sqlite
srtp
stfu
udns
voipcodecs
win32
xmlrpc-c
yaml
scripts
src
support-d
w32
CMakeLists.txt
Freeswitch.2005.unsupported.sln
Freeswitch.2008.express.sln
Freeswitch.2008.sln
INSTALL
Makefile.am
acinclude.m4
bootstrap.sh
configure.in
freeswitch.spec
79 lines
2.4 KiB
C
79 lines
2.4 KiB
C
![]() |
/* 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 "apr_file_io.h"
|
||
|
#include "apr_errno.h"
|
||
|
#include "apr_strings.h"
|
||
|
#include "testutil.h"
|
||
|
|
||
|
static void less0(abts_case *tc, void *data)
|
||
|
{
|
||
|
int rv = apr_strnatcmp("a", "b");
|
||
|
ABTS_ASSERT(tc, "didn't compare simple strings properly", rv < 0);
|
||
|
}
|
||
|
|
||
|
static void str_equal(abts_case *tc, void *data)
|
||
|
{
|
||
|
int rv = apr_strnatcmp("a", "a");
|
||
|
ABTS_ASSERT(tc, "didn't compare simple strings properly", rv == 0);
|
||
|
}
|
||
|
|
||
|
static void more0(abts_case *tc, void *data)
|
||
|
{
|
||
|
int rv = apr_strnatcmp("b", "a");
|
||
|
ABTS_ASSERT(tc, "didn't compare simple strings properly", rv > 0);
|
||
|
}
|
||
|
|
||
|
static void less_ignore_case(abts_case *tc, void *data)
|
||
|
{
|
||
|
int rv = apr_strnatcasecmp("a", "B");
|
||
|
ABTS_ASSERT(tc, "didn't compare simple strings properly", rv < 0);
|
||
|
}
|
||
|
|
||
|
static void str_equal_ignore_case(abts_case *tc, void *data)
|
||
|
{
|
||
|
int rv = apr_strnatcasecmp("a", "A");
|
||
|
ABTS_ASSERT(tc, "didn't compare simple strings properly", rv == 0);
|
||
|
}
|
||
|
|
||
|
static void more_ignore_case(abts_case *tc, void *data)
|
||
|
{
|
||
|
int rv = apr_strnatcasecmp("b", "A");
|
||
|
ABTS_ASSERT(tc, "didn't compare simple strings properly", rv > 0);
|
||
|
}
|
||
|
|
||
|
static void natcmp(abts_case *tc, void *data)
|
||
|
{
|
||
|
int rv = apr_strnatcasecmp("a2", "a10");
|
||
|
ABTS_ASSERT(tc, "didn't compare simple strings properly", rv < 0);
|
||
|
}
|
||
|
|
||
|
abts_suite *teststrnatcmp(abts_suite *suite)
|
||
|
{
|
||
|
suite = ADD_SUITE(suite)
|
||
|
|
||
|
abts_run_test(suite, less0, NULL);
|
||
|
abts_run_test(suite, str_equal, NULL);
|
||
|
abts_run_test(suite, more0, NULL);
|
||
|
abts_run_test(suite, less_ignore_case, NULL);
|
||
|
abts_run_test(suite, str_equal_ignore_case, NULL);
|
||
|
abts_run_test(suite, more_ignore_case, NULL);
|
||
|
abts_run_test(suite, natcmp, NULL);
|
||
|
|
||
|
return suite;
|
||
|
}
|
||
|
|