Unit tests update

This commit is contained in:
Markus Gans 2018-03-14 00:53:28 +01:00
parent 380d3d625c
commit 61f2a4677c
9 changed files with 417 additions and 19 deletions

View File

@ -401,7 +401,10 @@ void FButton::onMouseMove (FMouseEvent* ev)
void FButton::onTimer (FTimerEvent* ev)
{
delTimer(ev->timerId());
clearShadow();
if ( hasShadow() )
clearShadow();
setUp();
}
@ -569,7 +572,7 @@ inline int FButton::clickAnimationIndent (FWidget* parent_widget)
// noshadow + indent one character to the right
if ( is.flat )
clearFlatBorder();
else
else if ( hasShadow() )
clearShadow();
if ( parent_widget )

View File

@ -102,6 +102,8 @@ FObject::~FObject() // destructor
//----------------------------------------------------------------------
FObject* FObject::getChild (int index) const
{
// returns the child for the index number
if ( ! hasChildren() )
return 0;
@ -117,6 +119,8 @@ FObject* FObject::getChild (int index) const
//----------------------------------------------------------------------
bool FObject::isChild (FObject* obj) const
{
// Find out if obj is a child object of mine
FObject* p_obj = 0;
while ( obj && (p_obj = obj->getParent()) )

View File

@ -1838,7 +1838,7 @@ FString FString::replace (const FString& from, const FString& to)
if ( from.isNull() || to.isNull() )
return s;
if ( from.isEmpty() || to.isEmpty() )
if ( from.isEmpty() )
return s;
p = s.string;
@ -2139,7 +2139,7 @@ FString FString::replace (const wchar_t from, const FString& to)
if ( ! (string && *string) )
return s;
if ( to.isNull() || to.isEmpty() )
if ( to.isNull() )
return s;
p = s.string;
@ -2891,7 +2891,10 @@ inline wchar_t* FString::extractToken ( wchar_t* rest[]
register wchar_t* token;
token = ( s ) ? const_cast<wchar_t*>(s) : *rest;
if ( ! *token )
if ( ! token )
return 0;
if ( ! token[0] )
return 0;
*rest = std::wcspbrk(token, delim);

View File

@ -7,15 +7,18 @@ AM_LDFLAGS = -L$(top_builddir)/src/.libs -lfinal $(CPPUNIT_LIBS)
AM_CPPFLAGS = -I$(top_srcdir)/include -Wall -Werror
noinst_PROGRAMS = \
fobject_test \
fstring_test \
fpoint_test \
frect_test
fobject_test_SOURCES = fobject-test.cpp
fstring_test_SOURCES = fstring-test.cpp
fpoint_test_SOURCES = fpoint-test.cpp
frect_test_SOURCES = frect-test.cpp
TESTS = fstring_test \
TESTS = fobject_test \
fstring_test \
fpoint_test \
frect_test

View File

@ -82,10 +82,11 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@CPPUNIT_TEST_TRUE@noinst_PROGRAMS = fstring_test$(EXEEXT) \
@CPPUNIT_TEST_TRUE@ fpoint_test$(EXEEXT) frect_test$(EXEEXT)
@CPPUNIT_TEST_TRUE@TESTS = fstring_test$(EXEEXT) fpoint_test$(EXEEXT) \
@CPPUNIT_TEST_TRUE@noinst_PROGRAMS = fobject_test$(EXEEXT) \
@CPPUNIT_TEST_TRUE@ fstring_test$(EXEEXT) fpoint_test$(EXEEXT) \
@CPPUNIT_TEST_TRUE@ frect_test$(EXEEXT)
@CPPUNIT_TEST_TRUE@TESTS = fobject_test$(EXEEXT) fstring_test$(EXEEXT) \
@CPPUNIT_TEST_TRUE@ fpoint_test$(EXEEXT) frect_test$(EXEEXT)
@CPPUNIT_TEST_TRUE@check_PROGRAMS = $(am__EXEEXT_1)
subdir = src/test
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
@ -102,17 +103,22 @@ mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
@CPPUNIT_TEST_TRUE@am__EXEEXT_1 = fstring_test$(EXEEXT) \
@CPPUNIT_TEST_TRUE@ fpoint_test$(EXEEXT) frect_test$(EXEEXT)
@CPPUNIT_TEST_TRUE@am__EXEEXT_1 = fobject_test$(EXEEXT) \
@CPPUNIT_TEST_TRUE@ fstring_test$(EXEEXT) fpoint_test$(EXEEXT) \
@CPPUNIT_TEST_TRUE@ frect_test$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
am__fpoint_test_SOURCES_DIST = fpoint-test.cpp
@CPPUNIT_TEST_TRUE@am_fpoint_test_OBJECTS = fpoint-test.$(OBJEXT)
fpoint_test_OBJECTS = $(am_fpoint_test_OBJECTS)
fpoint_test_LDADD = $(LDADD)
am__fobject_test_SOURCES_DIST = fobject-test.cpp
@CPPUNIT_TEST_TRUE@am_fobject_test_OBJECTS = fobject-test.$(OBJEXT)
fobject_test_OBJECTS = $(am_fobject_test_OBJECTS)
fobject_test_LDADD = $(LDADD)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
am__fpoint_test_SOURCES_DIST = fpoint-test.cpp
@CPPUNIT_TEST_TRUE@am_fpoint_test_OBJECTS = fpoint-test.$(OBJEXT)
fpoint_test_OBJECTS = $(am_fpoint_test_OBJECTS)
fpoint_test_LDADD = $(LDADD)
am__frect_test_SOURCES_DIST = frect-test.cpp
@CPPUNIT_TEST_TRUE@am_frect_test_OBJECTS = frect-test.$(OBJEXT)
frect_test_OBJECTS = $(am_frect_test_OBJECTS)
@ -155,10 +161,10 @@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
am__v_CXXLD_0 = @echo " CXXLD " $@;
am__v_CXXLD_1 =
SOURCES = $(fpoint_test_SOURCES) $(frect_test_SOURCES) \
$(fstring_test_SOURCES)
DIST_SOURCES = $(am__fpoint_test_SOURCES_DIST) \
$(am__frect_test_SOURCES_DIST) \
SOURCES = $(fobject_test_SOURCES) $(fpoint_test_SOURCES) \
$(frect_test_SOURCES) $(fstring_test_SOURCES)
DIST_SOURCES = $(am__fobject_test_SOURCES_DIST) \
$(am__fpoint_test_SOURCES_DIST) $(am__frect_test_SOURCES_DIST) \
$(am__fstring_test_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
@ -517,6 +523,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
@CPPUNIT_TEST_TRUE@AM_LDFLAGS = -L$(top_builddir)/src/.libs -lfinal $(CPPUNIT_LIBS)
@CPPUNIT_TEST_TRUE@AM_CPPFLAGS = -I$(top_srcdir)/include -Wall -Werror
@CPPUNIT_TEST_TRUE@fobject_test_SOURCES = fobject-test.cpp
@CPPUNIT_TEST_TRUE@fstring_test_SOURCES = fstring-test.cpp
@CPPUNIT_TEST_TRUE@fpoint_test_SOURCES = fpoint-test.cpp
@CPPUNIT_TEST_TRUE@frect_test_SOURCES = frect-test.cpp
@ -573,6 +580,10 @@ clean-noinstPROGRAMS:
echo " rm -f" $$list; \
rm -f $$list
fobject_test$(EXEEXT): $(fobject_test_OBJECTS) $(fobject_test_DEPENDENCIES) $(EXTRA_fobject_test_DEPENDENCIES)
@rm -f fobject_test$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(fobject_test_OBJECTS) $(fobject_test_LDADD) $(LIBS)
fpoint_test$(EXEEXT): $(fpoint_test_OBJECTS) $(fpoint_test_DEPENDENCIES) $(EXTRA_fpoint_test_DEPENDENCIES)
@rm -f fpoint_test$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(fpoint_test_OBJECTS) $(fpoint_test_LDADD) $(LIBS)
@ -591,6 +602,7 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fobject-test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fpoint-test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frect-test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstring-test.Po@am__quote@
@ -815,6 +827,13 @@ recheck: all $(check_PROGRAMS)
am__force_recheck=am--force-recheck \
TEST_LOGS="$$log_list"; \
exit $$?
fobject_test.log: fobject_test$(EXEEXT)
@p='fobject_test$(EXEEXT)'; \
b='fobject_test'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
fstring_test.log: fstring_test$(EXEEXT)
@p='fstring_test$(EXEEXT)'; \
b='fstring_test'; \

128
src/test/fobject-test.cpp Normal file
View File

@ -0,0 +1,128 @@
/***********************************************************************
* fobject-test.cpp - FPoint unit tests *
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
* as published by the Free Software Foundation; either version 3 of *
* the License, or (at your option) any later version. *
* *
* The Final Cut is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this program. If not, see *
* <http://www.gnu.org/licenses/>. *
***********************************************************************/
#include <cppunit/BriefTestProgressListener.h>
#include <cppunit/CompilerOutputter.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/TestFixture.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestRunner.h>
#include <final/final.h>
//----------------------------------------------------------------------
// class FObjectTest
//----------------------------------------------------------------------
#pragma pack(push)
#pragma pack(1)
class FObjectTest : public CPPUNIT_NS::TestFixture
{
public:
FObjectTest()
{ }
protected:
void classNameTest();
void NoArgumentTest();
void copyConstructorTest();
void assignmentTest();
private:
// Adds code needed to register the test suite
CPPUNIT_TEST_SUITE (FObjectTest);
// Add a methods to the test suite
CPPUNIT_TEST (classNameTest);
CPPUNIT_TEST (NoArgumentTest);
CPPUNIT_TEST (copyConstructorTest);
CPPUNIT_TEST (assignmentTest);
// End of test suite definition
CPPUNIT_TEST_SUITE_END();
};
#pragma pack(pop)
//----------------------------------------------------------------------
void FObjectTest::classNameTest()
{
FObject o;
const char* const classname = o.getClassName();
CPPUNIT_ASSERT ( std::strcmp(classname, "FObject") == 0 );
}
//----------------------------------------------------------------------
void FObjectTest::NoArgumentTest()
{
FObject o1;
CPPUNIT_ASSERT ( ! o1.hasParent() );
CPPUNIT_ASSERT ( o1.getParent() == 0 );
CPPUNIT_ASSERT ( ! o1.hasChildren() );
CPPUNIT_ASSERT ( o1.getChild(0) == 0 );
CPPUNIT_ASSERT ( o1.getChild(1) == 0 );
CPPUNIT_ASSERT ( o1.numOfChildren() == 0 );
const FObject::FObjectList& children_list = o1.getChildren();
CPPUNIT_ASSERT ( children_list.begin() == o1.begin() );
CPPUNIT_ASSERT ( children_list.begin() == o1.end() );
CPPUNIT_ASSERT ( children_list.end() == o1.begin() );
CPPUNIT_ASSERT ( children_list.end() == o1.end() );
CPPUNIT_ASSERT ( ! o1.isChild(&o1) );
CPPUNIT_ASSERT ( ! o1.isDirectChild(&o1) );
CPPUNIT_ASSERT ( ! o1.isWidget() );
CPPUNIT_ASSERT ( o1.isInstanceOf("FObject") );
CPPUNIT_ASSERT ( ! o1.isTimerInUpdating() );
struct test_protected : public FObject
{
bool test_event (FEvent* ev)
{
return event(ev);
}
};
test_protected t;
FEvent* ev = new FEvent(fc::None_Event);
CPPUNIT_ASSERT ( ! t.test_event(ev) );
delete ev;
}
//----------------------------------------------------------------------
void FObjectTest::copyConstructorTest()
{
}
//----------------------------------------------------------------------
void FObjectTest::assignmentTest()
{
}
// Put the test suite in the registry
CPPUNIT_TEST_SUITE_REGISTRATION (FObjectTest);
// The general unit test main part
#include <main-test.inc>

228
src/test/fobject_test Executable file
View File

@ -0,0 +1,228 @@
#! /bin/bash
# fobject_test - temporary wrapper script for .libs/fobject_test
# Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.11
#
# The fobject_test program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
fi
BIN_SH=xpg4; export BIN_SH # for Tru64
DUALCASE=1; export DUALCASE # for MKS sh
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
relink_command="(cd /usr/local/src/guru/finalcut/src/test; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=.:/home/guru/bin:/opt/trinity/bin:/sbin:/usr/sbin/:/home/guru/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games; export PATH; g++ -g -O0 -DDEBUG -o \$progdir/\$file fobject-test.o -L../../src/.libs /usr/local/src/guru/finalcut/src/.libs/libfinal.so -L/usr/lib/x86_64-linux-gnu -lcppunit -ldl -ltermcap -lgpm -Wl,-rpath -Wl,/usr/local/src/guru/finalcut/src/.libs)"
# This environment variable determines our operation mode.
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
# install mode needs the following variables:
generated_by_libtool_version='2.4.2'
notinst_deplibs=' /usr/local/src/guru/finalcut/src/.libs/libfinal.la'
else
# When we are sourced in execute mode, $file and $ECHO are already set.
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
file="$0"
# A function that is used when there is no print builtin or printf.
func_fallback_echo ()
{
eval 'cat <<_LTECHO_EOF
$1
_LTECHO_EOF'
}
ECHO="printf %s\\n"
fi
# Very basic option parsing. These options are (a) specific to
# the libtool wrapper, (b) are identical between the wrapper
# /script/ and the wrapper /executable/ which is used only on
# windows platforms, and (c) all begin with the string --lt-
# (application programs are unlikely to have options which match
# this pattern).
#
# There are only two supported options: --lt-debug and
# --lt-dump-script. There is, deliberately, no --lt-help.
#
# The first argument to this parsing function should be the
# script's ../../libtool value, followed by no.
lt_option_debug=
func_parse_lt_options ()
{
lt_script_arg0=$0
shift
for lt_opt
do
case "$lt_opt" in
--lt-debug) lt_option_debug=1 ;;
--lt-dump-script)
lt_dump_D=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%/[^/]*$%%'`
test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=.
lt_dump_F=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%^.*/%%'`
cat "$lt_dump_D/$lt_dump_F"
exit 0
;;
--lt-*)
$ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2
exit 1
;;
esac
done
# Print the debug banner immediately:
if test -n "$lt_option_debug"; then
echo "fobject_test:fobject_test:${LINENO}: libtool wrapper (GNU libtool) 2.4.2 Debian-2.4.2-1.11" 1>&2
fi
}
# Used when --lt-debug. Prints its arguments to stdout
# (redirection is the responsibility of the caller)
func_lt_dump_args ()
{
lt_dump_args_N=1;
for lt_arg
do
$ECHO "fobject_test:fobject_test:${LINENO}: newargv[$lt_dump_args_N]: $lt_arg"
lt_dump_args_N=`expr $lt_dump_args_N + 1`
done
}
# Core function for launching the target application
func_exec_program_core ()
{
if test -n "$lt_option_debug"; then
$ECHO "fobject_test:fobject_test:${LINENO}: newargv[0]: $progdir/$program" 1>&2
func_lt_dump_args ${1+"$@"} 1>&2
fi
exec "$progdir/$program" ${1+"$@"}
$ECHO "$0: cannot exec $program $*" 1>&2
exit 1
}
# A function to encapsulate launching the target application
# Strips options in the --lt-* namespace from $@ and
# launches target application with the remaining arguments.
func_exec_program ()
{
case " $* " in
*\ --lt-*)
for lt_wr_arg
do
case $lt_wr_arg in
--lt-*) ;;
*) set x "$@" "$lt_wr_arg"; shift;;
esac
shift
done ;;
esac
func_exec_program_core ${1+"$@"}
}
# Parse options
func_parse_lt_options "$0" ${1+"$@"}
# Find the directory that this script lives in.
thisdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'`
test "x$thisdir" = "x$file" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'`
while test -n "$file"; do
destdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'`
# If there was a directory component, then change thisdir.
if test "x$destdir" != "x$file"; then
case "$destdir" in
[\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
*) thisdir="$thisdir/$destdir" ;;
esac
fi
file=`$ECHO "$file" | /bin/sed 's%^.*/%%'`
file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'`
done
# Usually 'no', except on cygwin/mingw when embedded into
# the cwrapper.
WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no
if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then
# special case for '.'
if test "$thisdir" = "."; then
thisdir=`pwd`
fi
# remove .libs from thisdir
case "$thisdir" in
*[\\/].libs ) thisdir=`$ECHO "$thisdir" | /bin/sed 's%[\\/][^\\/]*$%%'` ;;
.libs ) thisdir=. ;;
esac
fi
# Try to get the absolute directory name.
absdir=`cd "$thisdir" && pwd`
test -n "$absdir" && thisdir="$absdir"
program=lt-'fobject_test'
progdir="$thisdir/.libs"
if test ! -f "$progdir/$program" ||
{ file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /bin/sed 1q`; \
test "X$file" != "X$progdir/$program"; }; then
file="$$-$program"
if test ! -d "$progdir"; then
mkdir "$progdir"
else
rm -f "$progdir/$file"
fi
# relink executable if necessary
if test -n "$relink_command"; then
if relink_command_output=`eval $relink_command 2>&1`; then :
else
printf %s\n "$relink_command_output" >&2
rm -f "$progdir/$file"
exit 1
fi
fi
mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
{ rm -f "$progdir/$program";
mv -f "$progdir/$file" "$progdir/$program"; }
rm -f "$progdir/$file"
fi
if test -f "$progdir/$program"; then
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
# Run the actual program with our arguments.
func_exec_program ${1+"$@"}
fi
else
# The program doesn't exist.
$ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2
$ECHO "This script is just a wrapper for $program." 1>&2
$ECHO "See the libtool documentation for more information." 1>&2
exit 1
fi
fi

View File

@ -277,6 +277,14 @@ void FRectTest::assignmentTest()
CPPUNIT_ASSERT ( r3.getY2() == 50 );
CPPUNIT_ASSERT ( r3.getWidth() == 31 );
CPPUNIT_ASSERT ( r3.getHeight() == 39 );
FRect r4(p1, p2);
CPPUNIT_ASSERT ( r4.getX1() == 3 );
CPPUNIT_ASSERT ( r4.getY1() == 3 );
CPPUNIT_ASSERT ( r4.getX2() == 30 );
CPPUNIT_ASSERT ( r4.getY2() == 10 );
CPPUNIT_ASSERT ( r4.getWidth() == 28 );
CPPUNIT_ASSERT ( r4.getHeight() == 8 );
}
//----------------------------------------------------------------------

View File

@ -1533,6 +1533,8 @@ void FStringTest::replaceTest()
s = "ABC";
FString empty;
CPPUNIT_ASSERT ( s.replace('B', "") == "AC" );
CPPUNIT_ASSERT ( s.replace(L'B', "") == "AC" );
CPPUNIT_ASSERT ( s.replace(from1, empty) == "ABC" );
CPPUNIT_ASSERT ( s.replace(from3, empty) == "ABC" );
CPPUNIT_ASSERT ( s.replace(from5, to5) == "ABC" );