summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/.cvsignore34
-rw-r--r--tests/Makefile.am68
-rw-r--r--tests/Makefile.in882
-rw-r--r--tests/bcppmake/Makefile.am11
-rw-r--r--tests/bcppmake/filtertest.bpf10
-rw-r--r--tests/bcppmake/filtertest.bpr116
-rw-r--r--tests/bcppmake/libsword.bpf116
-rw-r--r--tests/bcppmake/libsword.bpr196
-rw-r--r--tests/bcppmake/mgrtest.bpf10
-rw-r--r--tests/bcppmake/mgrtest.bpr116
-rw-r--r--tests/bcppmake/parsekey.bpf10
-rw-r--r--tests/bcppmake/parsekey.bpr116
-rw-r--r--tests/bcppmake/tests.bpg33
-rw-r--r--tests/casttest.cpp30
-rw-r--r--tests/ciphertest.cpp32
-rw-r--r--tests/complzss.cpp110
-rw-r--r--tests/compnone.cpp110
-rw-r--r--tests/compzip.cpp109
-rw-r--r--tests/configtest.cpp16
-rw-r--r--tests/cppunit/Makefile.am16
-rw-r--r--tests/cppunit/Makefile.in630
-rw-r--r--tests/cppunit/main.cpp25
-rw-r--r--tests/cppunit/stringmgr_test.cpp43
-rw-r--r--tests/cppunit/swbuf_test.cpp113
-rw-r--r--tests/cppunit/url_test.cpp108
-rw-r--r--tests/cppunit/versekey_test.cpp280
-rw-r--r--tests/filtertest.cpp23
-rw-r--r--tests/icutest.cpp37
-rw-r--r--tests/indextest.cpp23
-rw-r--r--tests/installmgrtest.cpp12
-rw-r--r--tests/introtest.cpp110
-rw-r--r--tests/keycast.cpp33
-rw-r--r--tests/keytest.cpp173
-rw-r--r--tests/lextest.cpp26
-rw-r--r--tests/listtest.cpp73
-rw-r--r--tests/localetest.cpp33
-rw-r--r--tests/mgrtest.cpp44
-rw-r--r--tests/modtest.cpp21
-rw-r--r--tests/outputcps.cpp59
-rw-r--r--tests/parsekey.cpp43
-rw-r--r--tests/rawldidxtest.cpp49
-rw-r--r--tests/refsystest.cpp29
-rw-r--r--tests/romantest.cpp26
-rw-r--r--tests/swaptest.cpp9
-rw-r--r--tests/swbuftest.cpp159
-rw-r--r--tests/testblocks.cpp89
-rw-r--r--tests/testsuite/.cvsignore1
-rw-r--r--tests/testsuite/Makefile.am6
-rwxr-xr-xtests/testsuite/runall.sh21
-rwxr-xr-xtests/testsuite/runtest.sh25
-rw-r--r--tests/testsuite/versekey.good5
-rwxr-xr-xtests/testsuite/versekey.sh3
-rw-r--r--tests/testsuite/verseparsing-utf8.good16
-rwxr-xr-xtests/testsuite/verseparsing-utf8.sh12
-rw-r--r--tests/testsuite/verseparsing.good65
-rwxr-xr-xtests/testsuite/verseparsing.sh64
-rw-r--r--tests/testsuite/xmltag.good136
-rwxr-xr-xtests/testsuite/xmltag.sh12
-rw-r--r--tests/tlitmgrtest.cpp715
-rw-r--r--tests/tmp/.cvsignore2
-rw-r--r--tests/tmp/Makefile.am3
-rw-r--r--tests/tmp/README2
-rw-r--r--tests/translittest.cpp142
-rw-r--r--tests/versekeytest.cpp58
-rw-r--r--tests/webiftest.cpp56
-rw-r--r--tests/xmltest.cpp52
66 files changed, 5807 insertions, 0 deletions
diff --git a/tests/.cvsignore b/tests/.cvsignore
new file mode 100644
index 0000000..c524087
--- /dev/null
+++ b/tests/.cvsignore
@@ -0,0 +1,34 @@
+.deps
+.libs
+Makefile
+Makefile.in
+casttest
+complzss
+compnone
+compzip
+configtest
+filtertest
+genbooktest
+indextest
+introtest
+keycast
+keytest
+lextest
+listtest
+localetest
+mgrtest
+modtest
+parsekey
+rawldidxtest
+romantest
+swaptest
+swbuftest
+testblocks
+treeidxtest
+webiftest
+xmltest
+nt
+nt.vss
+ot
+ot.vss
+test1.conf \ No newline at end of file
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..d5851ba
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,68 @@
+AUTOMAKE_OPTIONS = 1.6
+INCLUDES = -I $(top_srcdir)/include
+LDADD = $(top_builddir)/lib/libsword.la
+
+SUBDIRS = cppunit
+
+noinst_PROGRAMS = ciphertest keytest mgrtest parsekey versekeytest listtest casttest \
+modtest compnone complzss localetest introtest indextest configtest keycast \
+romantest testblocks filtertest rawldidxtest lextest swaptest \
+ swbuftest xmltest webiftest
+
+if ICU
+ICUPROG = icutest translittest tlitmgrtest
+else
+ICUPROG =
+endif
+
+noinst_PROGRAMS += $(ICUPROG)
+
+if ICU
+icutest_SOURCES = icutest.cpp
+translittest_SOURCES = translittest.cpp
+tlitmgrtest_SOURCES = tlitmgrtest.cpp
+#tlitmgrtest_LDADD = -lustdio
+endif
+
+if ZLIB
+ZLIBPROG = compzip
+else
+ZLIBPROG =
+endif
+
+noinst_PROGRAMS += $(ZLIBPROG)
+
+if ZLIB
+compzip_SOURCES = compzip.cpp
+endif
+
+keytest_SOURCES = keytest.cpp
+mgrtest_SOURCES = mgrtest.cpp
+ciphertest_SOURCES = ciphertest.cpp
+parsekey_SOURCES = parsekey.cpp
+versekeytest_SOURCES = versekeytest.cpp
+listtest_SOURCES = listtest.cpp
+casttest_SOURCES = casttest.cpp
+modtest_SOURCES = modtest.cpp
+compnone_SOURCES = compnone.cpp
+complzss_SOURCES = complzss.cpp
+localetest_SOURCES = localetest.cpp
+keycast_SOURCES = keycast.cpp
+introtest_SOURCES = introtest.cpp
+indextest_SOURCES = indextest.cpp
+configtest_SOURCES = configtest.cpp
+romantest_SOURCES = romantest.cpp
+testblocks_SOURCES = testblocks.cpp
+filtertest_SOURCES = filtertest.cpp
+lextest_SOURCES = lextest.cpp
+rawldidxtest_SOURCES = rawldidxtest.cpp
+swaptest_SOURCES = swaptest.cpp
+swbuftest_SOURCES = swbuftest.cpp
+webiftest_SOURCES = webiftest.cpp
+xmltest_SOURCES = xmltest.cpp
+
+
+EXTRA_DIST =
+include bcppmake/Makefile.am
+include testsuite/Makefile.am
+include tmp/Makefile.am
diff --git a/tests/Makefile.in b/tests/Makefile.in
new file mode 100644
index 0000000..7e3a1c3
--- /dev/null
+++ b/tests/Makefile.in
@@ -0,0 +1,882 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+noinst_PROGRAMS = ciphertest$(EXEEXT) keytest$(EXEEXT) \
+ mgrtest$(EXEEXT) parsekey$(EXEEXT) versekeytest$(EXEEXT) \
+ listtest$(EXEEXT) casttest$(EXEEXT) modtest$(EXEEXT) \
+ compnone$(EXEEXT) complzss$(EXEEXT) localetest$(EXEEXT) \
+ introtest$(EXEEXT) indextest$(EXEEXT) configtest$(EXEEXT) \
+ keycast$(EXEEXT) romantest$(EXEEXT) testblocks$(EXEEXT) \
+ filtertest$(EXEEXT) rawldidxtest$(EXEEXT) lextest$(EXEEXT) \
+ swaptest$(EXEEXT) swbuftest$(EXEEXT) xmltest$(EXEEXT) \
+ webiftest$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2)
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/bcppmake/Makefile.am $(srcdir)/testsuite/Makefile.am \
+ $(srcdir)/tmp/Makefile.am
+subdir = tests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/acx_clucene.m4 \
+ $(top_srcdir)/m4/cppunit.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+@ICU_TRUE@am__EXEEXT_1 = icutest$(EXEEXT) translittest$(EXEEXT) \
+@ICU_TRUE@ tlitmgrtest$(EXEEXT)
+@ZLIB_TRUE@am__EXEEXT_2 = compzip$(EXEEXT)
+PROGRAMS = $(noinst_PROGRAMS)
+am_casttest_OBJECTS = casttest.$(OBJEXT)
+casttest_OBJECTS = $(am_casttest_OBJECTS)
+casttest_LDADD = $(LDADD)
+casttest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_ciphertest_OBJECTS = ciphertest.$(OBJEXT)
+ciphertest_OBJECTS = $(am_ciphertest_OBJECTS)
+ciphertest_LDADD = $(LDADD)
+ciphertest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_complzss_OBJECTS = complzss.$(OBJEXT)
+complzss_OBJECTS = $(am_complzss_OBJECTS)
+complzss_LDADD = $(LDADD)
+complzss_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_compnone_OBJECTS = compnone.$(OBJEXT)
+compnone_OBJECTS = $(am_compnone_OBJECTS)
+compnone_LDADD = $(LDADD)
+compnone_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am__compzip_SOURCES_DIST = compzip.cpp
+@ZLIB_TRUE@am_compzip_OBJECTS = compzip.$(OBJEXT)
+compzip_OBJECTS = $(am_compzip_OBJECTS)
+compzip_LDADD = $(LDADD)
+compzip_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_configtest_OBJECTS = configtest.$(OBJEXT)
+configtest_OBJECTS = $(am_configtest_OBJECTS)
+configtest_LDADD = $(LDADD)
+configtest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_filtertest_OBJECTS = filtertest.$(OBJEXT)
+filtertest_OBJECTS = $(am_filtertest_OBJECTS)
+filtertest_LDADD = $(LDADD)
+filtertest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am__icutest_SOURCES_DIST = icutest.cpp
+@ICU_TRUE@am_icutest_OBJECTS = icutest.$(OBJEXT)
+icutest_OBJECTS = $(am_icutest_OBJECTS)
+icutest_LDADD = $(LDADD)
+icutest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_indextest_OBJECTS = indextest.$(OBJEXT)
+indextest_OBJECTS = $(am_indextest_OBJECTS)
+indextest_LDADD = $(LDADD)
+indextest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_introtest_OBJECTS = introtest.$(OBJEXT)
+introtest_OBJECTS = $(am_introtest_OBJECTS)
+introtest_LDADD = $(LDADD)
+introtest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_keycast_OBJECTS = keycast.$(OBJEXT)
+keycast_OBJECTS = $(am_keycast_OBJECTS)
+keycast_LDADD = $(LDADD)
+keycast_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_keytest_OBJECTS = keytest.$(OBJEXT)
+keytest_OBJECTS = $(am_keytest_OBJECTS)
+keytest_LDADD = $(LDADD)
+keytest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_lextest_OBJECTS = lextest.$(OBJEXT)
+lextest_OBJECTS = $(am_lextest_OBJECTS)
+lextest_LDADD = $(LDADD)
+lextest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_listtest_OBJECTS = listtest.$(OBJEXT)
+listtest_OBJECTS = $(am_listtest_OBJECTS)
+listtest_LDADD = $(LDADD)
+listtest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_localetest_OBJECTS = localetest.$(OBJEXT)
+localetest_OBJECTS = $(am_localetest_OBJECTS)
+localetest_LDADD = $(LDADD)
+localetest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_mgrtest_OBJECTS = mgrtest.$(OBJEXT)
+mgrtest_OBJECTS = $(am_mgrtest_OBJECTS)
+mgrtest_LDADD = $(LDADD)
+mgrtest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_modtest_OBJECTS = modtest.$(OBJEXT)
+modtest_OBJECTS = $(am_modtest_OBJECTS)
+modtest_LDADD = $(LDADD)
+modtest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_parsekey_OBJECTS = parsekey.$(OBJEXT)
+parsekey_OBJECTS = $(am_parsekey_OBJECTS)
+parsekey_LDADD = $(LDADD)
+parsekey_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_rawldidxtest_OBJECTS = rawldidxtest.$(OBJEXT)
+rawldidxtest_OBJECTS = $(am_rawldidxtest_OBJECTS)
+rawldidxtest_LDADD = $(LDADD)
+rawldidxtest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_romantest_OBJECTS = romantest.$(OBJEXT)
+romantest_OBJECTS = $(am_romantest_OBJECTS)
+romantest_LDADD = $(LDADD)
+romantest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_swaptest_OBJECTS = swaptest.$(OBJEXT)
+swaptest_OBJECTS = $(am_swaptest_OBJECTS)
+swaptest_LDADD = $(LDADD)
+swaptest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_swbuftest_OBJECTS = swbuftest.$(OBJEXT)
+swbuftest_OBJECTS = $(am_swbuftest_OBJECTS)
+swbuftest_LDADD = $(LDADD)
+swbuftest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_testblocks_OBJECTS = testblocks.$(OBJEXT)
+testblocks_OBJECTS = $(am_testblocks_OBJECTS)
+testblocks_LDADD = $(LDADD)
+testblocks_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am__tlitmgrtest_SOURCES_DIST = tlitmgrtest.cpp
+@ICU_TRUE@am_tlitmgrtest_OBJECTS = tlitmgrtest.$(OBJEXT)
+tlitmgrtest_OBJECTS = $(am_tlitmgrtest_OBJECTS)
+tlitmgrtest_LDADD = $(LDADD)
+tlitmgrtest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am__translittest_SOURCES_DIST = translittest.cpp
+@ICU_TRUE@am_translittest_OBJECTS = translittest.$(OBJEXT)
+translittest_OBJECTS = $(am_translittest_OBJECTS)
+translittest_LDADD = $(LDADD)
+translittest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_versekeytest_OBJECTS = versekeytest.$(OBJEXT)
+versekeytest_OBJECTS = $(am_versekeytest_OBJECTS)
+versekeytest_LDADD = $(LDADD)
+versekeytest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_webiftest_OBJECTS = webiftest.$(OBJEXT)
+webiftest_OBJECTS = $(am_webiftest_OBJECTS)
+webiftest_LDADD = $(LDADD)
+webiftest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+am_xmltest_OBJECTS = xmltest.$(OBJEXT)
+xmltest_OBJECTS = $(am_xmltest_OBJECTS)
+xmltest_LDADD = $(LDADD)
+xmltest_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/include@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(casttest_SOURCES) $(ciphertest_SOURCES) \
+ $(complzss_SOURCES) $(compnone_SOURCES) $(compzip_SOURCES) \
+ $(configtest_SOURCES) $(filtertest_SOURCES) $(icutest_SOURCES) \
+ $(indextest_SOURCES) $(introtest_SOURCES) $(keycast_SOURCES) \
+ $(keytest_SOURCES) $(lextest_SOURCES) $(listtest_SOURCES) \
+ $(localetest_SOURCES) $(mgrtest_SOURCES) $(modtest_SOURCES) \
+ $(parsekey_SOURCES) $(rawldidxtest_SOURCES) \
+ $(romantest_SOURCES) $(swaptest_SOURCES) $(swbuftest_SOURCES) \
+ $(testblocks_SOURCES) $(tlitmgrtest_SOURCES) \
+ $(translittest_SOURCES) $(versekeytest_SOURCES) \
+ $(webiftest_SOURCES) $(xmltest_SOURCES)
+DIST_SOURCES = $(casttest_SOURCES) $(ciphertest_SOURCES) \
+ $(complzss_SOURCES) $(compnone_SOURCES) \
+ $(am__compzip_SOURCES_DIST) $(configtest_SOURCES) \
+ $(filtertest_SOURCES) $(am__icutest_SOURCES_DIST) \
+ $(indextest_SOURCES) $(introtest_SOURCES) $(keycast_SOURCES) \
+ $(keytest_SOURCES) $(lextest_SOURCES) $(listtest_SOURCES) \
+ $(localetest_SOURCES) $(mgrtest_SOURCES) $(modtest_SOURCES) \
+ $(parsekey_SOURCES) $(rawldidxtest_SOURCES) \
+ $(romantest_SOURCES) $(swaptest_SOURCES) $(swbuftest_SOURCES) \
+ $(testblocks_SOURCES) $(am__tlitmgrtest_SOURCES_DIST) \
+ $(am__translittest_SOURCES_DIST) $(versekeytest_SOURCES) \
+ $(webiftest_SOURCES) $(xmltest_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_CXXFLAGS = @AM_CXXFLAGS@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CLUCENE_CXXFLAGS = @CLUCENE_CXXFLAGS@
+CLUCENE_LIBS = @CLUCENE_LIBS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CURL_AM_CFLAGS = @CURL_AM_CFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
+CURL_LIBS = @CURL_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GENCCODE = @GENCCODE@
+GENCMN = @GENCMN@
+GENRB = @GENRB@
+GREP = @GREP@
+ICU_CONFIG = @ICU_CONFIG@
+ICU_IOLIBS = @ICU_IOLIBS@
+ICU_LIBS = @ICU_LIBS@
+ICU_VER = @ICU_VER@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKGDATA = @PKGDATA@
+PKG_CONFIG = @PKG_CONFIG@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XML_LIBS = @XML_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+dir_confdef = @dir_confdef@
+docdir = @docdir@
+dvidir = @dvidir@
+enable_debug = @enable_debug@
+enable_profile = @enable_profile@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_mingw32 = @target_mingw32@
+target_os = @target_os@
+target_system = @target_system@
+target_vendor = @target_vendor@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+with_conf = @with_conf@
+with_icu = @with_icu@
+with_zlib = @with_zlib@
+AUTOMAKE_OPTIONS = 1.6
+INCLUDES = -I $(top_srcdir)/include
+LDADD = $(top_builddir)/lib/libsword.la
+SUBDIRS = cppunit
+@ICU_FALSE@ICUPROG =
+@ICU_TRUE@ICUPROG = icutest translittest tlitmgrtest
+@ICU_TRUE@icutest_SOURCES = icutest.cpp
+@ICU_TRUE@translittest_SOURCES = translittest.cpp
+@ICU_TRUE@tlitmgrtest_SOURCES = tlitmgrtest.cpp
+@ZLIB_FALSE@ZLIBPROG =
+#tlitmgrtest_LDADD = -lustdio
+@ZLIB_TRUE@ZLIBPROG = compzip
+@ZLIB_TRUE@compzip_SOURCES = compzip.cpp
+keytest_SOURCES = keytest.cpp
+mgrtest_SOURCES = mgrtest.cpp
+ciphertest_SOURCES = ciphertest.cpp
+parsekey_SOURCES = parsekey.cpp
+versekeytest_SOURCES = versekeytest.cpp
+listtest_SOURCES = listtest.cpp
+casttest_SOURCES = casttest.cpp
+modtest_SOURCES = modtest.cpp
+compnone_SOURCES = compnone.cpp
+complzss_SOURCES = complzss.cpp
+localetest_SOURCES = localetest.cpp
+keycast_SOURCES = keycast.cpp
+introtest_SOURCES = introtest.cpp
+indextest_SOURCES = indextest.cpp
+configtest_SOURCES = configtest.cpp
+romantest_SOURCES = romantest.cpp
+testblocks_SOURCES = testblocks.cpp
+filtertest_SOURCES = filtertest.cpp
+lextest_SOURCES = lextest.cpp
+rawldidxtest_SOURCES = rawldidxtest.cpp
+swaptest_SOURCES = swaptest.cpp
+swbuftest_SOURCES = swbuftest.cpp
+webiftest_SOURCES = webiftest.cpp
+xmltest_SOURCES = xmltest.cpp
+EXTRA_DIST = $(swbcppdir)/filtertest.bpf $(swbcppdir)/filtertest.bpr \
+ $(swbcppdir)/libsword.bpf $(swbcppdir)/libsword.bpr \
+ $(swbcppdir)/mgrtest.bpf $(swbcppdir)/mgrtest.bpr \
+ $(swbcppdir)/parsekey.bpf $(swbcppdir)/parsekey.bpr \
+ $(swbcppdir)/tests.bpg $(swtspdir)/runall.sh \
+ $(swtspdir)/runtest.sh $(swtspdir)/verseparsing.good \
+ $(swtspdir)/verseparsing.sh $(swtesttmpdir)/README
+swbcppdir = $(top_srcdir)/tests/bcppmake
+swtspdir = $(top_srcdir)/tests/testsuite
+swtesttmpdir = $(top_srcdir)/tests/tmp
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/bcppmake/Makefile.am $(srcdir)/testsuite/Makefile.am $(srcdir)/tmp/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+casttest$(EXEEXT): $(casttest_OBJECTS) $(casttest_DEPENDENCIES)
+ @rm -f casttest$(EXEEXT)
+ $(CXXLINK) $(casttest_OBJECTS) $(casttest_LDADD) $(LIBS)
+ciphertest$(EXEEXT): $(ciphertest_OBJECTS) $(ciphertest_DEPENDENCIES)
+ @rm -f ciphertest$(EXEEXT)
+ $(CXXLINK) $(ciphertest_OBJECTS) $(ciphertest_LDADD) $(LIBS)
+complzss$(EXEEXT): $(complzss_OBJECTS) $(complzss_DEPENDENCIES)
+ @rm -f complzss$(EXEEXT)
+ $(CXXLINK) $(complzss_OBJECTS) $(complzss_LDADD) $(LIBS)
+compnone$(EXEEXT): $(compnone_OBJECTS) $(compnone_DEPENDENCIES)
+ @rm -f compnone$(EXEEXT)
+ $(CXXLINK) $(compnone_OBJECTS) $(compnone_LDADD) $(LIBS)
+compzip$(EXEEXT): $(compzip_OBJECTS) $(compzip_DEPENDENCIES)
+ @rm -f compzip$(EXEEXT)
+ $(CXXLINK) $(compzip_OBJECTS) $(compzip_LDADD) $(LIBS)
+configtest$(EXEEXT): $(configtest_OBJECTS) $(configtest_DEPENDENCIES)
+ @rm -f configtest$(EXEEXT)
+ $(CXXLINK) $(configtest_OBJECTS) $(configtest_LDADD) $(LIBS)
+filtertest$(EXEEXT): $(filtertest_OBJECTS) $(filtertest_DEPENDENCIES)
+ @rm -f filtertest$(EXEEXT)
+ $(CXXLINK) $(filtertest_OBJECTS) $(filtertest_LDADD) $(LIBS)
+icutest$(EXEEXT): $(icutest_OBJECTS) $(icutest_DEPENDENCIES)
+ @rm -f icutest$(EXEEXT)
+ $(CXXLINK) $(icutest_OBJECTS) $(icutest_LDADD) $(LIBS)
+indextest$(EXEEXT): $(indextest_OBJECTS) $(indextest_DEPENDENCIES)
+ @rm -f indextest$(EXEEXT)
+ $(CXXLINK) $(indextest_OBJECTS) $(indextest_LDADD) $(LIBS)
+introtest$(EXEEXT): $(introtest_OBJECTS) $(introtest_DEPENDENCIES)
+ @rm -f introtest$(EXEEXT)
+ $(CXXLINK) $(introtest_OBJECTS) $(introtest_LDADD) $(LIBS)
+keycast$(EXEEXT): $(keycast_OBJECTS) $(keycast_DEPENDENCIES)
+ @rm -f keycast$(EXEEXT)
+ $(CXXLINK) $(keycast_OBJECTS) $(keycast_LDADD) $(LIBS)
+keytest$(EXEEXT): $(keytest_OBJECTS) $(keytest_DEPENDENCIES)
+ @rm -f keytest$(EXEEXT)
+ $(CXXLINK) $(keytest_OBJECTS) $(keytest_LDADD) $(LIBS)
+lextest$(EXEEXT): $(lextest_OBJECTS) $(lextest_DEPENDENCIES)
+ @rm -f lextest$(EXEEXT)
+ $(CXXLINK) $(lextest_OBJECTS) $(lextest_LDADD) $(LIBS)
+listtest$(EXEEXT): $(listtest_OBJECTS) $(listtest_DEPENDENCIES)
+ @rm -f listtest$(EXEEXT)
+ $(CXXLINK) $(listtest_OBJECTS) $(listtest_LDADD) $(LIBS)
+localetest$(EXEEXT): $(localetest_OBJECTS) $(localetest_DEPENDENCIES)
+ @rm -f localetest$(EXEEXT)
+ $(CXXLINK) $(localetest_OBJECTS) $(localetest_LDADD) $(LIBS)
+mgrtest$(EXEEXT): $(mgrtest_OBJECTS) $(mgrtest_DEPENDENCIES)
+ @rm -f mgrtest$(EXEEXT)
+ $(CXXLINK) $(mgrtest_OBJECTS) $(mgrtest_LDADD) $(LIBS)
+modtest$(EXEEXT): $(modtest_OBJECTS) $(modtest_DEPENDENCIES)
+ @rm -f modtest$(EXEEXT)
+ $(CXXLINK) $(modtest_OBJECTS) $(modtest_LDADD) $(LIBS)
+parsekey$(EXEEXT): $(parsekey_OBJECTS) $(parsekey_DEPENDENCIES)
+ @rm -f parsekey$(EXEEXT)
+ $(CXXLINK) $(parsekey_OBJECTS) $(parsekey_LDADD) $(LIBS)
+rawldidxtest$(EXEEXT): $(rawldidxtest_OBJECTS) $(rawldidxtest_DEPENDENCIES)
+ @rm -f rawldidxtest$(EXEEXT)
+ $(CXXLINK) $(rawldidxtest_OBJECTS) $(rawldidxtest_LDADD) $(LIBS)
+romantest$(EXEEXT): $(romantest_OBJECTS) $(romantest_DEPENDENCIES)
+ @rm -f romantest$(EXEEXT)
+ $(CXXLINK) $(romantest_OBJECTS) $(romantest_LDADD) $(LIBS)
+swaptest$(EXEEXT): $(swaptest_OBJECTS) $(swaptest_DEPENDENCIES)
+ @rm -f swaptest$(EXEEXT)
+ $(CXXLINK) $(swaptest_OBJECTS) $(swaptest_LDADD) $(LIBS)
+swbuftest$(EXEEXT): $(swbuftest_OBJECTS) $(swbuftest_DEPENDENCIES)
+ @rm -f swbuftest$(EXEEXT)
+ $(CXXLINK) $(swbuftest_OBJECTS) $(swbuftest_LDADD) $(LIBS)
+testblocks$(EXEEXT): $(testblocks_OBJECTS) $(testblocks_DEPENDENCIES)
+ @rm -f testblocks$(EXEEXT)
+ $(CXXLINK) $(testblocks_OBJECTS) $(testblocks_LDADD) $(LIBS)
+tlitmgrtest$(EXEEXT): $(tlitmgrtest_OBJECTS) $(tlitmgrtest_DEPENDENCIES)
+ @rm -f tlitmgrtest$(EXEEXT)
+ $(CXXLINK) $(tlitmgrtest_OBJECTS) $(tlitmgrtest_LDADD) $(LIBS)
+translittest$(EXEEXT): $(translittest_OBJECTS) $(translittest_DEPENDENCIES)
+ @rm -f translittest$(EXEEXT)
+ $(CXXLINK) $(translittest_OBJECTS) $(translittest_LDADD) $(LIBS)
+versekeytest$(EXEEXT): $(versekeytest_OBJECTS) $(versekeytest_DEPENDENCIES)
+ @rm -f versekeytest$(EXEEXT)
+ $(CXXLINK) $(versekeytest_OBJECTS) $(versekeytest_LDADD) $(LIBS)
+webiftest$(EXEEXT): $(webiftest_OBJECTS) $(webiftest_DEPENDENCIES)
+ @rm -f webiftest$(EXEEXT)
+ $(CXXLINK) $(webiftest_OBJECTS) $(webiftest_LDADD) $(LIBS)
+xmltest$(EXEEXT): $(xmltest_OBJECTS) $(xmltest_DEPENDENCIES)
+ @rm -f xmltest$(EXEEXT)
+ $(CXXLINK) $(xmltest_OBJECTS) $(xmltest_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/casttest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ciphertest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/complzss.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compnone.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compzip.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/configtest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filtertest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icutest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indextest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/introtest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keycast.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keytest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lextest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listtest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localetest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mgrtest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modtest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsekey.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rawldidxtest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/romantest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swaptest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swbuftest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testblocks.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tlitmgrtest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/translittest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/versekeytest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/webiftest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmltest.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(PROGRAMS)
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ clean-noinstPROGRAMS ctags ctags-recursive distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/bcppmake/Makefile.am b/tests/bcppmake/Makefile.am
new file mode 100644
index 0000000..6a959e5
--- /dev/null
+++ b/tests/bcppmake/Makefile.am
@@ -0,0 +1,11 @@
+swbcppdir = $(top_srcdir)/tests/bcppmake
+
+EXTRA_DIST += $(swbcppdir)/filtertest.bpf
+EXTRA_DIST += $(swbcppdir)/filtertest.bpr
+EXTRA_DIST += $(swbcppdir)/libsword.bpf
+EXTRA_DIST += $(swbcppdir)/libsword.bpr
+EXTRA_DIST += $(swbcppdir)/mgrtest.bpf
+EXTRA_DIST += $(swbcppdir)/mgrtest.bpr
+EXTRA_DIST += $(swbcppdir)/parsekey.bpf
+EXTRA_DIST += $(swbcppdir)/parsekey.bpr
+EXTRA_DIST += $(swbcppdir)/tests.bpg
diff --git a/tests/bcppmake/filtertest.bpf b/tests/bcppmake/filtertest.bpf
new file mode 100644
index 0000000..5bef665
--- /dev/null
+++ b/tests/bcppmake/filtertest.bpf
@@ -0,0 +1,10 @@
+USEUNIT("..\filtertest.cpp");
+USELIB("..\..\lib\libsword.lib");
+USELIB("..\..\..\icu-sword\as_is\borland\icuuc.lib");
+USELIB("..\..\..\icu-sword\as_is\borland\icuin.lib");
+USELIB("..\..\..\icu-sword\as_is\borland\icudatab.lib");
+//---------------------------------------------------------------------------
+This file is used by the project manager only and should be treated like the project file
+
+
+main \ No newline at end of file
diff --git a/tests/bcppmake/filtertest.bpr b/tests/bcppmake/filtertest.bpr
new file mode 100644
index 0000000..5778bc4
--- /dev/null
+++ b/tests/bcppmake/filtertest.bpr
@@ -0,0 +1,116 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!-- C++Builder XML Project -->
+<PROJECT>
+ <MACROS>
+ <VERSION value="BCB.05.03"/>
+ <PROJECT value="filtertest.exe"/>
+ <OBJFILES value="..\filtertest.obj"/>
+ <RESFILES value=""/>
+ <DEFFILE value=""/>
+ <RESDEPEN value="$(RESFILES)"/>
+ <LIBFILES value="..\..\lib\libsword.lib ..\..\..\icu-sword\as_is\borland\icuuc.lib
+ ..\..\..\icu-sword\as_is\borland\icuin.lib
+ ..\..\..\icu-sword\as_is\borland\icudatab.lib"/>
+ <LIBRARIES value=""/>
+ <SPARELIBS value=""/>
+ <PACKAGES value="VCL50.bpi VCLX50.bpi bcbsmp50.bpi QRPT50.bpi VCLDB50.bpi VCLBDE50.bpi
+ ibsmp50.bpi VCLDBX50.bpi TEEUI50.bpi TEEDB50.bpi TEE50.bpi TEEQR50.bpi
+ VCLIB50.bpi bcbie50.bpi VCLIE50.bpi INETDB50.bpi INET50.bpi NMFAST50.bpi
+ dclocx50.bpi bcb2kaxserver50.bpi"/>
+ <PATHCPP value=".;.."/>
+ <PATHPAS value=".;"/>
+ <PATHRC value=".;"/>
+ <PATHASM value=".;"/>
+ <DEBUGLIBPATH value="$(BCB)\lib\debug"/>
+ <RELEASELIBPATH value="$(BCB)\lib\release"/>
+ <LINKER value="tlink32"/>
+ <USERDEFINES value="_DEBUG"/>
+ <SYSDEFINES value="NO_STRICT;_NO_VCL"/>
+ <MAINSOURCE value="filtertest.bpf"/>
+ <INCLUDEPATH value="..\;..;..\..\include;$(BCB)\include;$(BCB)\include\vcl"/>
+ <LIBPATH value="..\;..;$(BCB)\lib\obj;$(BCB)\lib"/>
+ <WARNINGS value="-w-par"/>
+ </MACROS>
+ <OPTIONS>
+ <CFLAG1 value="-Od -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -r- -a8 -b- -k -y -v -vi- -tWC
+ -tWM -c"/>
+ <PFLAGS value="-$Y+ -$W -$O- -v -JPHNE -M"/>
+ <RFLAGS value=""/>
+ <AFLAGS value="/mx /w2 /zi"/>
+ <LFLAGS value="-D&quot;&quot; -S:0x300000 -Sc:0x20000 -ap -Tpe -x -Gn -v"/>
+ </OPTIONS>
+ <LINKER>
+ <ALLOBJ value="c0x32.obj $(OBJFILES)"/>
+ <ALLRES value="$(RESFILES)"/>
+ <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cw32mt.lib"/>
+ </LINKER>
+ <IDEOPTIONS>
+[Version Info]
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1033
+CodePage=1252
+
+[Version Info Keys]
+CompanyName=
+FileDescription=
+FileVersion=1.0.0.0
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=1.0.0.0
+Comments=
+
+[HistoryLists\hlIncludePath]
+Count=4
+Item0=..\;..;..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item1=..\;..\..\utilities;..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item2=..;..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item3=..\..\utilities;$(BCB)\include;$(BCB)\include\vcl
+
+[HistoryLists\hlLibraryPath]
+Count=3
+Item0=..\;..;$(BCB)\lib\obj;$(BCB)\lib
+Item1=..\;..\..\utilities;$(BCB)\lib\obj;$(BCB)\lib
+Item2=..\..\utilities;$(BCB)\lib\obj;$(BCB)\lib
+
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=$(BCB)\source\vcl
+
+[HistoryLists\hlConditionals]
+Count=1
+Item0=_DEBUG
+
+[Debugging]
+DebugSourceDirs=$(BCB)\source\vcl
+
+[Parameters]
+RunParams=
+HostApplication=
+RemoteHost=
+RemotePath=
+RemoteDebug=0
+
+[Compiler]
+ShowInfoMsgs=0
+LinkDebugVcl=0
+LinkCGLIB=0
+
+[Language]
+ActiveLang=
+ProjectLang=
+RootDir=
+ </IDEOPTIONS>
+</PROJECT> \ No newline at end of file
diff --git a/tests/bcppmake/libsword.bpf b/tests/bcppmake/libsword.bpf
new file mode 100644
index 0000000..9daa167
--- /dev/null
+++ b/tests/bcppmake/libsword.bpf
@@ -0,0 +1,116 @@
+//---------------------------------------------------------------------------
+
+#include <vcl.h>
+#pragma hdrstop
+USEUNIT("..\..\src\keys\versekey.cpp");
+USEUNIT("..\..\src\keys\strkey.cpp");
+USEUNIT("..\..\src\keys\swkey.cpp");
+USEUNIT("..\..\src\keys\listkey.cpp");
+USEUNIT("..\..\src\mgr\swmgr.cpp");
+USEUNIT("..\..\src\mgr\localemgr.cpp");
+USEUNIT("..\..\src\mgr\swconfig.cpp");
+USEUNIT("..\..\src\mgr\swlocale.cpp");
+USEUNIT("..\..\src\mgr\filemgr.cpp");
+USEUNIT("..\..\src\utilfuns\utilstr.cpp");
+USEUNIT("..\..\src\utilfuns\utilconf.cpp");
+USEUNIT("..\..\src\utilfuns\Greek2Greek.cpp");
+USEUNIT("..\..\src\frontend\swlog.cpp");
+USEUNIT("..\..\src\frontend\swdisp.cpp");
+USEUNIT("..\..\src\modules\swmodule.cpp");
+USEUNIT("..\..\src\modules\comments\swcom.cpp");
+USEUNIT("..\..\src\modules\comments\hrefcom\hrefcom.cpp");
+USEUNIT("..\..\src\modules\comments\rawcom\rawcom.cpp");
+USEUNIT("..\..\src\modules\comments\rawfiles\rawfiles.cpp");
+USEUNIT("..\..\src\modules\common\lzsscomprs.cpp");
+USEUNIT("..\..\src\modules\common\rawstr.cpp");
+USEUNIT("..\..\src\modules\common\rawverse.cpp");
+USEUNIT("..\..\src\modules\common\sapphire.cpp");
+USEUNIT("..\..\src\modules\common\swcipher.cpp");
+USEUNIT("..\..\src\modules\common\swcomprs.cpp");
+USEUNIT("..\..\src\modules\filters\thmlrtf.cpp");
+USEUNIT("..\..\src\modules\filters\gbffootnotes.cpp");
+USEUNIT("..\..\src\modules\filters\gbfhtml.cpp");
+USEUNIT("..\..\src\modules\filters\gbfplain.cpp");
+USEUNIT("..\..\src\modules\filters\gbfrtf.cpp");
+USEUNIT("..\..\src\modules\filters\gbfstrongs.cpp");
+USEUNIT("..\..\src\modules\filters\gbfthml.cpp");
+USEUNIT("..\..\src\modules\filters\plainfootnotes.cpp");
+USEUNIT("..\..\src\modules\filters\plainhtml.cpp");
+USEUNIT("..\..\src\modules\filters\rtfhtml.cpp");
+USEUNIT("..\..\src\modules\filters\rwphtml.cpp");
+USEUNIT("..\..\src\modules\filters\rwprtf.cpp");
+USEUNIT("..\..\src\modules\filters\thmlgbf.cpp");
+USEUNIT("..\..\src\modules\filters\thmlhtml.cpp");
+USEUNIT("..\..\src\modules\filters\thmlplain.cpp");
+USEUNIT("..\..\src\modules\filters\cipherfil.cpp");
+USEUNIT("..\..\src\modules\lexdict\swld.cpp");
+USEUNIT("..\..\src\modules\lexdict\rawld\rawld.cpp");
+USEUNIT("..\..\src\modules\texts\swtext.cpp");
+USEUNIT("..\..\src\modules\texts\rawtext\rawtext.cpp");
+USEUNIT("..\..\src\modules\texts\ztext\ztext.cpp");
+USEUNIT("..\..\src\modules\common\zverse.cpp");
+USEUNIT("..\..\src\keys\treekey.cpp");
+USEUNIT("..\..\src\keys\treekeyidx.cpp");
+USEUNIT("..\..\src\modules\common\rawstr4.cpp");
+USEUNIT("..\..\src\modules\common\zstr.cpp");
+USEUNIT("..\..\src\modules\genbook\swgenbook.cpp");
+USEUNIT("..\..\src\modules\genbook\rawgenbook\rawgenbook.cpp");
+USEUNIT("..\..\src\mgr\swfiltermgr.cpp");
+USEUNIT("..\..\src\modules\filters\utf8utf16.cpp");
+USEUNIT("..\..\src\modules\filters\gbfheadings.cpp");
+USEUNIT("..\..\src\modules\filters\gbfhtmlhref.cpp");
+USEUNIT("..\..\src\modules\filters\gbfmorph.cpp");
+USEUNIT("..\..\src\modules\filters\latin1utf16.cpp");
+USEUNIT("..\..\src\modules\filters\latin1utf8.cpp");
+USEUNIT("..\..\src\modules\filters\scsuutf8.cpp");
+USEUNIT("..\..\src\modules\filters\swbasicfilter.cpp");
+USEUNIT("..\..\src\modules\filters\thmlfootnotes.cpp");
+USEUNIT("..\..\src\modules\filters\thmlheadings.cpp");
+USEUNIT("..\..\src\modules\filters\thmlhtmlhref.cpp");
+USEUNIT("..\..\src\modules\filters\thmllemma.cpp");
+USEUNIT("..\..\src\modules\filters\thmlmorph.cpp");
+USEUNIT("..\..\src\modules\filters\thmlscripref.cpp");
+USEUNIT("..\..\src\modules\filters\thmlstrongs.cpp");
+USEUNIT("..\..\src\modules\filters\thmlvariants.cpp");
+USEUNIT("..\..\src\modules\filters\unicodertf.cpp");
+USEUNIT("..\..\src\modules\filters\utf16utf8.cpp");
+USEUNIT("..\..\src\modules\filters\utf8arshaping.cpp");
+USEUNIT("..\..\src\modules\filters\utf8bidireorder.cpp");
+USEUNIT("..\..\src\modules\filters\utf8cantillation.cpp");
+USEUNIT("..\..\src\modules\filters\utf8greekaccents.cpp");
+USEUNIT("..\..\src\modules\filters\utf8hebrewpoints.cpp");
+USEUNIT("..\..\src\modules\filters\utf8html.cpp");
+USEUNIT("..\..\src\modules\filters\utf8latin1.cpp");
+USEUNIT("..\..\src\modules\filters\utf8nfc.cpp");
+USEUNIT("..\..\src\modules\filters\utf8nfkd.cpp");
+USEUNIT("..\..\src\modules\filters\utf8transliterator.cpp");
+USEUNIT("..\..\src\utilfuns\roman.c");
+USEUNIT("..\..\src\modules\comments\zcom\zcom.cpp");
+USEUNIT("..\..\src\modules\lexdict\rawld4\rawld4.cpp");
+USEUNIT("..\..\src\modules\common\zipcomprs.cpp");
+USEUNIT("..\..\src\modules\lexdict\zld\zld.cpp");
+USEUNIT("..\..\src\modules\common\entriesblk.cpp");
+USEUNIT("..\..\src\utilfuns\zlib\zutil.c");
+USEUNIT("..\..\src\utilfuns\zlib\compress.c");
+USEUNIT("..\..\src\utilfuns\zlib\crc32.c");
+USEUNIT("..\..\src\utilfuns\zlib\deflate.c");
+USEUNIT("..\..\src\utilfuns\zlib\gzio.c");
+USEUNIT("..\..\src\utilfuns\zlib\infblock.c");
+USEUNIT("..\..\src\utilfuns\zlib\infcodes.c");
+USEUNIT("..\..\src\utilfuns\zlib\inffast.c");
+USEUNIT("..\..\src\utilfuns\zlib\inflate.c");
+USEUNIT("..\..\src\utilfuns\zlib\inftrees.c");
+USEUNIT("..\..\src\utilfuns\zlib\infutil.c");
+USEUNIT("..\..\src\utilfuns\zlib\trees.c");
+USEUNIT("..\..\src\utilfuns\zlib\uncompr.c");
+USEUNIT("..\..\src\utilfuns\zlib\untgz.c");
+USEUNIT("..\..\src\utilfuns\zlib\adler32.c");
+USEUNIT("..\..\src\modules\filters\thmlosis.cpp");
+USEUNIT("..\..\src\modules\filters\greeklexattribs.cpp");
+USEUNIT("..\..\src\mgr\swcacher.cpp");
+USEUNIT("..\..\src\modules\filters\gbfosis.cpp");
+//---------------------------------------------------------------------------
+#define Library
+
+// To add a file to the library use the Project menu 'Add to Project'.
+
diff --git a/tests/bcppmake/libsword.bpr b/tests/bcppmake/libsword.bpr
new file mode 100644
index 0000000..dccd59d
--- /dev/null
+++ b/tests/bcppmake/libsword.bpr
@@ -0,0 +1,196 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!-- C++Builder XML Project -->
+<PROJECT>
+ <MACROS>
+ <VERSION value="BCB.05.03"/>
+ <PROJECT value="libsword.lib"/>
+ <OBJFILES value="..\..\src\keys\versekey.obj ..\..\src\keys\strkey.obj
+ ..\..\src\keys\swkey.obj ..\..\src\keys\listkey.obj
+ ..\..\src\mgr\swmgr.obj ..\..\src\mgr\localemgr.obj
+ ..\..\src\mgr\swconfig.obj ..\..\src\mgr\swlocale.obj
+ ..\..\src\mgr\filemgr.obj ..\..\src\utilfuns\utilstr.obj
+ ..\..\src\utilfuns\utilconf.obj ..\..\src\utilfuns\Greek2Greek.obj
+ ..\..\src\frontend\swlog.obj ..\..\src\frontend\swdisp.obj
+ ..\..\src\modules\swmodule.obj ..\..\src\modules\comments\swcom.obj
+ ..\..\src\modules\comments\hrefcom\hrefcom.obj
+ ..\..\src\modules\comments\rawcom\rawcom.obj
+ ..\..\src\modules\comments\rawfiles\rawfiles.obj
+ ..\..\src\modules\common\lzsscomprs.obj
+ ..\..\src\modules\common\rawstr.obj ..\..\src\modules\common\rawverse.obj
+ ..\..\src\modules\common\sapphire.obj
+ ..\..\src\modules\common\swcipher.obj ..\..\src\modules\common\swcomprs.obj
+ ..\..\src\modules\filters\thmlrtf.obj
+ ..\..\src\modules\filters\gbffootnotes.obj
+ ..\..\src\modules\filters\gbfhtml.obj
+ ..\..\src\modules\filters\gbfplain.obj
+ ..\..\src\modules\filters\gbfrtf.obj ..\..\src\modules\filters\gbfstrongs.obj
+ ..\..\src\modules\filters\gbfthml.obj
+ ..\..\src\modules\filters\plainfootnotes.obj
+ ..\..\src\modules\filters\plainhtml.obj
+ ..\..\src\modules\filters\rtfhtml.obj
+ ..\..\src\modules\filters\rwphtml.obj ..\..\src\modules\filters\rwprtf.obj
+ ..\..\src\modules\filters\thmlgbf.obj
+ ..\..\src\modules\filters\thmlhtml.obj
+ ..\..\src\modules\filters\thmlplain.obj
+ ..\..\src\modules\filters\cipherfil.obj ..\..\src\modules\lexdict\swld.obj
+ ..\..\src\modules\lexdict\rawld\rawld.obj
+ ..\..\src\modules\texts\swtext.obj
+ ..\..\src\modules\texts\rawtext\rawtext.obj
+ ..\..\src\modules\texts\ztext\ztext.obj
+ ..\..\src\modules\common\zverse.obj ..\..\src\keys\treekey.obj
+ ..\..\src\keys\treekeyidx.obj ..\..\src\modules\common\rawstr4.obj
+ ..\..\src\modules\common\zstr.obj ..\..\src\modules\genbook\swgenbook.obj
+ ..\..\src\modules\genbook\rawgenbook\rawgenbook.obj
+ ..\..\src\mgr\swfiltermgr.obj ..\..\src\modules\filters\utf8utf16.obj
+ ..\..\src\modules\filters\gbfheadings.obj
+ ..\..\src\modules\filters\gbfhtmlhref.obj
+ ..\..\src\modules\filters\gbfmorph.obj
+ ..\..\src\modules\filters\latin1utf16.obj
+ ..\..\src\modules\filters\latin1utf8.obj
+ ..\..\src\modules\filters\scsuutf8.obj
+ ..\..\src\modules\filters\swbasicfilter.obj
+ ..\..\src\modules\filters\thmlfootnotes.obj
+ ..\..\src\modules\filters\thmlheadings.obj
+ ..\..\src\modules\filters\thmlhtmlhref.obj
+ ..\..\src\modules\filters\thmllemma.obj
+ ..\..\src\modules\filters\thmlmorph.obj
+ ..\..\src\modules\filters\thmlscripref.obj
+ ..\..\src\modules\filters\thmlstrongs.obj
+ ..\..\src\modules\filters\thmlvariants.obj
+ ..\..\src\modules\filters\unicodertf.obj
+ ..\..\src\modules\filters\utf16utf8.obj
+ ..\..\src\modules\filters\utf8arshaping.obj
+ ..\..\src\modules\filters\utf8bidireorder.obj
+ ..\..\src\modules\filters\utf8cantillation.obj
+ ..\..\src\modules\filters\utf8greekaccents.obj
+ ..\..\src\modules\filters\utf8hebrewpoints.obj
+ ..\..\src\modules\filters\utf8html.obj
+ ..\..\src\modules\filters\utf8latin1.obj
+ ..\..\src\modules\filters\utf8nfc.obj
+ ..\..\src\modules\filters\utf8nfkd.obj
+ ..\..\src\modules\filters\utf8transliterator.obj
+ ..\..\src\utilfuns\roman.obj ..\..\src\modules\comments\zcom\zcom.obj
+ ..\..\src\modules\lexdict\rawld4\rawld4.obj
+ ..\..\src\modules\common\zipcomprs.obj
+ ..\..\src\modules\lexdict\zld\zld.obj
+ ..\..\src\modules\common\entriesblk.obj ..\..\src\utilfuns\zlib\zutil.obj
+ ..\..\src\utilfuns\zlib\compress.obj ..\..\src\utilfuns\zlib\crc32.obj
+ ..\..\src\utilfuns\zlib\deflate.obj ..\..\src\utilfuns\zlib\gzio.obj
+ ..\..\src\utilfuns\zlib\infblock.obj ..\..\src\utilfuns\zlib\infcodes.obj
+ ..\..\src\utilfuns\zlib\inffast.obj ..\..\src\utilfuns\zlib\inflate.obj
+ ..\..\src\utilfuns\zlib\inftrees.obj ..\..\src\utilfuns\zlib\infutil.obj
+ ..\..\src\utilfuns\zlib\trees.obj ..\..\src\utilfuns\zlib\uncompr.obj
+ ..\..\src\utilfuns\zlib\untgz.obj ..\..\src\utilfuns\zlib\adler32.obj
+ ..\..\src\modules\filters\thmlosis.obj
+ ..\..\src\modules\filters\greeklexattribs.obj ..\..\src\mgr\swcacher.obj
+ ..\..\src\modules\filters\gbfosis.obj"/>
+ <RESFILES value=""/>
+ <DEFFILE value=""/>
+ <RESDEPEN value="$(RESFILES)"/>
+ <LIBFILES value=""/>
+ <LIBRARIES value=""/>
+ <PACKAGES value=""/>
+ <PATHCPP value=".;..\..\src\keys;..\..\src\mgr;..\..\src\utilfuns;..\..\src\frontend;..\..\src\modules;..\..\src\modules\comments;..\..\src\modules\comments\hrefcom;..\..\src\modules\comments\rawcom;..\..\src\modules\comments\rawfiles;..\..\src\modules\common;..\..\src\modules\filters;..\..\src\modules\lexdict;..\..\src\modules\lexdict\rawld;..\..\src\modules\texts;..\..\src\modules\texts\rawtext;..\..\src\modules\texts\ztext;..\..\src\modules\genbook;..\..\src\modules\genbook\rawgenbook;..\..\src\modules\comments\zcom;..\..\src\modules\lexdict\rawld4;..\..\src\modules\lexdict\zld;..\..\src\utilfuns\zlib"/>
+ <PATHPAS value=".;"/>
+ <PATHRC value=".;"/>
+ <PATHASM value=".;"/>
+ <LINKER value="TLib"/>
+ <USERDEFINES value="_DEBUG"/>
+ <SYSDEFINES value="NO_STRICT"/>
+ <MAINSOURCE value="libsword.bpf"/>
+ <INCLUDEPATH value="..\..\src\utilfuns\zlib;..\..\src\modules\lexdict\zld;..\..\src\modules\lexdict\rawld4;..\..\src\modules\comments\zcom;..\..\src\modules\genbook\rawgenbook;..\..\src\modules\genbook;..\..\src\modules\texts\ztext;..\..\src\modules\texts\rawtext;..\..\src\modules\texts;..\..\src\modules\lexdict\rawld;..\..\src\modules\lexdict;..\..\src\modules\filters;..\..\src\modules\common;..\..\src\modules\comments\rawfiles;..\..\src\modules\comments\rawcom;..\..\src\modules\comments\hrefcom;..\..\src\modules\comments;..\..\src\modules;..\..\src\frontend;..\..\src\utilfuns;..\..\src\mgr;..\..\src\keys;..\..\include;$(BCB)\include;$(BCB)\include\vcl"/>
+ <LIBPATH value="..\..\src\utilfuns\zlib;..\..\src\modules\lexdict\zld;..\..\src\modules\lexdict\rawld4;..\..\src\modules\comments\zcom;..\..\src\modules\genbook\rawgenbook;..\..\src\modules\genbook;..\..\src\modules\texts\ztext;..\..\src\modules\texts\rawtext;..\..\src\modules\texts;..\..\src\modules\lexdict\rawld;..\..\src\modules\lexdict;..\..\src\modules\filters;..\..\src\modules\common;..\..\src\modules\comments\rawfiles;..\..\src\modules\comments\rawcom;..\..\src\modules\comments\hrefcom;..\..\src\modules\comments;..\..\src\modules;..\..\src\frontend;..\..\src\utilfuns;..\..\src\mgr;..\..\src\keys;$(BCB)\lib\obj;$(BCB)\lib"/>
+ <WARNINGS value="-w-par"/>
+ <LISTFILE value=""/>
+ </MACROS>
+ <OPTIONS>
+ <CFLAG1 value="-vGc -vGt -vGd -Od -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -r- -a8 -b- -k
+ -y -v -vi- -c -tW -tWM"/>
+ <PFLAGS value="-$Y+ -$W -$O- -v -JPHNE -M"/>
+ <AFLAGS value="/mx /w2 /zi"/>
+ <LFLAGS value="/P512"/>
+ </OPTIONS>
+ <LINKER>
+ <ALLOBJ value="$(OBJFILES)"/>
+ <ALLLIB value="cg32.lib"/>
+ </LINKER>
+ <IDEOPTIONS>
+[Version Info]
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1033
+CodePage=1252
+
+[Version Info Keys]
+CompanyName=
+FileDescription=
+FileVersion=1.0.0.0
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=1.0.0.0
+Comments=
+
+[HistoryLists\hlIncludePath]
+Count=5
+Item0=..\..\src\utilfuns\zlib;..\..\src\modules\lexdict\zld;..\..\src\modules\lexdict\rawld4;..\..\src\modules\comments\zcom;..\..\src\modules\genbook\rawgenbook;..\..\src\modules\genbook;..\..\src\modules\texts\ztext;..\..\src\modules\texts\rawtext;..\..\src\modules\texts;..\..\src\modules\lexdict\rawld;..\..\src\modules\lexdict;..\..\src\modules\filters;..\..\src\modules\common;..\..\src\modules\comments\rawfiles;..\..\src\modules\comments\rawcom;..\..\src\modules\comments\hrefcom;..\..\src\modules\comments;..\..\src\modules;..\..\src\frontend;..\..\src\utilfuns;..\..\src\mgr;..\..\src\keys;..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item1=..\..\src\modules\texts\ztext;..\..\src\modules\texts\rawtext;..\..\src\modules\texts;..\..\src\modules\lexdict\rawld;..\..\src\modules\lexdict;..\..\src\modules\filters;..\..\src\modules\common;..\..\src\modules\comments\rawfiles;..\..\src\modules\comments\rawcom;..\..\src\modules\comments\hrefcom;..\..\src\modules\comments;..\..\src\modules;..\..\src\frontend;..\..\src\utilfuns;..\..\src\mgr;..\..\src\keys;..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item2=..\..\src\modules\texts\rawtext;..\..\src\modules\texts;..\..\src\modules\lexdict\rawld;..\..\src\modules\lexdict;..\..\src\modules\filters;..\..\src\modules\common;..\..\src\modules\comments\rawfiles;..\..\src\modules\comments\rawcom;..\..\src\modules\comments\hrefcom;..\..\src\modules\comments;..\..\src\modules;..\..\src\frontend;..\..\src\utilfuns;..\..\src\mgr;..\..\src\keys;..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item3=..\include;$(BCB)\include;$(BCB)\include\vcl
+Item4=..\src\modules\texts\rawtext;..\src\modules\texts;..\src\modules\lexdict\rawld;..\src\modules\lexdict;..\src\modules\filters;..\src\modules\common;..\src\modules\comments\rawfiles;..\src\modules\comments\rawcom;..\src\modules\comments\hrefcom;..\src\modules\comments;..\src\modules;..\src\frontend;..\src\utilfuns;..\src\mgr;..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+
+[HistoryLists\hlLibraryPath]
+Count=4
+Item0=..\..\src\utilfuns\zlib;..\..\src\modules\lexdict\zld;..\..\src\modules\lexdict\rawld4;..\..\src\modules\comments\zcom;..\..\src\modules\genbook\rawgenbook;..\..\src\modules\genbook;..\..\src\modules\texts\ztext;..\..\src\modules\texts\rawtext;..\..\src\modules\texts;..\..\src\modules\lexdict\rawld;..\..\src\modules\lexdict;..\..\src\modules\filters;..\..\src\modules\common;..\..\src\modules\comments\rawfiles;..\..\src\modules\comments\rawcom;..\..\src\modules\comments\hrefcom;..\..\src\modules\comments;..\..\src\modules;..\..\src\frontend;..\..\src\utilfuns;..\..\src\mgr;..\..\src\keys;$(BCB)\lib\obj;$(BCB)\lib
+Item1=..\..\src\modules\texts\ztext;..\..\src\modules\texts\rawtext;..\..\src\modules\texts;..\..\src\modules\lexdict\rawld;..\..\src\modules\lexdict;..\..\src\modules\filters;..\..\src\modules\common;..\..\src\modules\comments\rawfiles;..\..\src\modules\comments\rawcom;..\..\src\modules\comments\hrefcom;..\..\src\modules\comments;..\..\src\modules;..\..\src\frontend;..\..\src\utilfuns;..\..\src\mgr;..\..\src\keys;$(BCB)\lib\obj;$(BCB)\lib
+Item2=..\..\src\modules\texts\rawtext;..\..\src\modules\texts;..\..\src\modules\lexdict\rawld;..\..\src\modules\lexdict;..\..\src\modules\filters;..\..\src\modules\common;..\..\src\modules\comments\rawfiles;..\..\src\modules\comments\rawcom;..\..\src\modules\comments\hrefcom;..\..\src\modules\comments;..\..\src\modules;..\..\src\frontend;..\..\src\utilfuns;..\..\src\mgr;..\..\src\keys;$(BCB)\lib\obj;$(BCB)\lib
+Item3=..\src\modules\texts\rawtext;..\src\modules\texts;..\src\modules\lexdict\rawld;..\src\modules\lexdict;..\src\modules\filters;..\src\modules\common;..\src\modules\comments\rawfiles;..\src\modules\comments\rawcom;..\src\modules\comments\hrefcom;..\src\modules\comments;..\src\modules;..\src\frontend;..\src\utilfuns;..\src\mgr;..\src\keys;$(BCB)\lib\obj;$(BCB)\lib
+
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=$(BCB)\source\vcl
+
+[HistoryLists\hlConditionals]
+Count=1
+Item0=_DEBUG
+
+[HistoryLists\hlTlibPageSize]
+Count=5
+Item0=0x0200
+Item1=0x0080
+Item2=0x0040
+Item3=0x0020
+Item4=0x0010
+
+[Debugging]
+DebugSourceDirs=$(BCB)\source\vcl
+
+[Parameters]
+RunParams=
+HostApplication=
+RemoteHost=
+RemotePath=
+RemoteDebug=0
+
+[Compiler]
+ShowInfoMsgs=0
+LinkDebugVcl=0
+LinkCGLIB=1
+
+[Language]
+ActiveLang=
+ProjectLang=
+RootDir=
+ </IDEOPTIONS>
+</PROJECT> \ No newline at end of file
diff --git a/tests/bcppmake/mgrtest.bpf b/tests/bcppmake/mgrtest.bpf
new file mode 100644
index 0000000..580dad0
--- /dev/null
+++ b/tests/bcppmake/mgrtest.bpf
@@ -0,0 +1,10 @@
+USEUNIT("..\mgrtest.cpp");
+USELIB("..\..\lib\libsword.lib");
+USELIB("..\..\..\icu-sword\as_is\borland\icuuc.lib");
+USELIB("..\..\..\icu-sword\as_is\borland\icuin.lib");
+USELIB("..\..\..\icu-sword\as_is\borland\icudatab.lib");
+//---------------------------------------------------------------------------
+This file is used by the project manager only and should be treated like the project file
+
+
+main \ No newline at end of file
diff --git a/tests/bcppmake/mgrtest.bpr b/tests/bcppmake/mgrtest.bpr
new file mode 100644
index 0000000..7ac16de
--- /dev/null
+++ b/tests/bcppmake/mgrtest.bpr
@@ -0,0 +1,116 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!-- C++Builder XML Project -->
+<PROJECT>
+ <MACROS>
+ <VERSION value="BCB.05.03"/>
+ <PROJECT value="mgrtest.exe"/>
+ <OBJFILES value="..\mgrtest.obj"/>
+ <RESFILES value=""/>
+ <DEFFILE value=""/>
+ <RESDEPEN value="$(RESFILES)"/>
+ <LIBFILES value="..\..\lib\libsword.lib ..\..\..\icu-sword\as_is\borland\icuuc.lib
+ ..\..\..\icu-sword\as_is\borland\icuin.lib
+ ..\..\..\icu-sword\as_is\borland\icudatab.lib"/>
+ <LIBRARIES value=""/>
+ <SPARELIBS value=""/>
+ <PACKAGES value="VCL50.bpi VCLX50.bpi bcbsmp50.bpi QRPT50.bpi VCLDB50.bpi VCLBDE50.bpi
+ ibsmp50.bpi VCLDBX50.bpi TEEUI50.bpi TEEDB50.bpi TEE50.bpi TEEQR50.bpi
+ VCLIB50.bpi bcbie50.bpi VCLIE50.bpi INETDB50.bpi INET50.bpi NMFAST50.bpi
+ dclocx50.bpi bcb2kaxserver50.bpi"/>
+ <PATHCPP value=".;.."/>
+ <PATHPAS value=".;"/>
+ <PATHRC value=".;"/>
+ <PATHASM value=".;"/>
+ <DEBUGLIBPATH value="$(BCB)\lib\debug"/>
+ <RELEASELIBPATH value="$(BCB)\lib\release"/>
+ <LINKER value="tlink32"/>
+ <USERDEFINES value="_DEBUG"/>
+ <SYSDEFINES value="NO_STRICT;_NO_VCL"/>
+ <MAINSOURCE value="mgrtest.bpf"/>
+ <INCLUDEPATH value="..\;..;..\..\include;$(BCB)\include;$(BCB)\include\vcl"/>
+ <LIBPATH value="..\;..;$(BCB)\lib\obj;$(BCB)\lib"/>
+ <WARNINGS value="-w-par"/>
+ </MACROS>
+ <OPTIONS>
+ <CFLAG1 value="-Od -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -r- -a8 -b- -k -y -v -vi- -tWC
+ -tWM -c"/>
+ <PFLAGS value="-$Y+ -$W -$O- -v -JPHNE -M"/>
+ <RFLAGS value=""/>
+ <AFLAGS value="/mx /w2 /zi"/>
+ <LFLAGS value="-D&quot;&quot; -S:0x300000 -Sc:0x20000 -ap -Tpe -x -Gn -v"/>
+ </OPTIONS>
+ <LINKER>
+ <ALLOBJ value="c0x32.obj $(OBJFILES)"/>
+ <ALLRES value="$(RESFILES)"/>
+ <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cw32mt.lib"/>
+ </LINKER>
+ <IDEOPTIONS>
+[Version Info]
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1033
+CodePage=1252
+
+[Version Info Keys]
+CompanyName=
+FileDescription=
+FileVersion=1.0.0.0
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=1.0.0.0
+Comments=
+
+[HistoryLists\hlIncludePath]
+Count=4
+Item0=..\;..;..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item1=..\;..\..\utilities;..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item2=..;..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item3=..\..\utilities;$(BCB)\include;$(BCB)\include\vcl
+
+[HistoryLists\hlLibraryPath]
+Count=3
+Item0=..\;..;$(BCB)\lib\obj;$(BCB)\lib
+Item1=..\;..\..\utilities;$(BCB)\lib\obj;$(BCB)\lib
+Item2=..\..\utilities;$(BCB)\lib\obj;$(BCB)\lib
+
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=$(BCB)\source\vcl
+
+[HistoryLists\hlConditionals]
+Count=1
+Item0=_DEBUG
+
+[Debugging]
+DebugSourceDirs=$(BCB)\source\vcl
+
+[Parameters]
+RunParams=
+HostApplication=
+RemoteHost=
+RemotePath=
+RemoteDebug=0
+
+[Compiler]
+ShowInfoMsgs=0
+LinkDebugVcl=0
+LinkCGLIB=0
+
+[Language]
+ActiveLang=
+ProjectLang=
+RootDir=
+ </IDEOPTIONS>
+</PROJECT> \ No newline at end of file
diff --git a/tests/bcppmake/parsekey.bpf b/tests/bcppmake/parsekey.bpf
new file mode 100644
index 0000000..490b3c6
--- /dev/null
+++ b/tests/bcppmake/parsekey.bpf
@@ -0,0 +1,10 @@
+USEUNIT("..\parsekey.cpp");
+USELIB("..\..\lib\libsword.lib");
+USELIB("..\..\..\icu-sword\as_is\borland\icuuc.lib");
+USELIB("..\..\..\icu-sword\as_is\borland\icuin.lib");
+USELIB("..\..\..\icu-sword\as_is\borland\icudatab.lib");
+//---------------------------------------------------------------------------
+This file is used by the project manager only and should be treated like the project file
+
+
+main \ No newline at end of file
diff --git a/tests/bcppmake/parsekey.bpr b/tests/bcppmake/parsekey.bpr
new file mode 100644
index 0000000..167a8ad
--- /dev/null
+++ b/tests/bcppmake/parsekey.bpr
@@ -0,0 +1,116 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!-- C++Builder XML Project -->
+<PROJECT>
+ <MACROS>
+ <VERSION value="BCB.05.03"/>
+ <PROJECT value="parsekey.exe"/>
+ <OBJFILES value="..\parsekey.obj"/>
+ <RESFILES value=""/>
+ <DEFFILE value=""/>
+ <RESDEPEN value="$(RESFILES)"/>
+ <LIBFILES value="..\..\lib\libsword.lib ..\..\..\icu-sword\as_is\borland\icuuc.lib
+ ..\..\..\icu-sword\as_is\borland\icuin.lib
+ ..\..\..\icu-sword\as_is\borland\icudatab.lib"/>
+ <LIBRARIES value=""/>
+ <SPARELIBS value=""/>
+ <PACKAGES value="VCL50.bpi VCLX50.bpi bcbsmp50.bpi QRPT50.bpi VCLDB50.bpi VCLBDE50.bpi
+ ibsmp50.bpi VCLDBX50.bpi TEEUI50.bpi TEEDB50.bpi TEE50.bpi TEEQR50.bpi
+ VCLIB50.bpi bcbie50.bpi VCLIE50.bpi INETDB50.bpi INET50.bpi NMFAST50.bpi
+ dclocx50.bpi bcb2kaxserver50.bpi"/>
+ <PATHCPP value=".;.."/>
+ <PATHPAS value=".;"/>
+ <PATHRC value=".;"/>
+ <PATHASM value=".;"/>
+ <DEBUGLIBPATH value="$(BCB)\lib\debug"/>
+ <RELEASELIBPATH value="$(BCB)\lib\release"/>
+ <LINKER value="tlink32"/>
+ <USERDEFINES value="_DEBUG"/>
+ <SYSDEFINES value="NO_STRICT;_NO_VCL"/>
+ <MAINSOURCE value="parsekey.bpf"/>
+ <INCLUDEPATH value="..\;..;..\..\include;$(BCB)\include;$(BCB)\include\vcl"/>
+ <LIBPATH value="..\;..;$(BCB)\lib\obj;$(BCB)\lib"/>
+ <WARNINGS value="-w-par"/>
+ </MACROS>
+ <OPTIONS>
+ <CFLAG1 value="-Od -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -r- -a8 -b- -k -y -v -vi- -tWC
+ -tWM -c"/>
+ <PFLAGS value="-$Y+ -$W -$O- -v -JPHNE -M"/>
+ <RFLAGS value=""/>
+ <AFLAGS value="/mx /w2 /zi"/>
+ <LFLAGS value="-D&quot;&quot; -S:0x300000 -Sc:0x20000 -ap -Tpe -x -Gn -v"/>
+ </OPTIONS>
+ <LINKER>
+ <ALLOBJ value="c0x32.obj $(OBJFILES)"/>
+ <ALLRES value="$(RESFILES)"/>
+ <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cw32mt.lib"/>
+ </LINKER>
+ <IDEOPTIONS>
+[Version Info]
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1033
+CodePage=1252
+
+[Version Info Keys]
+CompanyName=
+FileDescription=
+FileVersion=1.0.0.0
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=1.0.0.0
+Comments=
+
+[HistoryLists\hlIncludePath]
+Count=4
+Item0=..\;..;..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item1=..\;..\..\utilities;..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item2=..;..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item3=..\..\utilities;$(BCB)\include;$(BCB)\include\vcl
+
+[HistoryLists\hlLibraryPath]
+Count=3
+Item0=..\;..;$(BCB)\lib\obj;$(BCB)\lib
+Item1=..\;..\..\utilities;$(BCB)\lib\obj;$(BCB)\lib
+Item2=..\..\utilities;$(BCB)\lib\obj;$(BCB)\lib
+
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=$(BCB)\source\vcl
+
+[HistoryLists\hlConditionals]
+Count=1
+Item0=_DEBUG
+
+[Debugging]
+DebugSourceDirs=$(BCB)\source\vcl
+
+[Parameters]
+RunParams=&quot;jn1:2 -3:4&quot;
+HostApplication=
+RemoteHost=
+RemotePath=
+RemoteDebug=0
+
+[Compiler]
+ShowInfoMsgs=0
+LinkDebugVcl=0
+LinkCGLIB=0
+
+[Language]
+ActiveLang=
+ProjectLang=
+RootDir=
+ </IDEOPTIONS>
+</PROJECT> \ No newline at end of file
diff --git a/tests/bcppmake/tests.bpg b/tests/bcppmake/tests.bpg
new file mode 100644
index 0000000..d9b64c4
--- /dev/null
+++ b/tests/bcppmake/tests.bpg
@@ -0,0 +1,33 @@
+#------------------------------------------------------------------------------
+VERSION = BWS.01
+#------------------------------------------------------------------------------
+!ifndef ROOT
+ROOT = $(MAKEDIR)\..
+!endif
+#------------------------------------------------------------------------------
+MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$**
+DCC = $(ROOT)\bin\dcc32.exe $**
+BRCC = $(ROOT)\bin\brcc32.exe $**
+#------------------------------------------------------------------------------
+PROJECTS = libsword.lib parsekey.exe filtertest.exe mgrtest.exe
+#------------------------------------------------------------------------------
+default: $(PROJECTS)
+#------------------------------------------------------------------------------
+
+parsekey.exe: parsekey.bpr
+ $(ROOT)\bin\bpr2mak $**
+ $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak
+
+filtertest.exe: filtertest.bpr
+ $(ROOT)\bin\bpr2mak $**
+ $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak
+
+mgrtest.exe: mgrtest.bpr
+ $(ROOT)\bin\bpr2mak $**
+ $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak
+
+libsword.lib: ..\..\lib\bcppmake\libsword.bpr
+ $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $**
+ $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak
+
+
diff --git a/tests/casttest.cpp b/tests/casttest.cpp
new file mode 100644
index 0000000..7fdedca
--- /dev/null
+++ b/tests/casttest.cpp
@@ -0,0 +1,30 @@
+#include <iostream>
+#include <versekey.h>
+#include <treekeyidx.h>
+#include <listkey.h>
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+int main(int argc, char **argv) {
+// VerseKey x("jas");
+ TreeKeyIdx x("jas");
+// ListKey x("jas");
+ SWKey *y = &x;
+ TreeKeyIdx *v = &x;
+// VerseKey *v = &x;
+// ListKey *v = &x;
+
+// v = SWDYNAMIC_CAST(VerseKey, y);
+ v = SWDYNAMIC_CAST(TreeKeyIdx, y);
+// v = SWDYNAMIC_CAST(ListKey, y);
+ std::cout << std::endl;
+ if (v)
+ std::cout << (const char *)(*v);
+ else
+ std::cout << "cast failed\n";
+
+ std::cout << std::endl;
+ std::cout << std::endl;
+ return 0;
+}
diff --git a/tests/ciphertest.cpp b/tests/ciphertest.cpp
new file mode 100644
index 0000000..36fc0b9
--- /dev/null
+++ b/tests/ciphertest.cpp
@@ -0,0 +1,32 @@
+#include <cipherfil.h>
+#include <filemgr.h>
+#include <swbuf.h>
+#include <iostream>
+
+using namespace sword;
+
+int main(int argc, char **argv) {
+
+ if (argc != 3) {
+ std::cerr << "usage: " << *argv << " <key> <0-encipher|1-decipher>\n";
+ return -1;
+ }
+
+
+ int encipher = atoi(argv[2]);
+
+ SWFilter *filter = new CipherFilter(argv[1]);
+
+ SWBuf text;
+ char buf[4096];
+ std::cin >> buf;
+ text = buf;
+
+ filter->processText(text, (SWKey *)encipher);
+
+ std::cout << text;
+
+
+
+ return 0;
+}
diff --git a/tests/complzss.cpp b/tests/complzss.cpp
new file mode 100644
index 0000000..6040605
--- /dev/null
+++ b/tests/complzss.cpp
@@ -0,0 +1,110 @@
+
+
+#include <ctype.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifndef __GNUC__
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+#include <filemgr.h>
+#include <lzsscomprs.h>
+
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+class FileCompress: public LZSSCompress {
+ int ifd;
+ int ofd;
+ int ufd;
+ int zfd;
+public:
+ FileCompress(char *);
+ ~FileCompress();
+ unsigned long GetChars(char *, unsigned long len);
+ unsigned long SendChars(char *, unsigned long len);
+ void Encode();
+ void Decode();
+};
+
+
+FileCompress::FileCompress(char *fname)
+{
+ char buf[256];
+
+ ufd = FileMgr::createPathAndFile(fname);
+
+ sprintf(buf, "%s.lzs", fname);
+ zfd = FileMgr::createPathAndFile(buf);
+}
+
+
+FileCompress::~FileCompress()
+{
+ close(ufd);
+ close(zfd);
+}
+
+
+unsigned long FileCompress::GetChars(char *buf, unsigned long len)
+{
+ return read(ifd, buf, len);
+}
+
+
+unsigned long FileCompress::SendChars(char *buf, unsigned long len)
+{
+ return write(ofd, buf, len);
+}
+
+
+void FileCompress::Encode()
+{
+ ifd = ufd;
+ ofd = zfd;
+
+ LZSSCompress::Encode();
+}
+
+
+void FileCompress::Decode()
+{
+ ifd = zfd;
+ ofd = ufd;
+
+ LZSSCompress::Decode();
+}
+
+
+int main(int argc, char **argv)
+{
+ int decomp = 0;
+ SWCompress *fobj;
+
+ if (argc != 2) {
+ fprintf(stderr, "usage: %s <filename|filename.lzs>\n", argv[0]);
+ exit(1);
+ }
+
+ if (strlen(argv[1]) > 4) {
+ if (!strcmp(&argv[1][strlen(argv[1])-4], ".lzs")) {
+ argv[1][strlen(argv[1])-4] = 0;
+ decomp = 1;
+ }
+ }
+
+ fobj = new FileCompress(argv[1]);
+
+ if (decomp)
+ fobj->Decode();
+ else fobj->Encode();
+
+ delete fobj;
+}
diff --git a/tests/compnone.cpp b/tests/compnone.cpp
new file mode 100644
index 0000000..9a01fef
--- /dev/null
+++ b/tests/compnone.cpp
@@ -0,0 +1,110 @@
+
+
+#include <ctype.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifndef __GNUC__
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+#include <filemgr.h>
+#include <swcomprs.h>
+
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+class FileCompress: public SWCompress {
+ int ifd;
+ int ofd;
+ int ufd;
+ int zfd;
+public:
+ FileCompress(char *);
+ ~FileCompress();
+ unsigned long GetChars(char *, unsigned long len);
+ unsigned long SendChars(char *, unsigned long len);
+ void Encode();
+ void Decode();
+};
+
+
+FileCompress::FileCompress(char *fname)
+{
+ char buf[256];
+
+ ufd = FileMgr::createPathAndFile(fname);
+
+ sprintf(buf, "%s.zzz", fname);
+ zfd = FileMgr::createPathAndFile(buf);
+}
+
+
+FileCompress::~FileCompress()
+{
+ close(ufd);
+ close(zfd);
+}
+
+
+unsigned long FileCompress::GetChars(char *buf, unsigned long len)
+{
+ return read(ifd, buf, len);
+}
+
+
+unsigned long FileCompress::SendChars(char *buf, unsigned long len)
+{
+ return write(ofd, buf, len);
+}
+
+
+void FileCompress::Encode()
+{
+ ifd = ufd;
+ ofd = zfd;
+
+ SWCompress::Encode();
+}
+
+
+void FileCompress::Decode()
+{
+ ifd = zfd;
+ ofd = ufd;
+
+ SWCompress::Decode();
+}
+
+
+int main(int argc, char **argv)
+{
+ int decomp = 0;
+ SWCompress *fobj;
+
+ if (argc != 2) {
+ fprintf(stderr, "usage: %s <filename|filename.zzz>\n", argv[0]);
+ exit(1);
+ }
+
+ if (strlen(argv[1]) > 4) {
+ if (!strcmp(&argv[1][strlen(argv[1])-4], ".zzz")) {
+ argv[1][strlen(argv[1])-4] = 0;
+ decomp = 1;
+ }
+ }
+
+ fobj = new FileCompress(argv[1]);
+
+ if (decomp)
+ fobj->Decode();
+ else fobj->Encode();
+
+ delete fobj;
+}
diff --git a/tests/compzip.cpp b/tests/compzip.cpp
new file mode 100644
index 0000000..678410b
--- /dev/null
+++ b/tests/compzip.cpp
@@ -0,0 +1,109 @@
+#include <ctype.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+
+#ifndef __GNUC__
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+#include <filemgr.h>
+#include <zipcomprs.h>
+
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+class FileCompress: public ZipCompress {
+ int ifd;
+ int ofd;
+ int ufd;
+ int zfd;
+public:
+ FileCompress(char *);
+ ~FileCompress();
+ unsigned long GetChars(char *, unsigned long len);
+ unsigned long SendChars(char *, unsigned long len);
+ void Encode();
+ void Decode();
+};
+
+
+FileCompress::FileCompress(char *fname)
+{
+ char buf[256];
+
+ ufd = FileMgr::createPathAndFile(fname);
+
+ sprintf(buf, "%s.zip", fname);
+ zfd = FileMgr::createPathAndFile(buf);
+}
+
+
+FileCompress::~FileCompress()
+{
+ close(ufd);
+ close(zfd);
+}
+
+
+unsigned long FileCompress::GetChars(char *buf, unsigned long len)
+{
+ return read(ifd, buf, len);
+}
+
+
+unsigned long FileCompress::SendChars(char *buf, unsigned long len)
+{
+ return write(ofd, buf, len);
+}
+
+
+void FileCompress::Encode()
+{
+ ifd = ufd;
+ ofd = zfd;
+
+ ZipCompress::Encode();
+}
+
+
+void FileCompress::Decode()
+{
+ ifd = zfd;
+ ofd = ufd;
+
+ ZipCompress::Decode();
+}
+
+
+int main(int argc, char **argv)
+{
+ int decomp = 0;
+ SWCompress *fobj;
+
+ if (argc != 2) {
+ fprintf(stderr, "usage: %s <filename|filename.zip>\n", argv[0]);
+ exit(1);
+ }
+
+ if (strlen(argv[1]) > 4) {
+ if (!strcmp(&argv[1][strlen(argv[1])-4], ".zip")) {
+ argv[1][strlen(argv[1])-4] = 0;
+ decomp = 1;
+ }
+ }
+
+ fobj = new FileCompress(argv[1]);
+
+ if (decomp)
+ fobj->Decode();
+ else fobj->Encode();
+
+ delete fobj;
+ return 0;
+}
diff --git a/tests/configtest.cpp b/tests/configtest.cpp
new file mode 100644
index 0000000..b616cd5
--- /dev/null
+++ b/tests/configtest.cpp
@@ -0,0 +1,16 @@
+#include <iostream>
+#include <swconfig.h>
+#ifndef NO_SWORD_NAMESPACE
+using sword::SWConfig;
+#endif
+
+int main(int argc, char **argv) {
+ SWConfig config("./test1.conf");
+ config["Section1"]["Entry1"] = "Value1";
+ config["Section1"]["Entry2"] = "oops";
+ config["Section1"]["Entry2"] = "Value2";
+ config.Save();
+ SWConfig config2("./test1.conf");
+ std::cout << "Should be Value2: " << config2["Section1"]["Entry2"] << std::endl;
+ return 0;
+}
diff --git a/tests/cppunit/Makefile.am b/tests/cppunit/Makefile.am
new file mode 100644
index 0000000..2443be2
--- /dev/null
+++ b/tests/cppunit/Makefile.am
@@ -0,0 +1,16 @@
+LDADD = $(top_builddir)/lib/libsword.la
+
+# Rules for the test code (use `make check` to execute)
+if HAVE_CPPUNIT
+TESTS = LibSword
+else
+TESTS =
+endif
+check_PROGRAMS = $(TESTS)
+LibSword_SOURCES = main.cpp stringmgr_test.cpp swbuf_test.cpp url_test.cpp versekey_test.cpp
+LibSword_CXXFLAGS = $(CPPUNIT_CFLAGS) -I$(top_srcdir)/include
+LibSword_LDFLAGS = $(CPPUNIT_LIBS)
+
+swcppunitpdir = $(top_srcdir)/tests/cppunit
+
+#all: check
diff --git a/tests/cppunit/Makefile.in b/tests/cppunit/Makefile.in
new file mode 100644
index 0000000..c35295f
--- /dev/null
+++ b/tests/cppunit/Makefile.in
@@ -0,0 +1,630 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+@HAVE_CPPUNIT_TRUE@TESTS = LibSword$(EXEEXT)
+check_PROGRAMS = $(am__EXEEXT_1)
+subdir = tests/cppunit
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/acx_clucene.m4 \
+ $(top_srcdir)/m4/cppunit.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+@HAVE_CPPUNIT_TRUE@am__EXEEXT_1 = LibSword$(EXEEXT)
+am_LibSword_OBJECTS = LibSword-main.$(OBJEXT) \
+ LibSword-stringmgr_test.$(OBJEXT) \
+ LibSword-swbuf_test.$(OBJEXT) LibSword-url_test.$(OBJEXT) \
+ LibSword-versekey_test.$(OBJEXT)
+LibSword_OBJECTS = $(am_LibSword_OBJECTS)
+LibSword_LDADD = $(LDADD)
+LibSword_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+LibSword_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(LibSword_CXXFLAGS) \
+ $(CXXFLAGS) $(LibSword_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/include@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(LibSword_SOURCES)
+DIST_SOURCES = $(LibSword_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_CXXFLAGS = @AM_CXXFLAGS@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CLUCENE_CXXFLAGS = @CLUCENE_CXXFLAGS@
+CLUCENE_LIBS = @CLUCENE_LIBS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CURL_AM_CFLAGS = @CURL_AM_CFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
+CURL_LIBS = @CURL_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GENCCODE = @GENCCODE@
+GENCMN = @GENCMN@
+GENRB = @GENRB@
+GREP = @GREP@
+ICU_CONFIG = @ICU_CONFIG@
+ICU_IOLIBS = @ICU_IOLIBS@
+ICU_LIBS = @ICU_LIBS@
+ICU_VER = @ICU_VER@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKGDATA = @PKGDATA@
+PKG_CONFIG = @PKG_CONFIG@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XML_LIBS = @XML_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+dir_confdef = @dir_confdef@
+docdir = @docdir@
+dvidir = @dvidir@
+enable_debug = @enable_debug@
+enable_profile = @enable_profile@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_mingw32 = @target_mingw32@
+target_os = @target_os@
+target_system = @target_system@
+target_vendor = @target_vendor@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+with_conf = @with_conf@
+with_icu = @with_icu@
+with_zlib = @with_zlib@
+LDADD = $(top_builddir)/lib/libsword.la
+LibSword_SOURCES = main.cpp stringmgr_test.cpp swbuf_test.cpp url_test.cpp versekey_test.cpp
+LibSword_CXXFLAGS = $(CPPUNIT_CFLAGS) -I$(top_srcdir)/include
+LibSword_LDFLAGS = $(CPPUNIT_LIBS)
+swcppunitpdir = $(top_srcdir)/tests/cppunit
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/cppunit/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign tests/cppunit/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+LibSword$(EXEEXT): $(LibSword_OBJECTS) $(LibSword_DEPENDENCIES)
+ @rm -f LibSword$(EXEEXT)
+ $(LibSword_LINK) $(LibSword_OBJECTS) $(LibSword_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LibSword-main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LibSword-stringmgr_test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LibSword-swbuf_test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LibSword-url_test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LibSword-versekey_test.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+LibSword-main.o: main.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -MT LibSword-main.o -MD -MP -MF $(DEPDIR)/LibSword-main.Tpo -c -o LibSword-main.o `test -f 'main.cpp' || echo '$(srcdir)/'`main.cpp
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/LibSword-main.Tpo $(DEPDIR)/LibSword-main.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='main.cpp' object='LibSword-main.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -c -o LibSword-main.o `test -f 'main.cpp' || echo '$(srcdir)/'`main.cpp
+
+LibSword-main.obj: main.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -MT LibSword-main.obj -MD -MP -MF $(DEPDIR)/LibSword-main.Tpo -c -o LibSword-main.obj `if test -f 'main.cpp'; then $(CYGPATH_W) 'main.cpp'; else $(CYGPATH_W) '$(srcdir)/main.cpp'; fi`
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/LibSword-main.Tpo $(DEPDIR)/LibSword-main.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='main.cpp' object='LibSword-main.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -c -o LibSword-main.obj `if test -f 'main.cpp'; then $(CYGPATH_W) 'main.cpp'; else $(CYGPATH_W) '$(srcdir)/main.cpp'; fi`
+
+LibSword-stringmgr_test.o: stringmgr_test.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -MT LibSword-stringmgr_test.o -MD -MP -MF $(DEPDIR)/LibSword-stringmgr_test.Tpo -c -o LibSword-stringmgr_test.o `test -f 'stringmgr_test.cpp' || echo '$(srcdir)/'`stringmgr_test.cpp
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/LibSword-stringmgr_test.Tpo $(DEPDIR)/LibSword-stringmgr_test.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='stringmgr_test.cpp' object='LibSword-stringmgr_test.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -c -o LibSword-stringmgr_test.o `test -f 'stringmgr_test.cpp' || echo '$(srcdir)/'`stringmgr_test.cpp
+
+LibSword-stringmgr_test.obj: stringmgr_test.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -MT LibSword-stringmgr_test.obj -MD -MP -MF $(DEPDIR)/LibSword-stringmgr_test.Tpo -c -o LibSword-stringmgr_test.obj `if test -f 'stringmgr_test.cpp'; then $(CYGPATH_W) 'stringmgr_test.cpp'; else $(CYGPATH_W) '$(srcdir)/stringmgr_test.cpp'; fi`
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/LibSword-stringmgr_test.Tpo $(DEPDIR)/LibSword-stringmgr_test.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='stringmgr_test.cpp' object='LibSword-stringmgr_test.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -c -o LibSword-stringmgr_test.obj `if test -f 'stringmgr_test.cpp'; then $(CYGPATH_W) 'stringmgr_test.cpp'; else $(CYGPATH_W) '$(srcdir)/stringmgr_test.cpp'; fi`
+
+LibSword-swbuf_test.o: swbuf_test.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -MT LibSword-swbuf_test.o -MD -MP -MF $(DEPDIR)/LibSword-swbuf_test.Tpo -c -o LibSword-swbuf_test.o `test -f 'swbuf_test.cpp' || echo '$(srcdir)/'`swbuf_test.cpp
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/LibSword-swbuf_test.Tpo $(DEPDIR)/LibSword-swbuf_test.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='swbuf_test.cpp' object='LibSword-swbuf_test.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -c -o LibSword-swbuf_test.o `test -f 'swbuf_test.cpp' || echo '$(srcdir)/'`swbuf_test.cpp
+
+LibSword-swbuf_test.obj: swbuf_test.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -MT LibSword-swbuf_test.obj -MD -MP -MF $(DEPDIR)/LibSword-swbuf_test.Tpo -c -o LibSword-swbuf_test.obj `if test -f 'swbuf_test.cpp'; then $(CYGPATH_W) 'swbuf_test.cpp'; else $(CYGPATH_W) '$(srcdir)/swbuf_test.cpp'; fi`
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/LibSword-swbuf_test.Tpo $(DEPDIR)/LibSword-swbuf_test.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='swbuf_test.cpp' object='LibSword-swbuf_test.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -c -o LibSword-swbuf_test.obj `if test -f 'swbuf_test.cpp'; then $(CYGPATH_W) 'swbuf_test.cpp'; else $(CYGPATH_W) '$(srcdir)/swbuf_test.cpp'; fi`
+
+LibSword-url_test.o: url_test.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -MT LibSword-url_test.o -MD -MP -MF $(DEPDIR)/LibSword-url_test.Tpo -c -o LibSword-url_test.o `test -f 'url_test.cpp' || echo '$(srcdir)/'`url_test.cpp
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/LibSword-url_test.Tpo $(DEPDIR)/LibSword-url_test.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='url_test.cpp' object='LibSword-url_test.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -c -o LibSword-url_test.o `test -f 'url_test.cpp' || echo '$(srcdir)/'`url_test.cpp
+
+LibSword-url_test.obj: url_test.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -MT LibSword-url_test.obj -MD -MP -MF $(DEPDIR)/LibSword-url_test.Tpo -c -o LibSword-url_test.obj `if test -f 'url_test.cpp'; then $(CYGPATH_W) 'url_test.cpp'; else $(CYGPATH_W) '$(srcdir)/url_test.cpp'; fi`
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/LibSword-url_test.Tpo $(DEPDIR)/LibSword-url_test.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='url_test.cpp' object='LibSword-url_test.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -c -o LibSword-url_test.obj `if test -f 'url_test.cpp'; then $(CYGPATH_W) 'url_test.cpp'; else $(CYGPATH_W) '$(srcdir)/url_test.cpp'; fi`
+
+LibSword-versekey_test.o: versekey_test.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -MT LibSword-versekey_test.o -MD -MP -MF $(DEPDIR)/LibSword-versekey_test.Tpo -c -o LibSword-versekey_test.o `test -f 'versekey_test.cpp' || echo '$(srcdir)/'`versekey_test.cpp
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/LibSword-versekey_test.Tpo $(DEPDIR)/LibSword-versekey_test.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='versekey_test.cpp' object='LibSword-versekey_test.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -c -o LibSword-versekey_test.o `test -f 'versekey_test.cpp' || echo '$(srcdir)/'`versekey_test.cpp
+
+LibSword-versekey_test.obj: versekey_test.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -MT LibSword-versekey_test.obj -MD -MP -MF $(DEPDIR)/LibSword-versekey_test.Tpo -c -o LibSword-versekey_test.obj `if test -f 'versekey_test.cpp'; then $(CYGPATH_W) 'versekey_test.cpp'; else $(CYGPATH_W) '$(srcdir)/versekey_test.cpp'; fi`
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/LibSword-versekey_test.Tpo $(DEPDIR)/LibSword-versekey_test.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='versekey_test.cpp' object='LibSword-versekey_test.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LibSword_CXXFLAGS) $(CXXFLAGS) -c -o LibSword-versekey_test.obj `if test -f 'versekey_test.cpp'; then $(CYGPATH_W) 'versekey_test.cpp'; else $(CYGPATH_W) '$(srcdir)/versekey_test.cpp'; fi`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \
+ srcdir=$(srcdir); export srcdir; \
+ list=' $(TESTS) '; \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *$$ws$$tst$$ws*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ echo "XPASS: $$tst"; \
+ ;; \
+ *) \
+ echo "PASS: $$tst"; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *$$ws$$tst$$ws*) \
+ xfail=`expr $$xfail + 1`; \
+ echo "XFAIL: $$tst"; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ echo "FAIL: $$tst"; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ echo "SKIP: $$tst"; \
+ fi; \
+ done; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="All $$all tests passed"; \
+ else \
+ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all tests failed"; \
+ else \
+ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ skipped="($$skip tests were not run)"; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
+ clean-checkPROGRAMS clean-generic clean-libtool ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am
+
+
+#all: check
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/cppunit/main.cpp b/tests/cppunit/main.cpp
new file mode 100644
index 0000000..c1f69ee
--- /dev/null
+++ b/tests/cppunit/main.cpp
@@ -0,0 +1,25 @@
+//LibSword tests
+
+//CppUnit includes
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/ui/text/TestRunner.h>
+#include <cppunit/CompilerOutputter.h>
+
+#include <iostream>
+
+int main( int argc, char* argv[] ) {
+ CppUnit::TextUi::TestRunner runner;
+ CppUnit::TestFactoryRegistry &registry = CppUnit::TestFactoryRegistry::getRegistry();
+ runner.addTest( registry.makeTest() );
+
+ // Change the default outputter to a compiler error format outputter
+ // uncomment the following line if you need a compiler outputter.
+ runner.setOutputter(new CppUnit::CompilerOutputter( &runner.result(), std::cout ) );
+
+ //runner.setOutputter( new CppUnit::XmlOutputter( &runner.result(),
+ // std::cerr ) );
+
+ bool success = runner.run();
+ return success ? 0 : -1;
+ }
diff --git a/tests/cppunit/stringmgr_test.cpp b/tests/cppunit/stringmgr_test.cpp
new file mode 100644
index 0000000..545c910
--- /dev/null
+++ b/tests/cppunit/stringmgr_test.cpp
@@ -0,0 +1,43 @@
+#include <cppunit/extensions/HelperMacros.h>
+
+#include <iostream>
+
+#include "stringmgr.h"
+
+using namespace sword;
+using namespace std;
+
+class StringMgrTest : public CppUnit::TestFixture {
+CPPUNIT_TEST_SUITE( StringMgrTest );
+CPPUNIT_TEST( testUpperLatin1 );
+CPPUNIT_TEST( testUpperUTF8 );
+CPPUNIT_TEST_SUITE_END();
+
+public:
+ void setUp() {
+ }
+ void tearDown() {
+ }
+
+ void testUpperLatin1() {
+ StringMgr* mgr = StringMgr::getSystemStringMgr();
+
+ CPPUNIT_ASSERT( !strcmp(mgr->upperLatin1(""), "") );
+
+ char t[10] = "Test!";
+ const char* ret = mgr->upperLatin1(t);
+ cout << ret << endl;
+ CPPUNIT_ASSERT( ret && !strcmp(ret, "TEST!") );
+ }
+
+ void testUpperUTF8() {
+ StringMgr* mgr = StringMgr::getSystemStringMgr();
+ if (mgr->hasUTF8Support()) {
+ char t[10] = "hi";
+ char* ret = mgr->upperUTF8(t);
+ CPPUNIT_ASSERT( ret && !strcmp(ret, "HI") );
+ }
+ }
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(StringMgrTest);
diff --git a/tests/cppunit/swbuf_test.cpp b/tests/cppunit/swbuf_test.cpp
new file mode 100644
index 0000000..5c108b0
--- /dev/null
+++ b/tests/cppunit/swbuf_test.cpp
@@ -0,0 +1,113 @@
+#include <cppunit/extensions/HelperMacros.h>
+
+#include <iostream>
+
+#include "swbuf.h"
+using namespace sword;
+using namespace std;
+
+class SWBufTest : public CppUnit::TestFixture {
+CPPUNIT_TEST_SUITE( SWBufTest );
+CPPUNIT_TEST( testEquality );
+CPPUNIT_TEST( testAppendString );
+CPPUNIT_TEST( testAppendChar );
+CPPUNIT_TEST( testInsertString );
+CPPUNIT_TEST( testInsertChar );
+CPPUNIT_TEST_SUITE_END();
+
+public:
+ void setUp() {
+ }
+ void tearDown() {
+ }
+
+ void testEquality() {
+ SWBuf s1("Hi, this is a test!");
+ SWBuf s2("Hi, this is a test!");
+
+ CPPUNIT_ASSERT( s1 == s2 );
+ CPPUNIT_ASSERT( s1 == "Hi, this is a test!" );
+ CPPUNIT_ASSERT( !(s1 == "Hi, this is a wrong test!") );
+ }
+ void testAppendString() {
+ SWBuf t;
+
+ for (int i = 0; i < 5000; ++i) {
+ t.append("a");
+ t.append("b");
+ t.append("ccccc",1);
+ }
+ CPPUNIT_ASSERT( t.length() == 3*5000 );
+
+ char c = 'a';
+ for (int i = 0; i < 5000; ++i) { //check whether the append calls worked right
+ CPPUNIT_ASSERT( t[i] == c );
+
+ c = (c=='a') ? 'b' : ((c=='b') ? 'c' : 'a');
+ }
+ }
+ void testAppendChar() {
+ SWBuf t;
+
+ for (int i = 0; i < 5000; ++i) {
+ t.append('a');
+ t.append('b');
+ t.append('c');
+ }
+ CPPUNIT_ASSERT( t.length() == 3*5000 );
+
+ char c = 'a';
+ for (int i = 0; i < 5000; ++i) { //check whether the append calls worked right
+ CPPUNIT_ASSERT( t[i] == c );
+
+ c = (c=='a') ? 'b' : ((c=='b') ? 'c' : 'a');
+ }
+ }
+
+ void testInsertString() {
+ SWBuf t = "end";
+
+ for (int i = 0; i < 5000; ++i) {
+ t.insert(0, "a");
+ t.insert(1, "b");
+ t.insert(2, "ccccccc", 0, 1); //only one c
+ }
+ CPPUNIT_ASSERT( t.length() == 3*5000+3 );
+
+ char c = 'a';
+ for (int i = 0; i < 5000; ++i) { //check whether the append calls worked right
+ CPPUNIT_ASSERT( t[i] == c );
+
+ c = (c=='a') ? 'b' : ((c=='b') ? 'c' : 'a');
+ }
+ //check if end is at the end
+ CPPUNIT_ASSERT( t[3*5000+0] == 'e');
+ CPPUNIT_ASSERT( t[3*5000+1] == 'n');
+ CPPUNIT_ASSERT( t[3*5000+2] == 'd');
+ }
+
+ void testInsertChar() {
+ SWBuf t = "end";
+
+ for (int i = 0; i < 5000; ++i) {
+ t.insert(0, 'a');
+ t.insert(1, 'b');
+ t.insert(2, 'c');
+ }
+ CPPUNIT_ASSERT( t.length() == 3*5000+3 );
+
+ char c = 'a';
+ for (int i = 0; i < 5000; ++i) { //check whether the insert calls worked right
+ CPPUNIT_ASSERT( t[i] == c );
+
+ c = (c=='a') ? 'b' : ((c=='b') ? 'c' : 'a');
+ }
+ //check if end is at the end
+ CPPUNIT_ASSERT( t[3*5000+0] == 'e');
+ CPPUNIT_ASSERT( t[3*5000+1] == 'n');
+ CPPUNIT_ASSERT( t[3*5000+2] == 'd');
+ }
+
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(SWBufTest);
diff --git a/tests/cppunit/url_test.cpp b/tests/cppunit/url_test.cpp
new file mode 100644
index 0000000..a49dd10
--- /dev/null
+++ b/tests/cppunit/url_test.cpp
@@ -0,0 +1,108 @@
+#include <cppunit/extensions/HelperMacros.h>
+
+#include <iostream>
+
+#include "url.h"
+
+using namespace sword;
+using namespace std;
+
+class URLTest : public CppUnit::TestFixture {
+CPPUNIT_TEST_SUITE( URLTest );
+CPPUNIT_TEST( testProtocol );
+CPPUNIT_TEST( testHostName );
+CPPUNIT_TEST( testPath );
+CPPUNIT_TEST( testParametersMap );
+CPPUNIT_TEST( testParameterValue );
+CPPUNIT_TEST( testEncode );
+CPPUNIT_TEST( testDecode );
+CPPUNIT_TEST_SUITE_END();
+
+private:
+ sword::URL* m_url1;
+ sword::URL* m_url2;
+ sword::URL* m_url3;
+
+public:
+ void setUp() {
+ m_url1 = new sword::URL("http://www.crosswire.org/index.jsp?page=help&user=foo&name=bar");
+ m_url2 = new sword::URL("ftp://ftp.crosswire.org/sword/wiki/index.jsp?page=help&amp;user=foo&amp;name=foo%20bar");
+ m_url3 = new sword::URL("crosswire.org/index.jsp");
+ }
+ void tearDown() {
+ delete m_url1;
+ delete m_url2;
+ delete m_url3;
+ }
+
+ void testProtocol()
+ {
+ CPPUNIT_ASSERT( !strcmp(m_url1->getProtocol(), "http") );
+ CPPUNIT_ASSERT( !strcmp(m_url2->getProtocol(), "ftp") );
+ CPPUNIT_ASSERT( m_url3->getProtocol() && strlen( m_url3->getProtocol() ) == 0 );
+ }
+
+ void testHostName()
+ {
+ CPPUNIT_ASSERT( !strcmp(m_url1->getHostName(), "www.crosswire.org") );
+ CPPUNIT_ASSERT( !strcmp(m_url2->getHostName(), "ftp.crosswire.org") );
+ CPPUNIT_ASSERT( !strcmp(m_url3->getHostName(), "crosswire.org") );
+ }
+
+ void testPath()
+ {
+ CPPUNIT_ASSERT( !strcmp(m_url1->getPath(), "/index.jsp") );
+ CPPUNIT_ASSERT( !strcmp(m_url2->getPath(), "/sword/wiki/index.jsp") );
+ CPPUNIT_ASSERT( !strcmp(m_url3->getPath(), "/index.jsp") );
+ }
+
+ void testParametersMap()
+ {
+ std::map< sword::SWBuf, sword::SWBuf > params = m_url1->getParameters();
+ CPPUNIT_ASSERT( !strcmp(params[sword::SWBuf("page")].c_str(), "help") );
+ CPPUNIT_ASSERT( !strcmp(params[sword::SWBuf("user")].c_str(), "foo") );
+ CPPUNIT_ASSERT( !strcmp(params[sword::SWBuf("name")].c_str(), "bar") );
+
+ params = m_url2->getParameters(); //test url2 params
+ CPPUNIT_ASSERT( !strcmp(params[sword::SWBuf("page")].c_str(), "help") );
+ CPPUNIT_ASSERT( !strcmp(params[sword::SWBuf("user")].c_str(), "foo") );
+ CPPUNIT_ASSERT( !strcmp(params[sword::SWBuf("name")].c_str(), "foo bar") );
+
+ params = m_url3->getParameters(); //test url3 params
+ CPPUNIT_ASSERT( params.size() == 0 );
+ }
+
+ void testParameterValue()
+ {
+ CPPUNIT_ASSERT( !strcmp(m_url1->getParameterValue("page"), "help") );
+ CPPUNIT_ASSERT( !strcmp(m_url1->getParameterValue("user"), "foo") );
+ CPPUNIT_ASSERT( !strcmp(m_url1->getParameterValue("name"), "bar") );
+
+ CPPUNIT_ASSERT( !strcmp(m_url2->getParameterValue("page"), "help") );
+ CPPUNIT_ASSERT( !strcmp(m_url2->getParameterValue("user"), "foo") );
+ CPPUNIT_ASSERT( !strcmp(m_url2->getParameterValue("name"), "foo bar") );
+
+ CPPUNIT_ASSERT( m_url3->getParameterValue("page") && strlen(m_url3->getParameterValue("page")) == 0 );
+ }
+
+ void testEncode() {
+ cout << URL::encode("this is a test") << endl;
+
+ SWBuf encoded = URL::encode("this is a test");
+ CPPUNIT_ASSERT( !strcmp(encoded.c_str(), "this%20is%20a%20test") || !strcmp(encoded.c_str(), "this+is+a+test") );
+
+ CPPUNIT_ASSERT( !strcmp(URL::encode("this-is-a-test").c_str(), "this-is-a-test") );
+ CPPUNIT_ASSERT( !strcmp(URL::encode("").c_str(), "") );
+ }
+
+ void testDecode() {
+ CPPUNIT_ASSERT( !strcmp(URL::decode("this%3Eis%3Ea%3Etest").c_str(), "this>is>a>test") );
+ CPPUNIT_ASSERT( !strcmp(URL::decode("this%3Eis%3Ea%3Etest%3E").c_str(), "this>is>a>test>") );
+ CPPUNIT_ASSERT( !strcmp(URL::decode("%3E%3E%3E%3E%3E%3E%3E%3E%3E%3E%20%20%20%20%20").c_str(), ">>>>>>>>>> ") );
+ CPPUNIT_ASSERT( !strcmp(URL::decode("nothing%20").c_str(), "nothing ") );
+ CPPUNIT_ASSERT( !strcmp(URL::decode("nothing").c_str(), "nothing") );
+ CPPUNIT_ASSERT( !strcmp(URL::decode("").c_str(), "") );
+ }
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(URLTest);
diff --git a/tests/cppunit/versekey_test.cpp b/tests/cppunit/versekey_test.cpp
new file mode 100644
index 0000000..6a615dc
--- /dev/null
+++ b/tests/cppunit/versekey_test.cpp
@@ -0,0 +1,280 @@
+#include <cppunit/extensions/HelperMacros.h>
+
+#include <iostream>
+
+#include "localemgr.h"
+#include "swbuf.h"
+#include "versekey.h"
+
+using namespace sword;
+using namespace std;
+
+class VerseKeyTest : public CppUnit::TestFixture {
+CPPUNIT_TEST_SUITE( VerseKeyTest );
+
+CPPUNIT_TEST( testSingleKeyParsing );
+CPPUNIT_TEST( testRangeKeyParsing );
+CPPUNIT_TEST( testListKeyParsing );
+
+CPPUNIT_TEST( testLessThan );
+CPPUNIT_TEST( testLessEqualThan );
+CPPUNIT_TEST( testEquality );
+CPPUNIT_TEST( testGreaterEqualThan );
+CPPUNIT_TEST( testGreaterThan );
+
+CPPUNIT_TEST( testDecrement );
+CPPUNIT_TEST( testIncrement );
+
+CPPUNIT_TEST_SUITE_END();
+
+protected:
+ SWBuf parseKey(const char* keyValue, const char* locale) {
+ sword::VerseKey vk;
+ vk.setLocale(locale);
+ vk.setText(keyValue);
+
+ SWBuf ret( vk.getText() );
+ //std::cout << ret.c_str();
+ return ret;
+ };
+
+ SWBuf parseRangeKey(const char* keyValue, const char* locale) {
+ const char* oldLocale = LocaleMgr::getSystemLocaleMgr()->getDefaultLocaleName();
+ LocaleMgr::getSystemLocaleMgr()->setDefaultLocaleName(locale);
+
+ SWBuf ret;
+
+ VerseKey DefaultVSKey;
+ DefaultVSKey = "jas3:1";
+
+ ListKey verses = DefaultVSKey.ParseVerseList(keyValue, DefaultVSKey, true);
+
+ for (int i = 0; i < verses.Count(); i++) {
+ VerseKey *element = dynamic_cast<VerseKey *>(verses.GetElement(i));
+ if (element) {
+ if (ret.length()) {
+ ret.append(" ");
+ }
+
+ ret.appendFormatted( "%s - %s;", (const char*)element->LowerBound(), (const char*)element->UpperBound() );
+ }
+ else {
+ if (ret.length()) {
+ ret.append(" ");
+ }
+
+ ret.appendFormatted("%s;", (const char *)*verses.GetElement(i));
+ }
+ }
+
+// cout << ret.c_str() << endl;
+ LocaleMgr::getSystemLocaleMgr()->setDefaultLocaleName(oldLocale);
+ return ret;
+ };
+
+public:
+ void setUp() {
+/* m_vk1 = new sword::VerseKey();
+ m_vk2 = new sword::VerseKey();
+ m_vk3 = new sword::VerseKey();
+
+ setLocaleToAll("en");*/
+ }
+ void tearDown() {
+/* delete m_vk1;
+ delete m_vk2;
+ delete m_vk3;*/
+ }
+
+ void testSingleKeyParsing() {
+ //testing with I John 2:3 and locale en
+ CPPUNIT_ASSERT( parseKey("1jn.2.3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey("1 jn.2.3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey("Ijn.2.3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey("I jn.2.3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey( "1jn 2.3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey( "1 jn 2.3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey( "Ijn 2.3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey( "I jn 2.3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey( "1jn.2:3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey( "1 jn.2:3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey( "Ijn.2:3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey( "I jn.2:3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey( "1jn 2:3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey( "1 jn 2:3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey( "Ijn 2:3", "en") == "I John 2:3");
+
+ CPPUNIT_ASSERT( parseKey("1.jn.2.3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey("1. jn.2.3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey("I.jn.2.3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey("I. jn.2.3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey("1.jn 2.3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey("1. jn 2.3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey("I.jn 2.3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey("I. jn 2.3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey("1.jn.2:3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey("1. jn.2:3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey("I.jn.2:3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey("I. jn.2:3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey("1.jn 2:3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey("1. jn 2:3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey("I.jn 2:3", "en") == "I John 2:3");
+ CPPUNIT_ASSERT( parseKey("I. jn 2:3", "en") == "I John 2:3");
+
+
+ //testing the same with german locale
+ CPPUNIT_ASSERT( parseKey("1jn.2.3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey("1 jn.2.3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey("Ijn.2.3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey("I jn.2.3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey( "1jn 2.3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey( "1 jn 2.3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey( "Ijn 2.3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey( "I jn 2.3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey( "1jn.2:3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey( "1 jn.2:3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey( "Ijn.2:3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey( "I jn.2:3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey( "1jn 2:3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey( "1 jn 2:3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey( "Ijn 2:3", "de") == "1. Johannes 2:3");
+
+ CPPUNIT_ASSERT( parseKey("1.jn.2.3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey("1. jn.2.3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey("I.jn.2.3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey("I. jn.2.3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey("1.jn 2.3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey("1. jn 2.3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey("I.jn 2.3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey("I. jn 2.3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey("1.jn.2:3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey("1. jn.2:3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey("I.jn.2:3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey("I. jn.2:3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey("1.jn 2:3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey("1. jn 2:3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey("I.jn 2:3", "de") == "1. Johannes 2:3");
+ CPPUNIT_ASSERT( parseKey("I. jn 2:3", "de") == "1. Johannes 2:3");
+ }
+
+ void testRangeKeyParsing() {
+ //some range tests with the english locale
+ CPPUNIT_ASSERT( parseRangeKey("I. jn 1:1 - 3:10", "en") == "I John 1:1 - I John 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1Jn 1:1 - 3:10", "en") == "I John 1:1 - I John 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1Jn 1:1 -3:10", "en") == "I John 1:1 - I John 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1Jn 1:1- 3:10", "en") == "I John 1:1 - I John 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1Jn 1- 3:10", "en") == "I John 1:1 - I John 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1Jn 1 -3:10", "en") == "I John 1:1 - I John 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1Jn 1:1 -3:10; 1Jn 3:11", "en") == "I John 1:1 - I John 3:10; I John 3:11;");
+
+ //some range tests with german locale
+ CPPUNIT_ASSERT( parseRangeKey("I. jn 1:1 - 3:10", "de") == "1. Johannes 1:1 - 1. Johannes 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1. Joh 1:1 - 3:10", "de") == "1. Johannes 1:1 - 1. Johannes 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1. Johannes 1:1- 3:10", "de") == "1. Johannes 1:1 - 1. Johannes 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1. Joh 1:1- 3:10", "de") == "1. Johannes 1:1 - 1. Johannes 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1. Johannes 1:1 -3:10", "de") == "1. Johannes 1:1 - 1. Johannes 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1. Joh 1:1 -3:10", "de") == "1. Johannes 1:1 - 1. Johannes 3:10;");
+ }
+
+ void testListKeyParsing() {
+ //some range tests with the english locale
+ CPPUNIT_ASSERT( parseRangeKey("1Jn 1:1 3:10", "en") == "I John 1:1; I John 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1Jn 1:1 3:10", "en") == "I John 1:1; I John 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1Jn 1:1,3:10", "en") == "I John 1:1; I John 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1Jn 1:1, 3:10", "en") == "I John 1:1; I John 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1Jn 1:1 ,3:10", "en") == "I John 1:1; I John 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1Jn 1:1 , 3:10", "en") == "I John 1:1; I John 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1Jn 1:1;3:10", "en") == "I John 1:1; I John 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1Jn 1:1; 3:10", "en") == "I John 1:1; I John 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1Jn 1:1 ;3:10", "en") == "I John 1:1; I John 3:10;");
+ CPPUNIT_ASSERT( parseRangeKey("1Jn 1:1 ; 3:10", "en") == "I John 1:1; I John 3:10;");
+ }
+
+ void testLessThan() {
+ VerseKey vk1("Luke 1:1");
+ VerseKey vk2("Luke 1:1");
+ VerseKey vk3("Luke 1:2");
+
+ CPPUNIT_ASSERT( !(vk1 < vk2) );
+ CPPUNIT_ASSERT( vk1 < vk3 );
+
+ for (int n = 0; n < 30; n++) {//some more stress :)
+ vk1 = "Luke 1:1";
+ vk3 = vk1;
+
+ for (int j = 0; j < 30; ++j) {
+ vk1--;
+ CPPUNIT_ASSERT( vk1 < vk3 );
+ CPPUNIT_ASSERT( vk1 < VerseKey("Revelation") );
+ CPPUNIT_ASSERT( !(vk1 < VerseKey("Gen")) );
+ }
+ }
+ }
+ void testLessEqualThan() {
+ VerseKey vk1("Luke 1:1");
+ VerseKey vk2("Luke 1:1");
+ VerseKey vk3("Luke 1:2");
+
+ CPPUNIT_ASSERT( vk1 <= vk2 );
+ CPPUNIT_ASSERT( vk1 <= vk3 );
+
+ for (int n = 0; n < 30; n++) { //some more stress
+ vk1 = "Luke 1:1";
+ vk3 = vk1;
+
+ for (int j = 0; j < 30; ++j) {
+ CPPUNIT_ASSERT( vk1 <= vk3 );
+ CPPUNIT_ASSERT( vk1 <= VerseKey("Revelation") );
+ CPPUNIT_ASSERT( !(vk1 <= VerseKey("Gen")) );
+
+ vk1--;
+ }
+ }
+ }
+ void testEquality() {
+ VerseKey vk1("Luke 1:1");
+ VerseKey vk2("Luke 1:1");
+ VerseKey vk3("Luke 1:2");
+
+ CPPUNIT_ASSERT( vk1 == vk2 );
+ CPPUNIT_ASSERT( !(vk1 == vk3) );
+ }
+ void testGreaterEqualThan() {
+ VerseKey vk1("Luke 1:3");
+ VerseKey vk2("Luke 1:3");
+ VerseKey vk3("Luke 1:1");
+
+ CPPUNIT_ASSERT( vk1 >= vk2 );
+ CPPUNIT_ASSERT( vk1 >= vk3 );
+ }
+ void testGreaterThan() {
+ VerseKey vk1("Luke 1:3");
+ VerseKey vk2("Luke 1:1");
+ VerseKey vk3("Luke 1:2");
+
+ CPPUNIT_ASSERT( vk1 > vk2 );
+ CPPUNIT_ASSERT( vk1 > vk3 );
+ }
+
+ void testDecrement() {
+ VerseKey vk("Matthew 1:1");
+ const int delta = 10;
+
+ for (int i =0; i < delta; ++i) {
+ vk--;
+ }
+ CPPUNIT_ASSERT( vk == VerseKey("Mal 3:15") );
+ }
+ void testIncrement() {
+ VerseKey vk("Mal 3:15");
+ const int delta = 10;
+
+ for (int i =0; i < delta; ++i) {
+ vk++;
+ }
+ CPPUNIT_ASSERT( vk == VerseKey("Matthew 1:1") );
+ }
+
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(VerseKeyTest);
diff --git a/tests/filtertest.cpp b/tests/filtertest.cpp
new file mode 100644
index 0000000..d71bc91
--- /dev/null
+++ b/tests/filtertest.cpp
@@ -0,0 +1,23 @@
+#include <iostream>
+#include <swbuf.h>
+#include <papyriplain.h>
+//#include <swmgr.h>
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+using namespace std;
+
+
+int main(int argc, char **argv) {
+// SWMgr mgr;
+// SWModule *module = mgr.getModule("KJV");
+ PapyriPlain filter;
+ SWBuf buf;
+ buf = "This is t<e>xt which has papy-\nri markings in it.\n L[et's be] sure it gets--\n cleaned up well for s(earching)";
+ std::cout << "Original:\n\n" << buf << "\n\n-------\n\n";
+ filter.processText(buf);
+// filter.processText(buf, module->getKey(), module);
+ std::cout << buf << "\n\n+++++++\n";
+
+ return 0;
+}
diff --git a/tests/icutest.cpp b/tests/icutest.cpp
new file mode 100644
index 0000000..73cf999
--- /dev/null
+++ b/tests/icutest.cpp
@@ -0,0 +1,37 @@
+#include <iostream>
+#include <string>
+#include <malloc.h>
+#include <string.h>
+
+#include "unicode/utypes.h" /* Basic ICU data types */
+#include "unicode/ucnv.h" /* C Converter API */
+#include "unicode/ustring.h" /* some more string fcns*/
+
+#include "unicode/translit.h"
+
+using namespace std;
+
+int main() {
+
+ UChar * uBuf;
+ UChar * target;
+ UConverter *conv;
+ UErrorCode status = U_ZERO_ERROR;
+ int32_t uBufSize = 0, uLength = 0;
+
+ const char * samplestring = "If this compiles and runs without errors, apparently ICU is working.";
+
+ uLength = strlen(samplestring);
+ conv = ucnv_open("utf-8", &status);
+ uBufSize = (uLength/ucnv_getMinCharSize(conv));
+ uBuf = (UChar*)malloc(uBufSize * sizeof(UChar));
+
+ target = uBuf;
+
+ ucnv_toUChars(conv, target, uLength,
+ samplestring, uLength, &status);
+
+ cout << samplestring << endl;
+
+ return 0;
+}
diff --git a/tests/indextest.cpp b/tests/indextest.cpp
new file mode 100644
index 0000000..b3a712a
--- /dev/null
+++ b/tests/indextest.cpp
@@ -0,0 +1,23 @@
+#include <swmgr.h>
+#include <iostream>
+#include <versekey.h>
+#include <swmodule.h>
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+int main(int argc, char **argv) {
+ SWMgr mymgr;
+
+ SWModule *bbe = mymgr.Modules["BBE"];
+
+ if (bbe) {
+ VerseKey vk;
+ vk.Persist(1);
+ bbe->setKey(vk);
+ for (; !bbe->Error(); (*bbe)++ ) {
+ std::cout << vk.NewIndex() << std::endl;
+ }
+ }
+ return 0;
+}
diff --git a/tests/installmgrtest.cpp b/tests/installmgrtest.cpp
new file mode 100644
index 0000000..666f63b
--- /dev/null
+++ b/tests/installmgrtest.cpp
@@ -0,0 +1,12 @@
+#include <swinstallmgr.h>
+#include <iostream>
+
+using namespace std;
+using namespace sword;
+
+int main(int argc, char **argv) {
+ InstallMgr inst("ftp://ftp.crosswire.org/pub/sword/raw");
+ inst.Refresh();
+
+}
+
diff --git a/tests/introtest.cpp b/tests/introtest.cpp
new file mode 100644
index 0000000..162b960
--- /dev/null
+++ b/tests/introtest.cpp
@@ -0,0 +1,110 @@
+#include <swmgr.h>
+#include <iostream>
+#include <versekey.h>
+#include <rawtext.h>
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+int main(int argc, char **argv) {
+ SWMgr mymgr;
+
+ RawText::createModule(".");
+ RawText mod(".");
+
+ VerseKey vk;
+ vk.Headings(1);
+ vk.AutoNormalize(0);
+ vk.Persist(1);
+ mod.setKey(vk);
+
+ vk.Verse(0);
+ vk.Chapter(0);
+ vk.Book(0);
+ vk.Testament(0);
+
+ mod << "Module heading text";
+
+ vk.Verse(0);
+ vk.Chapter(0);
+ vk.Book(0);
+ vk.Testament(1);
+
+ mod << "OT heading text";
+
+ vk.Testament(1);
+ vk.Book(1);
+ vk.Chapter(0);
+ vk.Verse(0);
+
+ mod << "Gen heading text";
+
+ vk.Testament(1);
+ vk.Book(1);
+ vk.Chapter(1);
+ vk.Verse(0);
+
+ mod << "Gen 1 heading text";
+
+ vk.Testament(1);
+ vk.Book(1);
+ vk.Chapter(1);
+ vk.Verse(1);
+
+ mod << "Gen 1:1 text";
+
+
+ vk.Testament(0);
+ vk.Book(0);
+ vk.Chapter(0);
+ vk.Verse(0);
+
+ std::cout << "Module heading text ?= " << (const char*)mod << std::endl;
+
+ vk.Testament(1);
+ vk.Book(0);
+ vk.Chapter(0);
+ vk.Verse(0);
+
+ std::cout << "OT heading text ?= " << (const char*)mod << std::endl;
+
+ vk.Testament(1);
+ vk.Book(1);
+ vk.Chapter(0);
+ vk.Verse(0);
+
+ std::cout << "Gen heading text ?= " << (const char*)mod << std::endl;
+
+ vk.Testament(1);
+ vk.Book(1);
+ vk.Chapter(1);
+ vk.Verse(0);
+
+ std::cout << "Gen 1 heading text ?= " << (const char*)mod << std::endl;
+
+ vk.Testament(1);
+ vk.Book(1);
+ vk.Chapter(1);
+ vk.Verse(1);
+
+ std::cout << "Gen 1:1 text ?= " << (const char*)mod << std::endl;
+
+ /* old introtest
+ SWModule *mhc = mymgr.Modules["MHC"];
+
+ if (mhc) {
+ VerseKey vk;
+ vk.Headings(1);
+ vk.AutoNormalize(0);
+ vk.Persist(1);
+ vk = "jas 0:0";
+ std::cout << vk << ":\n";
+ mhc->setKey(vk);
+ std::cout << (const char *) mhc->Key() << ":\n";
+ std::cout << (const char *) *mhc << "\n";
+ }
+ */
+ return 0;
+}
+
+
diff --git a/tests/keycast.cpp b/tests/keycast.cpp
new file mode 100644
index 0000000..f037b0e
--- /dev/null
+++ b/tests/keycast.cpp
@@ -0,0 +1,33 @@
+#include <swmgr.h>
+#include <iostream>
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+int main (int argc, char* argv[]) {
+ SWMgr mgr;
+
+//the commented out code works
+/*
+ StringList globalOptions = mgr.getGlobalOptions();
+ for (StringList::iterator it = globalOptions.begin(); it != globalOptions.end(); it++) {
+ std::cout << *it << std::endl;
+
+ StringList values = mgr.getGlobalOptionValues((*it).c_str());
+ for (StringList::iterator it2 = values.begin(); it2 != values.end(); it2++) {
+ std::cout << "\t"<< *it2 << std::endl;
+ }
+ }
+*/
+
+//crashes
+ StringList values = mgr.getGlobalOptionValues("Footnotes");
+ for (StringList::iterator it2 = values.begin(); it2 != values.end(); it2++) {
+ std::cout << "\t"<< *it2 << std::endl;
+ }
+};
+
+
+
+
+
diff --git a/tests/keytest.cpp b/tests/keytest.cpp
new file mode 100644
index 0000000..91e77ac
--- /dev/null
+++ b/tests/keytest.cpp
@@ -0,0 +1,173 @@
+#include <stdio.h>
+#include <iostream>
+#include <versekey.h>
+#include <rawtext.h>
+#include <rawcom.h>
+#include <echomod.h>
+#include <stdlib.h>
+
+#include <localemgr.h>
+
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+int main(int argc, char **argv)
+{
+ int loop;
+ int max;
+
+ if (argc > 1)
+ LocaleMgr::getSystemLocaleMgr()->setDefaultLocaleName(argv[1]);
+
+ VerseKey bla;
+ long index;
+
+
+ if (argc < 2)
+ bla = "James 1:19";
+ else bla = argv[1];
+
+ std::cout << "\n loop++; (.Index(Index()+1))\n";
+
+ max = (argc < 3) ? 10 : atoi(argv[2]);
+
+ for (loop = 0; loop < max; loop++, bla++) {
+ index = bla.Index();
+ std::cout << (const char *)bla << "(" << index << ")";
+ bla.Index(index+1);
+ std::cout << "-> " << (const char *)bla << "\n";
+ }
+
+ std::cout << "-----------------\n";
+ std::cout << "\n loop--; (.Index(Index()-1))\n";
+ if (argc < 2)
+ bla = "James 1:19";
+ else bla = argv[1];
+
+ for (loop = max; loop; loop--, bla--) {
+ index = bla.Index();
+ std::cout << (const char *)bla << "(" << index << ")";
+ bla.Index(index-1);
+ std::cout << "-> " << (const char *)bla << "\n";
+ }
+
+ std::cout << "-----------------\n";
+ std::cout << "--------- No Headings --------\n";
+
+ if (argc < 2)
+ bla = "Matthew 1:5";
+ else bla = argv[1];
+
+ for (loop = max; loop; loop--, bla--) {
+ index = bla.Index();
+ std::cout << (const char *)bla << "(" << index << ")\n";
+ }
+
+ std::cout << "-----------------\n";
+
+ if (argc < 2)
+ bla = "Genesis 1:5";
+ else bla = argv[1];
+
+ for (loop = max; loop; loop--, bla--) {
+ index = bla.Index();
+ std::cout << (const char *)bla << "(" << index << ")\n";
+ }
+
+ std::cout << "-----------------\n";
+
+ if (argc < 2)
+ bla = "Malachi 4:2";
+ else bla = argv[1];
+
+ for (loop = max; loop; loop--, bla++) {
+ index = bla.Index();
+ std::cout << (const char *)bla << "(" << index << ")\n";
+ }
+
+ std::cout << "-----------------\n";
+
+ if (argc < 2)
+ bla = "Revelation of John 22:17";
+ else bla = argv[1];
+
+ for (loop = max; loop; loop--, bla++) {
+ index = bla.Index();
+ std::cout << (const char *)bla << "(" << index << ")\n";
+ }
+
+
+ std::cout << "-----------------\n";
+ std::cout << "-------- Headings ---------\n";
+
+ bla.Headings(1);
+
+ if (argc < 2)
+ bla = "Matthew 1:5";
+ else bla = argv[1];
+
+ for (loop = max; loop; loop--, bla--) {
+ index = bla.Index();
+ std::cout << (const char *)bla << "(" << index << ")\n";
+ }
+
+ std::cout << "-----------------\n";
+
+ if (argc < 2)
+ bla = "Genesis 1:5";
+ else bla = argv[1];
+
+ for (loop = max; loop; loop--, bla--) {
+ index = bla.Index();
+ std::cout << (const char *)bla << "(" << index << ")\n";
+ }
+
+ std::cout << "-----------------\n";
+
+ if (argc < 2)
+ bla = "Malachi 4:2";
+ else bla = argv[1];
+
+ for (loop = max; loop; loop--, bla++) {
+ index = bla.Index();
+ std::cout << (const char *)bla << "(" << index << ")\n";
+ }
+
+ std::cout << "-----------------\n";
+
+ if (argc < 2)
+ bla = "Revelation of John 22:17";
+ else bla = argv[1];
+
+ for (loop = max; loop; loop--, bla++) {
+ index = bla.Index();
+ std::cout << (const char *)bla << "(" << index << ")\n";
+ }
+
+ std::cout << "\n\n";
+
+ std::cout << "-------- Error Check ------------\n\n";
+ bla = "Revelation of John 23:19";
+ std::cout << "bla = \"Revelation of John 23:19\"\n";
+ std::cout << "(const char *)bla = " << (const char *)bla << "\n";
+ std::cout << "bla.Error() = " << (int)bla.Error() << " \n";
+ std::cout << "bla++ \n";
+ bla++;
+ std::cout << "bla.Error() = " << (int)bla.Error() << " \n";
+
+ bla.Headings(0);
+ for (bla = BOTTOM; !bla.Error(); bla.Book(bla.Book()-1))
+ std::cout << (const char *)bla << "\n";
+ bla.Testament(1);
+ bla = BOTTOM;
+ std::cout << bla.Index() << "\n";
+ std::cout << bla.NewIndex() << "\n";
+ std::cout << bla << "\n";
+ bla.Testament(2);
+ bla = BOTTOM;
+ std::cout << bla.Index() << "\n";
+ std::cout << bla.NewIndex() << "\n";
+ std::cout << bla << "\n";
+ return 0;
+}
diff --git a/tests/lextest.cpp b/tests/lextest.cpp
new file mode 100644
index 0000000..9119a2a
--- /dev/null
+++ b/tests/lextest.cpp
@@ -0,0 +1,26 @@
+#include <iostream>
+#include <rawld.h>
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+int main(int argc, char **argv)
+{
+ RawLD::createModule("tmp/lextest");
+ RawLD lex("tmp/lextest");
+
+ lex.setKey("b");
+ lex << "x";
+
+ lex.setKey("a");
+ lex << "x";
+
+ lex.setKey("a");
+ lex.deleteEntry();
+
+// lex.setKey("a");
+// lex << "y";
+
+ lex = BOTTOM;
+ return 0;
+}
diff --git a/tests/listtest.cpp b/tests/listtest.cpp
new file mode 100644
index 0000000..fa94dcf
--- /dev/null
+++ b/tests/listtest.cpp
@@ -0,0 +1,73 @@
+#include <stdio.h>
+#include <iostream>
+#include <stdlib.h>
+#include <listkey.h>
+#include <versekey.h>
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+int main(int argc, char **argv)
+{
+ ListKey lk, lk2;
+ VerseKey vk("jn 1:1", "jn 1:12");
+ VerseKey vk2("jude", "jude");
+ SWKey text;
+
+ vk = "jas 1:19";
+ text = (const char *)vk;
+ lk << text;
+ lk << text;
+ lk << text;
+ lk << "James 1:19";
+ lk << "yoyo";
+ lk << vk;
+ lk2 << "test1";
+ lk2 << lk;
+ lk2 << vk2;
+ lk2 << "test2";
+ for (lk2 = TOP; !lk2.Error(); lk2++)
+ std::cout << (const char *) lk2 << "\n";
+
+
+ lk2 = VerseKey().ParseVerseList("mat-mark", 0, true);
+
+ VerseKey yoyo("john");
+ yoyo = MAXCHAPTER;
+ std::cout << yoyo;
+/*
+
+ for (int i = 0; i < 2; i++) {
+ VerseKey x, y;
+ ListKey lk3;
+ x = "rev";
+ y = x;
+ x = "mat";
+ VerseKey newElement;
+ newElement.LowerBound(x);
+ newElement.UpperBound(y);
+ lk3 << newElement;
+
+ lk2 << lk3;
+ }
+
+*/
+ std::cout << "---------\n";
+
+ for (lk2 = TOP; !lk2.Error(); lk2++)
+ std::cout << (const char *) lk2 << "\n";
+
+ lk.ClearList();
+ lk << "john 3:16";
+ std::cout << "\nCount should be 1: " << lk.Count();
+
+ lk = vk.ParseVerseList("mat;mark;luke", vk, true);
+ lk = (VerseKey)"john 3:16";
+ std::cout << "\nError should be set: " << ((lk.Error()) ? "set":"not set");
+ lk = vk.ParseVerseList("mk 3:16", vk, true);
+ lk = (VerseKey)"john 3:16";
+ std::cout << "\nError should be set: " << ((lk.Error()) ? "set":"not set");
+
+ std::cout << "\n\n";
+ return 0;
+}
diff --git a/tests/localetest.cpp b/tests/localetest.cpp
new file mode 100644
index 0000000..895e67e
--- /dev/null
+++ b/tests/localetest.cpp
@@ -0,0 +1,33 @@
+#include <localemgr.h>
+#include <versekey.h>
+#include <iostream>
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+int main(int argc, char **argv) {
+ if (argc != 3) {
+ fprintf(stderr, "usage: %s <locale_name> <text>\n", *argv);
+ exit(-1);
+ }
+
+ LocaleMgr lm;
+
+ printf("%s\n", lm.translate(argv[1], argv[2]));
+
+ VerseKey bla;
+ bla = "James 1:19";
+
+ bla.setLocale("de");
+ std::cout << bla << std::endl;
+ bla = "Johannes 1:1";
+ std::cout << bla << std::endl;
+
+ LocaleMgr::getSystemLocaleMgr()->setDefaultLocaleName("de");
+ VerseKey key2;
+ key2.setLocale("en");
+ ListKey list = key2.ParseVerseList("Luke 3:23-28",key2, true);
+ std::cout << list << std::endl;
+
+
+}
diff --git a/tests/mgrtest.cpp b/tests/mgrtest.cpp
new file mode 100644
index 0000000..d1bce20
--- /dev/null
+++ b/tests/mgrtest.cpp
@@ -0,0 +1,44 @@
+#include <swmgr.h>
+#include <swlog.h>
+#include <iostream>
+#include <versekey.h>
+#include <swmodule.h>
+#include <swconfig.h>
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+int main(int argc, char **argv) {
+ std::cerr << "\n";
+ SWLog::getSystemLog()->setLogLevel(SWLog::LOG_DEBUG);
+ SWConfig *sysConf = 0;
+ if (argc > 1) {
+ sysConf = new SWConfig(argv[1]);
+ }
+ SWMgr mymgr(0, sysConf);
+ std::cerr << "\n\nprefixPath: " << mymgr.prefixPath;
+ std::cerr << "\nconfigPath: " << mymgr.configPath << "\n\n";
+
+
+ ModMap::iterator it;
+
+ for (it = mymgr.Modules.begin(); it != mymgr.Modules.end(); it++) {
+ std::cout << "[" << (*it).second->Name() << "] (Writable: " << (it->second->isWritable()?"Yes":"No") << ") [" << (*it).second->Description() << "]\n";
+ std::cout << "AbsoluteDataPath = " << it->second->getConfigEntry("AbsoluteDataPath") << "\n";
+ std::cout << "Has Feature HebrewDef = " << it->second->getConfig().has("Feature", "HebrewDef") << "\n";
+ if ((!strcmp((*it).second->Type(), "Biblical Texts")) || (!strcmp((*it).second->Type(), "Commentaries"))) {
+ it->second->setKey("James 1:19");
+ std::cout << (const char *) *(*it).second << "\n\n";
+ }
+ }
+ SWModule *mhc = mymgr.Modules["MHC"];
+ if (mhc) {
+ for (mhc->Key("Gen 1:1"); mhc->Key() < (VerseKey) "Gen 1:10"; (*mhc)++)
+ std::cout << (const char *) *mhc << "\n";
+ }
+
+ if (sysConf)
+ delete sysConf;
+
+ return 0;
+}
diff --git a/tests/modtest.cpp b/tests/modtest.cpp
new file mode 100644
index 0000000..889d780
--- /dev/null
+++ b/tests/modtest.cpp
@@ -0,0 +1,21 @@
+#include <swmgr.h>
+#include <swtext.h>
+#include <versekey.h>
+#include <iostream>
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+int main(int argc, char **argv) {
+ SWMgr mymgr;
+ ModMap::iterator it;
+ SWModule *module = mymgr.Modules["KJV"];
+ VerseKey parser;
+ ListKey lk = parser.ParseVerseList("mal4:6-rev", parser, true);
+ lk.Persist(1);
+ module->SetKey(lk);
+
+ (*module) = TOP;
+ std::cout << module->KeyText() << "\n";
+ return 0;
+}
diff --git a/tests/outputcps.cpp b/tests/outputcps.cpp
new file mode 100644
index 0000000..32d618d
--- /dev/null
+++ b/tests/outputcps.cpp
@@ -0,0 +1,59 @@
+#include <stdio.h>
+#include <versekey.h>
+
+/*
+This program requires versekey.h to be changed locally so that
+otbks, otcps, ntbks and ntcps are public
+*/
+
+using namespace sword;
+
+int
+main(int argc, char *argv[])
+{
+ int i;
+ long offset1, offset2, otoffset;
+ int *vmaxarray;
+ int vmax;
+ sword::VerseKey *tk = new sword::VerseKey("Genesis 0:0");
+
+ //tk->Testament(1);
+ //tk->Book(1);
+ //tk->Chapter(0);
+ //tk->Verse(0);
+ //printf("bcv %d %d:%d\n", tk->Book(), tk->Chapter(), tk->Verse());
+ printf("{0, 0}, // Module Header\n");
+ printf("{1, 0}, // OT Header\n");
+ while (tk->Testament() == 1)
+ {
+ offset1 = tk->otbks[tk->Book()];
+ if (tk->Chapter() == 1) {
+ offset2 = tk->otcps[(int)offset1];
+ printf("{%d, 0}, // %s:0\n", offset2, tk->getBookName());
+ }
+ offset2 = tk->otcps[(int)offset1 + tk->Chapter()];
+ vmaxarray = tk->builtin_books[tk->Testament()-1][tk->Book()-1].versemax;
+ vmax = vmaxarray[tk->Chapter()-1];
+
+ printf("{%d, %d}, // %s:%d\n", offset2, vmax, tk->getBookName(), tk->Chapter());
+ tk->Chapter(tk->Chapter()+1);
+ otoffset = offset2+vmax+1;
+ }
+ printf("{%d, 0}, // NT Header\n", otoffset);
+ while (!tk->Error())
+ {
+ offset1 = tk->ntbks[tk->Book()];
+ if (tk->Chapter() == 1) {
+ offset2 = tk->ntcps[(int)offset1]+otoffset;
+ printf("{%d, 0}, // %s:0\n", offset2-1, tk->getBookName());
+ }
+ offset2 = tk->ntcps[(int)offset1 + tk->Chapter()] + otoffset;
+ vmaxarray = tk->builtin_books[tk->Testament()-1][tk->Book()-1].versemax;
+ vmax = vmaxarray[tk->Chapter()-1];
+
+ printf("{%d, %d}, // %s:%d\n", offset2-1, vmax, tk->getBookName(), tk->Chapter());
+ tk->Chapter(tk->Chapter()+1);
+ }
+ delete tk;
+ return 0;
+}
diff --git a/tests/parsekey.cpp b/tests/parsekey.cpp
new file mode 100644
index 0000000..16b97c0
--- /dev/null
+++ b/tests/parsekey.cpp
@@ -0,0 +1,43 @@
+#include <iostream>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <versekey.h>
+#include <localemgr.h>
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+int main(int argc, char **argv) {
+ if ((argc < 2) || (argc > 4)) {
+ fprintf(stderr, "usage: %s <\"string to parse\"> [locale name] [test-in-set-verse]\n", *argv);
+ exit(-1);
+ }
+
+ if (argc > 2)
+ LocaleMgr::getSystemLocaleMgr()->setDefaultLocaleName(argv[2]);
+
+ VerseKey DefaultVSKey;
+
+ DefaultVSKey = "jas3:1";
+
+ ListKey verses = DefaultVSKey.ParseVerseList(argv[1], DefaultVSKey, true);
+
+ for (int i = 0; i < verses.Count(); i++) {
+ VerseKey *element = SWDYNAMIC_CAST(VerseKey, verses.GetElement(i));
+ if (element) {
+ std::cout << (SWBuf(element->LowerBound()) + " - " + SWBuf(element->UpperBound())).c_str() << "\n";
+ }
+ else std::cout << (const char *)*verses.GetElement(i) << "\n";
+// else {
+// std::cout << VerseKey(verses.GetElement(i)).getOSISRef() << "\n";
+// }
+ }
+
+ if (argc > 3) {
+ verses.setText(argv[3]);
+ std::cout << "Verse is" << ((verses.Error()) ? " NOT" : "") << " in set.\n\n";
+ }
+
+ return 0;
+}
diff --git a/tests/rawldidxtest.cpp b/tests/rawldidxtest.cpp
new file mode 100644
index 0000000..bc874dd
--- /dev/null
+++ b/tests/rawldidxtest.cpp
@@ -0,0 +1,49 @@
+#include <iostream>
+#include <rawstr.h>
+#include <swmgr.h>
+#include <filemgr.h>
+
+#ifndef __GNUC__
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+int main(int argc, char **argv)
+{
+ if (argc != 2) {
+ fprintf(stderr, "usage: %s <lex path>\n\n", *argv);
+ exit(-1);
+ }
+
+ RawStr mod(argv[1]);
+ char buf[127];
+
+ sprintf(buf, "%s.idx", argv[1]);
+ FileDesc *idxfd = FileMgr::getSystemFileMgr()->open(buf, FileMgr::RDONLY, true);
+ long maxoff = idxfd->seek(0, SEEK_END) - 6;
+ FileMgr::getSystemFileMgr()->close(idxfd);
+
+ SWBuf last = "";
+ bool first = true;
+ char *trybuf = 0;
+ for (long index = 0; index < maxoff; index+=6) {
+ mod.getIDXBuf(index, &trybuf);
+ if (!first) {
+ if (strcmp(trybuf, last.c_str()) < 0) {
+ printf("entry %ld(offset: %ld) (%s) is less than previous entry (%s)\n\n", index/6, index, trybuf, last.c_str());
+ exit(-3);
+ }
+ }
+ else first = false;
+ last = trybuf;
+ }
+ if (trybuf)
+ delete [] trybuf;
+
+ return 0;
+}
diff --git a/tests/refsystest.cpp b/tests/refsystest.cpp
new file mode 100644
index 0000000..003ba7b
--- /dev/null
+++ b/tests/refsystest.cpp
@@ -0,0 +1,29 @@
+#include <stdio.h>
+#include <iostream>
+#include <versekey2.h>
+#include <stdlib.h>
+
+#include <refsysmgr.h>
+
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+using std::cout;
+using std::endl;
+
+int main(int argc, char **argv)
+{
+ cout << "Default refsys: " <<
+ RefSysMgr::getSystemRefSysMgr()->getDefaultRefSysName() << endl;
+ StringList tlist = RefSysMgr::getSystemRefSysMgr()->getAvailableRefSys();
+ for (StringList::const_iterator it = tlist.begin(); it != tlist.end(); it++) {
+ cout << (*it).c_str() << endl;
+ }
+ VerseKey2 *testkey;
+ testkey = RefSysMgr::getSystemRefSysMgr()->getVerseKey("WEB", "Judith 1:1");
+ //testkey = RefSysMgr::getSystemRefSysMgr()->getVerseKey("KJV", "John 3:16");
+ if (testkey)
+ cout << testkey->getText() << endl;
+ else
+ cout << "Failed to get key" << endl;
+}
diff --git a/tests/romantest.cpp b/tests/romantest.cpp
new file mode 100644
index 0000000..3af0ae1
--- /dev/null
+++ b/tests/romantest.cpp
@@ -0,0 +1,26 @@
+#include <iostream>
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <roman.h>
+
+#ifndef NO_SWORD_NAMESPACE
+using sword::from_rom;
+#endif
+
+int main(int argc, char **argv) {
+ if (argc != 2) {
+ fprintf(stderr, "usage: %s <roman_numeral>\n", *argv);
+ exit(-1);
+ }
+ /* I don't think we need to_rom, do we? anyway, it isn't written
+ char buf[127];
+ if (isdigit(argv[1][0])) {
+ to_rom(atoi(argv[1]), buf);
+ std::cout << buf << std::endl;
+ }
+ */
+ else std::cout << from_rom(argv[1]) << std::endl;
+ return 0;
+}
+
diff --git a/tests/swaptest.cpp b/tests/swaptest.cpp
new file mode 100644
index 0000000..2dc8daa
--- /dev/null
+++ b/tests/swaptest.cpp
@@ -0,0 +1,9 @@
+#include <sysdata.h>
+#include <stdio.h>
+
+int main(int argc, char **argv) {
+ printf("0x%.4x 0x%.4x\n", 255, __swap16(255));
+ printf("0x%.8x 0x%.8x\n", 255, __swap32(255));
+// printf("0x%.16x 0x%.16llx\n", 255, __swap64(255));
+ return 0;
+}
diff --git a/tests/swbuftest.cpp b/tests/swbuftest.cpp
new file mode 100644
index 0000000..92c43db
--- /dev/null
+++ b/tests/swbuftest.cpp
@@ -0,0 +1,159 @@
+#include <time.h>
+#include <iostream>
+
+#define BASEI 102400000L
+
+#include <swbuf.h>
+typedef sword::SWBuf StringType;
+
+//#include <string>
+//typedef std::string StringType;
+
+using std::cout;
+using std::cerr;
+
+void markTime() {
+ static clock_t start = clock();
+ static clock_t last = start;
+ clock_t current = clock();
+ cerr << ((float)(current - last)/CLOCKS_PER_SEC) << " / " << ((float)(current - start)/CLOCKS_PER_SEC) << " (Seconds Delta / Seconds Total)\n";
+ cerr.flush();
+ last = current;
+}
+
+void appendChTest() {
+ cerr << "\nSTART: append ch test -------\n";
+ cerr.flush();
+ StringType s;
+ for (unsigned long i = 0; i < BASEI+14; i++) {
+ s += (char) (i%125)+1;
+ }
+ cerr << "\nEND: append ch test -------\n";
+ cerr.flush();
+}
+
+
+void appendStringTest() {
+ cerr << "\nSTART: append string test -------\n";
+ cerr.flush();
+ StringType s;
+ unsigned long iterations = BASEI/2L;
+ for (unsigned long i = 0; i < iterations; i++) {
+ s.append("this is a test", 3);
+ if (!(i%3))s.append("test");
+ }
+ cerr << "\nEND: append string test -------\n";
+ cerr.flush();
+}
+
+
+void subscriptTest() {
+ cerr << "\nSTART: subscript access test -------\n";
+ cerr.flush();
+ StringType s;
+ for (int j = 0; j < 100; j++) {
+ s += "0123456789";
+ }
+ for (int j = 0; j < BASEI/200; j++) {
+ for (unsigned long i = s.length()-1; i; i--) {
+ s[i] = (char) (i%40)+65;
+ }
+ }
+ cerr << "\nEND: subscript access test -------\n";
+ cerr.flush();
+}
+
+void ctorAssignTest() {
+ cerr << "\nSTART: constructor and assign test -------\n";
+ cerr.flush();
+ StringType s;
+ for (int j = 0; j < 100; j++) {
+ s += "0123456789";
+ }
+ for (unsigned long i = (BASEI/8); i; i--) {
+ StringType s2;
+ s2 = s;
+ s2[0] = '0'; // keep defeat copy on write optimizations
+ }
+ cerr << "\nEND: constructor and assign test -------\n";
+ cerr.flush();
+}
+
+void compareTest() {
+ cerr << "\nSTART: compare test -------\n";
+ cerr.flush();
+ StringType first = "firsttestAfirst";
+ StringType second = "firsttestBsecond";
+ for (unsigned long i = (unsigned long)(BASEI/1.5); i; i--) {
+ if (first != second) {
+ if (first <= second) {
+ if (first > second) {;}
+ else if (!(BASEI%10000)) {
+ first[0] = 'f'; // keep us from being optimized out
+ }
+ }
+ }
+ }
+ cerr << "\nEND: compare test -------\n";
+ cerr.flush();
+}
+
+
+void insertStringTest() {
+ cerr << "\nSTART: insert string test -------\n";
+ cerr.flush();
+ StringType s;
+ StringType sub = "text ->this part should not appear :)";
+ for (int j = 0; j < BASEI/7000; j++) {
+ s = "Start end";
+ for (int i = 0; i < 1000; i++) {
+ s.insert(s.length()/2, sub, 0, 5);
+ }
+ }
+ cerr << "\nEND: insert string test -------\n";
+ cerr.flush();
+}
+
+int main(int argc, char **argv) {
+ StringType x;
+ cout << "x should be (): (" << x << ")\n";
+ cout << "size should be 0: " << x.size() << "\n";
+ x = "hello";
+ cout << "x should be (hello): (" << x << ")\n";
+ x += " world";
+ cout << "x should be (hello world): (" << x << ")\n";
+ cout << "size should be 11: " << x.size() << "\n";
+ cout << "x[7] should be 'o': '" << x[7] << "'\n";
+ x[7] = 'u';
+ cout << "x[7] should be 'u': '" << x[7] << "'\n";
+ cout << "x should be (hello wurld): (" << x << ")\n";
+ StringType y = x + " " + x;
+ cout << "should be (hello wurld hello wurld): (" << y << ")\n";
+
+ sword::SWBuf prefixTest = "prefix:value";
+ cout << "Prefix test: " << prefixTest << "\n";
+ cout << "Prefix should be (prefix): " << prefixTest.stripPrefix(':') << "\n";
+ cout << "Value should be (value): " << prefixTest << "\n";
+
+// y.appendFormatted(" from %d %s running %02.05f miles", 4, "dogs", 1.9f);
+// cout << "should be (hello wurld hello wurld from 4 dogs running 1.90000 miles): (" << y << ")\n";
+// y += '!';
+// cout << "should be (hello wurld hello wurld from 4 dogs running 1.90000 miles!): (" << y << ")\n";
+// y.append(y.c_str(),5);
+// cout << "should be (hello wurld hello wurld from 4 dogs running 1.90000 miles!hello): (" << y << ")\n";
+
+ markTime();
+ appendChTest();
+ markTime();
+ appendStringTest();
+ markTime();
+ subscriptTest();
+ markTime();
+ ctorAssignTest();
+ markTime();
+ compareTest();
+ markTime();
+ insertStringTest();
+ markTime();
+}
+
diff --git a/tests/testblocks.cpp b/tests/testblocks.cpp
new file mode 100644
index 0000000..f386118
--- /dev/null
+++ b/tests/testblocks.cpp
@@ -0,0 +1,89 @@
+#include <entriesblk.h>
+#include <iostream>
+#include <string>
+#include <stdio.h>
+#include <stdlib.h>
+
+using namespace std;
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+void addEntry(EntriesBlock *eb) {
+ string input;
+ string body;
+ char line[1024];
+ std::cout << "\nEnter new Entry's text. '.' on an empty line to finish:\n";
+ do {
+ std::cout << "> ";
+ fgets(line, 1000, stdin);
+ input = line;
+ if (input.compare("."))
+ body.append(input);
+ }
+ while (input.compare("."));
+ std::cout << "Adding new entry. Index is: " << eb->addEntry(body.c_str()) << "\n\n";
+}
+
+
+void printEntry(EntriesBlock *eb, int index) {
+ if (index < eb->getCount()) {
+ std::cout << "Contents of entry [" << index << "]:\n";
+ std::cout << eb->getEntry(index) << "\n";
+ }
+ else std::cout << "Invalid entry number\n\n";
+}
+
+
+void printSize(EntriesBlock *eb) {
+ unsigned long size;
+ eb->getRawData(&size);
+ std::cout << "Size of raw data: " << size << "\n\n";
+}
+
+
+void removeEntry(EntriesBlock *eb, int index) {
+ if (index < eb->getCount()) {
+ std::cout << "Removing entry [" << index << "]\n";
+ eb->removeEntry(index);
+ }
+ else std::cout << "Invalid entry number\n\n";
+}
+
+
+int main(int argc, char **argv) {
+
+ EntriesBlock *eb = new EntriesBlock();
+ string input;
+ char line[1024];
+
+ std::cout << "Initial entry count should be 0: " << eb->getCount() << "\n";
+
+ do {
+ std::cout << "[" << eb->getCount() << "] > ";
+ fgets(line, 1000, stdin);
+ input = line;
+ if (input.length() > 0) {
+ switch (input[0]) {
+ case 'a': addEntry(eb); break;
+ case 'p': printEntry(eb, atoi(input.c_str()+1)); break;
+ case 'r': removeEntry(eb, atoi(input.c_str()+1)); break;
+ case 's': printSize(eb); break;
+ case 'q': break;
+ case '?':
+ default:
+ std::cout << "\n a - add a new entry\n";
+ std::cout << " p <entry_index> - print entry\n";
+ std::cout << " r <entry_index> - remove entry\n";
+ std::cout << " s - print size of raw data\n";
+ std::cout << " q - quit\n\n";
+ break;
+ }
+ }
+ }
+ while (input.compare("q"));
+
+ delete eb;
+
+ return 0;
+}
diff --git a/tests/testsuite/.cvsignore b/tests/testsuite/.cvsignore
new file mode 100644
index 0000000..171f236
--- /dev/null
+++ b/tests/testsuite/.cvsignore
@@ -0,0 +1 @@
+verseparsing.try \ No newline at end of file
diff --git a/tests/testsuite/Makefile.am b/tests/testsuite/Makefile.am
new file mode 100644
index 0000000..db26c79
--- /dev/null
+++ b/tests/testsuite/Makefile.am
@@ -0,0 +1,6 @@
+swtspdir = $(top_srcdir)/tests/testsuite
+
+EXTRA_DIST += $(swtspdir)/runall.sh
+EXTRA_DIST += $(swtspdir)/runtest.sh
+EXTRA_DIST += $(swtspdir)/verseparsing.good
+EXTRA_DIST += $(swtspdir)/verseparsing.sh
diff --git a/tests/testsuite/runall.sh b/tests/testsuite/runall.sh
new file mode 100755
index 0000000..d06e606
--- /dev/null
+++ b/tests/testsuite/runall.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+TESTSUITE=`for i in *.good; do basename $i .good; done`
+
+for i in $TESTSUITE; do
+ echo -n "$i: "
+ ./runtest.sh $i -q
+ if [ $? -ne 0 ]; then
+ echo FAILED
+ echo ""
+ echo To see problems, try running:
+ echo ./runtest.sh $i
+ echo ""
+ exit 1
+ else
+ echo PASSED.
+ fi
+done
+echo "ALL PASSED!"
+exit 0
+fi
diff --git a/tests/testsuite/runtest.sh b/tests/testsuite/runtest.sh
new file mode 100755
index 0000000..d8ebee1
--- /dev/null
+++ b/tests/testsuite/runtest.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+if [ "$1" = "" ]; then
+ echo usage: $0 "<test_to_run (no .sh)>"
+ exit 1
+fi
+
+./$1.sh > $1.try
+BAD=`diff -u $1.try $1.good`
+if [ "$BAD" = "" ]; then
+ if [ "$2" = "-q" ]; then
+ exit 0
+ else
+ echo PASSED!
+ fi
+ exit 0
+else
+ if [ "$2" = "-q" ]; then
+ exit 1
+ else
+ echo "Script failed at: (- bad output; + should have been)"
+ diff -u $1.try $1.good
+ fi
+ exit 1
+fi
diff --git a/tests/testsuite/versekey.good b/tests/testsuite/versekey.good
new file mode 100644
index 0000000..afb0ab9
--- /dev/null
+++ b/tests/testsuite/versekey.good
@@ -0,0 +1,5 @@
+x: Amos 1:5
+Amos 1:5
+Amos 1:5
+Error: 1
+Error: 1
diff --git a/tests/testsuite/versekey.sh b/tests/testsuite/versekey.sh
new file mode 100755
index 0000000..aeefcc9
--- /dev/null
+++ b/tests/testsuite/versekey.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+../versekeytest
diff --git a/tests/testsuite/verseparsing-utf8.good b/tests/testsuite/verseparsing-utf8.good
new file mode 100644
index 0000000..2259a56
--- /dev/null
+++ b/tests/testsuite/verseparsing-utf8.good
@@ -0,0 +1,16 @@
+Matthäus 2:3 - Matthäus 2:12
+Römer 2:13
+Matthäus 1:2 - Römer 3:13
+1. Könige 2:1 - 1. Könige 2:46
+1. Könige 1:1 - 2. Könige 25:30
+Markus 1:1
+Matthäus 2:1
+Matthäus 1:1 - Matthäus 28:20
+1. Könige 1:1 - 1. Könige 22:53
+1. Könige 1:1 - 2. Könige 25:30
+Markus 1:1
+Matthäus 2:1
+Matthäus 1:1 - Matthäus 28:20
+1. Könige 1:1 - 2. Könige 25:30
+1. Könige 1:1 - Matthäus 28:20
+Maleachi 1:1 - Matthäus 2:1
diff --git a/tests/testsuite/verseparsing-utf8.sh b/tests/testsuite/verseparsing-utf8.sh
new file mode 100755
index 0000000..9ab509e
--- /dev/null
+++ b/tests/testsuite/verseparsing-utf8.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+# This only works if --with-icu was passed to configure
+
+### German test keys
+../parsekey "Matthäus 2:3-12" "de"
+../parsekey "Römer 2:13" "de"
+../parsekey "Matthäus 1:2-Röm 3:13" "de"
+../parsekey "1. Könige 2" "de"
+
+../parsekey "1. Könige - 2. Könige; Markus 1:1; Matthäus 2:1; Matthäus; 1.Kön" "de"
+../parsekey "1. Könige - 2. Könige; Markus 1:1; Matthäus 2:1; Matthäus; 1.Kön-2.Kön;I Kings-Matthäus" "de"
+../parsekey "Maleachi 1:1 - Matthäus 2:1" "de"
diff --git a/tests/testsuite/verseparsing.good b/tests/testsuite/verseparsing.good
new file mode 100644
index 0000000..dd001eb
--- /dev/null
+++ b/tests/testsuite/verseparsing.good
@@ -0,0 +1,65 @@
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+I John 2:3
+1. Johannes 2:3
+1. Johannes 1:1 - 1. Johannes 3:10
+1. Johannes 1:1 - 1. Johannes 3:10
+I John 1:1 - I John 3:10
+1. Johannes 1:1 - 1. Johannes 3:10
+1. Johannes 1:1 - 1. Johannes 3:10
+I John 1:1 - I John 3:10
+1. Johannes 1:1 - 1. Johannes 3:10
+1. Johannes 1:1 - 1. Johannes 3:10
+I John 1:1 - I John 3:10
+1. Johannes 1:1 - 1. Johannes 3:10
+1. Johannes 1:1 - 1. Johannes 3:10
+I John 1:1 - I John 3:10
+I John 1:1
+I John 3:10
+I John 1:1
+I John 3:10
+I John 1:1
+I John 3:10
+I John 1:1
+I John 3:10
+I John 1:1
+I John 3:10
+I John 1:1
+I John 3:10
+I John 1:1
+I John 3:10
+I John 1:1
+I John 3:10
+I John 1:1
+I John 3:10
+I John 1:1
+I John 3:10
diff --git a/tests/testsuite/verseparsing.sh b/tests/testsuite/verseparsing.sh
new file mode 100755
index 0000000..889889e
--- /dev/null
+++ b/tests/testsuite/verseparsing.sh
@@ -0,0 +1,64 @@
+#!/bin/sh
+
+../parsekey "1jn.2.3"
+../parsekey "1 jn.2.3"
+../parsekey "Ijn.2.3"
+../parsekey "I jn.2.3"
+../parsekey "1jn 2.3"
+../parsekey "1 jn 2.3"
+../parsekey "Ijn 2.3"
+../parsekey "I jn 2.3"
+../parsekey "1jn.2:3"
+../parsekey "1 jn.2:3"
+../parsekey "Ijn.2:3"
+../parsekey "I jn.2:3"
+../parsekey "1jn 2:3"
+../parsekey "1 jn 2:3"
+../parsekey "Ijn 2:3"
+../parsekey "I jn 2:3"
+
+../parsekey "1.jn.2.3"
+../parsekey "1. jn.2.3"
+../parsekey "I.jn.2.3"
+../parsekey "I. jn.2.3"
+../parsekey "1.jn 2.3"
+../parsekey "1. jn 2.3"
+../parsekey "I.jn 2.3"
+../parsekey "I. jn 2.3"
+../parsekey "1.jn.2:3"
+../parsekey "1. jn.2:3"
+../parsekey "I.jn.2:3"
+../parsekey "I. jn.2:3"
+../parsekey "1.jn 2:3"
+../parsekey "1. jn 2:3"
+../parsekey "I.jn 2:3"
+../parsekey "I. jn 2:3"
+
+### German test keys
+../parsekey "1. Johannes 2:3" "de"
+
+### Range parsing tests
+../parsekey "1. Johannes 1:1-3:10" "de"
+../parsekey "1. Joh 1:1-3:10" "de"
+../parsekey "1Jn 1:1-3:10"
+../parsekey "1. Johannes 1:1 - 3:10" "de"
+../parsekey "1. Joh 1:1 - 3:10" "de"
+../parsekey "1Jn 1:1 - 3:10"
+../parsekey "1. Johannes 1:1 -3:10" "de"
+../parsekey "1. Joh 1:1 -3:10" "de"
+../parsekey "1Jn 1:1 -3:10"
+../parsekey "1. Johannes 1:1- 3:10" "de"
+../parsekey "1. Joh 1:1- 3:10" "de"
+../parsekey "1Jn 1:1- 3:10"
+
+### List parsing tests
+../parsekey "1Jn 1:1 3:10"
+../parsekey "1Jn 1:1 3:10"
+../parsekey "1Jn 1:1,3:10"
+../parsekey "1Jn 1:1, 3:10"
+../parsekey "1Jn 1:1 ,3:10"
+../parsekey "1Jn 1:1 , 3:10"
+../parsekey "1Jn 1:1;3:10"
+../parsekey "1Jn 1:1; 3:10"
+../parsekey "1Jn 1:1 ;3:10"
+../parsekey "1Jn 1:1 ; 3:10"
diff --git a/tests/testsuite/xmltag.good b/tests/testsuite/xmltag.good
new file mode 100644
index 0000000..a14c5d1
--- /dev/null
+++ b/tests/testsuite/xmltag.good
@@ -0,0 +1,136 @@
+<verse osisID="John.1.1" type='test type' yeah = "stuff" />
+<verse osisID="John.1.1" type="test type" yeah="stuff"/>
+<verse addedAttribute='with a " quote' osisID="John.1.1" type="test type" yeah="stuff"/>
+Tag name: [verse]
+ - attribute: [addedAttribute] = [with a " quote]
+ 4 parts:
+ with
+ a
+ "
+ quote
+ - attribute: [osisID] = [John.1.1]
+ 1 parts:
+ John.1.1
+ - attribute: [type] = [test type]
+ 2 parts:
+ test
+ type
+ - attribute: [yeah] = [stuff]
+ 1 parts:
+ stuff
+ isEmpty: 1
+ isEndTag: 0
+
+Setting attribute 'multiPart' to: 'ABC D EF GHIJ'
+<verse addedAttribute='with a " quote' multiPart="ABC D EF GHIJ" osisID="John.1.1" type="test type" yeah="stuff"/>
+Setting part 2 to 'MMM'
+<verse addedAttribute='with a " quote' multiPart="ABC D MMM GHIJ" osisID="John.1.1" type="test type" yeah="stuff"/>
+Removing part 1
+<verse addedAttribute='with a " quote' multiPart="ABC MMM GHIJ" osisID="John.1.1" type="test type" yeah="stuff"/>
+Removing part 2
+<verse addedAttribute='with a " quote' multiPart="ABC MMM" osisID="John.1.1" type="test type" yeah="stuff"/>
+<yo mama='stuff' />
+<yo mama="stuff"/>
+<yo addedAttribute='with a " quote' mama="stuff"/>
+Tag name: [yo]
+ - attribute: [addedAttribute] = [with a " quote]
+ 4 parts:
+ with
+ a
+ "
+ quote
+ - attribute: [mama] = [stuff]
+ 1 parts:
+ stuff
+ isEmpty: 1
+ isEndTag: 0
+
+<yo mama='stuff'>
+<yo mama="stuff">
+<yo addedAttribute='with a " quote' mama="stuff">
+Tag name: [yo]
+ - attribute: [addedAttribute] = [with a " quote]
+ 4 parts:
+ with
+ a
+ "
+ quote
+ - attribute: [mama] = [stuff]
+ 1 parts:
+ stuff
+ isEmpty: 0
+ isEndTag: 0
+
+<yo mama = 'stuff'>
+<yo mama="stuff">
+<yo addedAttribute='with a " quote' mama="stuff">
+Tag name: [yo]
+ - attribute: [addedAttribute] = [with a " quote]
+ 4 parts:
+ with
+ a
+ "
+ quote
+ - attribute: [mama] = [stuff]
+ 1 parts:
+ stuff
+ isEmpty: 0
+ isEndTag: 0
+
+<yo mama = 'stuff' yoyoma="hohum">
+<yo mama="stuff" yoyoma="hohum">
+<yo addedAttribute='with a " quote' mama="stuff" yoyoma="hohum">
+Tag name: [yo]
+ - attribute: [addedAttribute] = [with a " quote]
+ 4 parts:
+ with
+ a
+ "
+ quote
+ - attribute: [mama] = [stuff]
+ 1 parts:
+ stuff
+ - attribute: [yoyoma] = [hohum]
+ 1 parts:
+ hohum
+ isEmpty: 0
+ isEndTag: 0
+
+yo mama = 'stuff' yoyoma="hohum"
+<yo mama="stuff" yoyoma="hohum">
+<yo addedAttribute='with a " quote' mama="stuff" yoyoma="hohum">
+Tag name: [yo]
+ - attribute: [addedAttribute] = [with a " quote]
+ 4 parts:
+ with
+ a
+ "
+ quote
+ - attribute: [mama] = [stuff]
+ 1 parts:
+ stuff
+ - attribute: [yoyoma] = [hohum]
+ 1 parts:
+ hohum
+ isEmpty: 0
+ isEndTag: 0
+
+yo mama = 'stuff' yoyoma="hohum"/
+<yo mama="stuff" yoyoma="hohum"/>
+<yo addedAttribute='with a " quote' mama="stuff" yoyoma="hohum"/>
+Tag name: [yo]
+ - attribute: [addedAttribute] = [with a " quote]
+ 4 parts:
+ with
+ a
+ "
+ quote
+ - attribute: [mama] = [stuff]
+ 1 parts:
+ stuff
+ - attribute: [yoyoma] = [hohum]
+ 1 parts:
+ hohum
+ isEmpty: 1
+ isEndTag: 0
+
diff --git a/tests/testsuite/xmltag.sh b/tests/testsuite/xmltag.sh
new file mode 100755
index 0000000..958681c
--- /dev/null
+++ b/tests/testsuite/xmltag.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Just let it run the default
+../xmltest
+
+#let's try some crazy stuff
+../xmltest "<yo mama='stuff' />"
+../xmltest "<yo mama='stuff'>"
+../xmltest "<yo mama = 'stuff'>"
+../xmltest "<yo mama = 'stuff' yoyoma=\"hohum\">"
+../xmltest "yo mama = 'stuff' yoyoma=\"hohum\""
+../xmltest "yo mama = 'stuff' yoyoma=\"hohum\"/"
diff --git a/tests/tlitmgrtest.cpp b/tests/tlitmgrtest.cpp
new file mode 100644
index 0000000..891c234
--- /dev/null
+++ b/tests/tlitmgrtest.cpp
@@ -0,0 +1,715 @@
+/*
+ * void Transliterator::initializeRegistry(void) {
+ // Lock first, check registry pointer second
+ Mutex lock(&registryMutex);
+ if (registry != 0) {
+ // We were blocked by another thread in initializeRegistry()
+ return;
+ }
+
+ UErrorCode status = U_ZERO_ERROR;
+
+ registry = new TransliteratorRegistry(status);
+ if (registry == 0 || U_FAILURE(status)) {
+ return; // out of memory, no recovery
+ }
+
+ * The following code parses the index table located in
+ * icu/data/translit_index.txt. The index is an n x 4 table
+ * that follows this format:
+ *
+ * <id>:file:<resource>:<direction>
+ * <id>:internal:<resource>:<direction>
+ * <id>:alias:<getInstanceArg>:
+ *
+ * <id> is the ID of the system transliterator being defined. These
+ * are public IDs enumerated by Transliterator.getAvailableIDs(),
+ * unless the second field is "internal".
+ *
+ * <resource> is a ResourceReader resource name. Currently these refer
+ * to file names under com/ibm/text/resources. This string is passed
+ * directly to ResourceReader, together with <encoding>.
+ *
+ * <direction> is either "FORWARD" or "REVERSE".
+ *
+ * <getInstanceArg> is a string to be passed directly to
+ * Transliterator.getInstance(). The returned Transliterator object
+ * then has its ID changed to <id> and is returned.
+ *
+ * The extra blank field on "alias" lines is to make the array square.
+ *
+ static const char translit_index[] = "translit_index";
+
+ UResourceBundle *bundle, *transIDs, *colBund;
+ bundle = ures_openDirect(0, translit_index, &status);
+ transIDs = ures_getByKey(bundle, RB_RULE_BASED_IDS, 0, &status);
+
+ int32_t row, maxRows;
+ if (U_SUCCESS(status)) {
+ maxRows = ures_getSize(transIDs);
+ for (row = 0; row < maxRows; row++) {
+ colBund = ures_getByIndex(transIDs, row, 0, &status);
+
+ if (U_SUCCESS(status) && ures_getSize(colBund) == 4) {
+ UnicodeString id = ures_getUnicodeStringByIndex(colBund, 0, &status);
+ UChar type = ures_getUnicodeStringByIndex(colBund, 1, &status).charAt(0);
+ UnicodeString resString = ures_getUnicodeStringByIndex(colBund, 2, &status);
+
+ if (U_SUCCESS(status)) {
+ switch (type) {
+ case 0x66: // 'f'
+ case 0x69: // 'i'
+ // 'file' or 'internal';
+ // row[2]=resource, row[3]=direction
+ {
+ UBool visible = (type == 0x0066 /f/);
+ UTransDirection dir =
+ (ures_getUnicodeStringByIndex(colBund, 3, &status).charAt(0) ==
+ 0x0046 /F/) ?
+ UTRANS_FORWARD : UTRANS_REVERSE;
+ registry->put(id, resString, dir, visible);
+ }
+ break;
+ case 0x61: // 'a'
+ // 'alias'; row[2]=createInstance argument
+ registry->put(id, resString, TRUE);
+ break;
+ }
+ }
+ }
+
+ ures_close(colBund);
+ }
+ }
+
+ ures_close(transIDs);
+ ures_close(bundle);
+
+ specialInverses = new Hashtable(TRUE);
+ specialInverses->setValueDeleter(uhash_deleteUnicodeString);
+ _registerSpecialInverse(NullTransliterator::SHORT_ID,
+ NullTransliterator::SHORT_ID, FALSE);
+
+ // Manually add prototypes that the system knows about to the
+ // cache. This is how new non-rule-based transliterators are
+ // added to the system.
+
+ registry->put(new NullTransliterator(), TRUE);
+ registry->put(new LowercaseTransliterator(), TRUE);
+ registry->put(new UppercaseTransliterator(), TRUE);
+ registry->put(new TitlecaseTransliterator(), TRUE);
+ _registerSpecialInverse("Upper", "Lower", TRUE);
+ _registerSpecialInverse("Title", "Lower", FALSE);
+ registry->put(new UnicodeNameTransliterator(), TRUE);
+ registry->put(new NameUnicodeTransliterator(), TRUE);
+ RemoveTransliterator::registerIDs();
+ EscapeTransliterator::registerIDs();
+ UnescapeTransliterator::registerIDs();
+ NormalizationTransliterator::registerIDs();
+ ucln_i18n_registerCleanup();
+}
+*/
+
+
+/*Transliterator* TransliteratorRegistry::instantiateEntry(const UnicodeString& ID,
+ Entry *entry,
+ TransliteratorAlias* &aliasReturn,
+ UParseError& parseError,
+ UErrorCode& status) {
+
+ for (;;) {
+ if (entry->entryType == Entry::RBT_DATA) {
+ return new RuleBasedTransliterator(ID, entry->u.data);
+ } else if (entry->entryType == Entry::PROTOTYPE) {
+ return entry->u.prototype->clone();
+ } else if (entry->entryType == Entry::ALIAS) {
+ aliasReturn = new TransliteratorAlias(entry->stringArg);
+ return 0;
+ } else if (entry->entryType == Entry::FACTORY) {
+ return entry->u.factory.function(ID, entry->u.factory.context);
+ } else if (entry->entryType == Entry::COMPOUND_RBT) {
+ UnicodeString id("_", "");
+ Transliterator *t = new RuleBasedTransliterator(id, entry->u.data);
+ aliasReturn = new TransliteratorAlias(ID, entry->stringArg, t, entry->intArg, entry->compoundFilter);
+ return 0;
+ }
+
+ TransliteratorParser parser;
+
+ if (entry->entryType == Entry::LOCALE_RULES) {
+ parser.parse(entry->stringArg, (UTransDirection) entry->intArg,
+ parseError, status);
+ } else {
+ {
+ // At this point entry type must be either RULES_FORWARD or
+ // RULES_REVERSE. We process the rule data into a
+ // TransliteratorRuleData object, and possibly also into an
+ // ::id header and/or footer. Then we modify the registry with
+ // the parsed data and retry.
+ UBool isReverse = (entry->entryType == Entry::RULES_REVERSE);
+
+ // We use the file name, taken from another resource bundle
+ // 2-d array at static init time, as a locale language. We're
+ // just using the locale mechanism to map through to a file
+ // name; this in no way represents an actual locale.
+ CharString ch(entry->stringArg);
+ UResourceBundle *bundle = ures_openDirect(0, ch, &status);
+ UnicodeString rules = ures_getUnicodeStringByKey(bundle, RB_RULE, &status);
+ ures_close(bundle);
+
+ // If the status indicates a failure, then we don't have any
+ // rules -- there is probably an installation error. The list
+ // in the root locale should correspond to all the installed
+ // transliterators; if it lists something that's not
+ // installed, we'll get an error from ResourceBundle.
+
+ parser.parse(rules, isReverse ? UTRANS_REVERSE : UTRANS_FORWARD,
+ parseError, status);
+ }
+
+ if (U_FAILURE(status)) {
+ // We have a failure of some kind. Remove the ID from the
+ // registry so we don't keep trying. NOTE: This will throw off
+ // anyone who is, at the moment, trying to iterate over the
+ // available IDs. That's acceptable since we should never
+ // really get here except under installation, configuration,
+ // or unrecoverable run time memory failures.
+ remove(ID);
+ break;
+ }
+
+ entry->u.data = parser.orphanData();
+ entry->stringArg = parser.idBlock;
+ entry->intArg = parser.idSplitPoint;
+ entry->compoundFilter = parser.orphanCompoundFilter();
+
+ // Reset entry->entryType to something that we process at the
+ // top of the loop, then loop back to the top. As long as we
+ // do this, we only loop through twice at most.
+ // NOTE: The logic here matches that in
+ // Transliterator::createFromRules().
+ if (entry->stringArg.length() == 0) {
+ if (entry->u.data == 0) {
+ // No idBlock, no data -- this is just an
+ // alias for Null
+ entry->entryType = Entry::ALIAS;
+ entry->stringArg = NullTransliterator::ID;
+ } else {
+ // No idBlock, data != 0 -- this is an
+ // ordinary RBT_DATA
+ entry->entryType = Entry::RBT_DATA;
+ return new RuleBasedTransliterator(ID, entry->u.data);
+ }
+ } else {
+ if (entry->u.data == 0) {
+ // idBlock, no data -- this is an alias. The ID has
+ // been munged from reverse into forward mode, if
+ // necessary, so instantiate the ID in the forward
+ // direction.
+ entry->entryType = Entry::ALIAS;
+ } else {
+ // idBlock and data -- this is a compound
+ // RBT
+ entry->entryType = Entry::COMPOUND_RBT;
+ }
+ }
+ }
+
+ return 0; // failed
+}
+*/
+
+//#include "unicode/rbt.h"
+#include "unicode/resbund.h"
+#include "unicode/translit.h"
+#include "unicode/ustream.h"
+#include <iostream>
+
+class SWCharString {
+ public:
+ inline SWCharString(const UnicodeString& str);
+ inline ~SWCharString();
+ inline operator const char*() { return ptr; }
+ private:
+ char buf[128];
+ char* ptr;
+};
+
+inline SWCharString::SWCharString(const UnicodeString& str) {
+ // TODO This isn't quite right -- we should probably do
+ // preflighting here to determine the real length.
+ if (str.length() >= (int32_t)sizeof(buf)) {
+ ptr = new char[str.length() + 8];
+ } else {
+ ptr = buf;
+ }
+ str.extract(0, 0x7FFFFFFF, ptr, "");
+}
+
+inline SWCharString::~SWCharString() {
+ if (ptr != buf) {
+ delete[] ptr;
+ }
+}
+
+
+
+static const char RB_RULE_BASED_IDS[] = "RuleBasedTransliteratorIDs";
+
+static const char RB_RULE[] = "Rule";
+
+static const char SW_RESDATA[] = "/usr/local/lib/sword/";
+
+#include <map>
+
+using namespace std;
+
+struct SWTransData {
+ UnicodeString resource;
+ UTransDirection dir;
+};
+
+typedef map <const UnicodeString, SWTransData> SWTransMap;
+
+typedef pair<UnicodeString, SWTransData> SWTransPair;
+
+SWTransMap *sw_tmap;
+
+Transliterator * instantiateTrans(const UnicodeString& ID, const UnicodeString& resource,
+ UTransDirection dir, UParseError &parseError, UErrorCode &status );
+
+Transliterator *SWTransFactory(const UnicodeString &ID,
+ Transliterator::Token context)
+{
+ std::cout << "running factory for " << ID << std::endl;
+ SWTransMap::iterator swelement;
+ if ((swelement = sw_tmap->find(ID)) != sw_tmap->end())
+ {
+ std::cout << "found element in map" << std::endl;
+ SWTransData swstuff = (*swelement).second;
+ UParseError parseError;
+ UErrorCode status;
+ std::cout << "unregistering " << ID << std::endl;
+ Transliterator::unregister(ID);
+ std::cout << "resource is " << swstuff.resource << std::endl;
+ Transliterator *trans = instantiateTrans(ID, swstuff.resource, swstuff.dir, parseError, status);
+ return trans;
+ }
+ return NULL;
+}
+
+void instantiateTransFactory(const UnicodeString& ID, const UnicodeString& resource,
+ UTransDirection dir, UParseError &parseError, UErrorCode &status )
+{
+ std::cout << "making factory for ID " << ID << std::endl;
+ Transliterator::Token context;
+ SWTransData swstuff;
+ swstuff.resource = resource;
+ swstuff.dir = dir;
+ SWTransPair swpair;
+ swpair.first = ID;
+ swpair.second = swstuff;
+ sw_tmap->insert(swpair);
+ Transliterator::registerFactory(ID, &SWTransFactory, context);
+}
+
+void registerTrans(const UnicodeString& ID, const UnicodeString& resource,
+ UTransDirection dir, UErrorCode &status )
+{
+ std::cout << "registering ID locally " << ID << std::endl;
+ SWTransData swstuff;
+ swstuff.resource = resource;
+ swstuff.dir = dir;
+ SWTransPair swpair;
+ swpair.first = ID;
+ swpair.second = swstuff;
+ sw_tmap->insert(swpair);
+}
+
+bool checkTrans(const UnicodeString& ID, UErrorCode &status )
+{
+ Transliterator *trans = Transliterator::createInstance(ID, UTRANS_FORWARD, status);
+ if (!U_FAILURE(status))
+ {
+ // already have it, clean up and return true
+ std::cout << "already have it " << ID << std::endl;
+ delete trans;
+ return true;
+ }
+ status = U_ZERO_ERROR;
+
+ SWTransMap::iterator swelement;
+ if ((swelement = sw_tmap->find(ID)) != sw_tmap->end())
+ {
+ std::cout << "found element in map" << std::endl;
+ SWTransData swstuff = (*swelement).second;
+ UParseError parseError;
+ //UErrorCode status;
+ //std::cout << "unregistering " << ID << std::endl;
+ //Transliterator::unregister(ID);
+ std::cout << "resource is " << swstuff.resource << std::endl;
+
+ // Get the rules
+ //std::cout << "importing: " << ID << ", " << resource << std::endl;
+ SWCharString ch(swstuff.resource);
+ UResourceBundle *bundle = ures_openDirect(SW_RESDATA, ch, &status);
+ const UnicodeString rules = ures_getUnicodeStringByKey(bundle, RB_RULE, &status);
+ ures_close(bundle);
+ //parser.parse(rules, isReverse ? UTRANS_REVERSE : UTRANS_FORWARD,
+ // parseError, status);
+ if (U_FAILURE(status)) {
+ std::cout << "Failed to get rules" << std::endl;
+ std::cout << "status " << u_errorName(status) << std::endl;
+ return false;
+ }
+
+
+ Transliterator *trans = Transliterator::createFromRules(ID, rules, swstuff.dir,
+ parseError,status);
+ if (U_FAILURE(status)) {
+ std::cout << "Failed to create transliterator" << std::endl;
+ std::cout << "status " << u_errorName(status) << std::endl;
+ std::cout << "Parse error: line " << parseError.line << std::endl;
+ std::cout << "Parse error: offset " << parseError.offset << std::endl;
+ std::cout << "Parse error: preContext " << *parseError.preContext << std::endl;
+ std::cout << "Parse error: postContext " << *parseError.postContext << std::endl;
+ std::cout << "rules were" << std::endl;
+ std::cout << rules << std::endl;
+ return false;
+ }
+
+ Transliterator::registerInstance(trans);
+ return true;
+
+ //Transliterator *trans = instantiateTrans(ID, swstuff.resource, swstuff.dir, parseError, status);
+ //return trans;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+Transliterator * createTrans(const UnicodeString& preID, const UnicodeString& ID,
+ const UnicodeString& postID, UTransDirection dir, UErrorCode &status )
+{
+ // extract id to check from ID xxx;id;xxx
+ if (checkTrans(ID, status)) {
+ UnicodeString fullID = preID;
+ fullID += ID;
+ fullID += postID;
+ Transliterator *trans = Transliterator::createInstance(fullID,UTRANS_FORWARD,status);
+ if (U_FAILURE(status)) {
+ delete trans;
+ return NULL;
+ }
+ else {
+ return trans;
+ }
+ }
+ else {
+ return NULL;
+ }
+}
+
+Transliterator * instantiateTrans(const UnicodeString& ID, const UnicodeString& resource,
+ UTransDirection dir, UParseError &parseError, UErrorCode &status )
+{
+ //TransliterationRuleData *ruleData;
+ //TransliteratorParser parser;
+
+ //entry->entryType is 'direction' from translit_index
+ //UBool isReverse = (entry->entryType == Entry::RULES_REVERSE);
+ //entry->stringArg is the 'resource'
+ //CharString ch(entry->stringArg);
+ std::cout << "importing: " << ID << ", " << resource << std::endl;
+ SWCharString ch(resource);
+ UResourceBundle *bundle = ures_openDirect(SW_RESDATA, ch, &status);
+ const UnicodeString rules = ures_getUnicodeStringByKey(bundle, RB_RULE, &status);
+ ures_close(bundle);
+ //parser.parse(rules, isReverse ? UTRANS_REVERSE : UTRANS_FORWARD,
+ // parseError, status);
+ if (U_FAILURE(status)) {
+ std::cout << "Failed to get rules" << std::endl;
+ return NULL;
+ }
+ //ruleData = parser.orphanData();
+ //entry->stringArg = parser.idBlock;
+ //entry->intArg = parser.idSplitPoint;
+ //entry->compoundFilter = parser.orphanCompoundFilter();
+
+ //entry->entryType = Entry::RBT_DATA;
+ //return new RuleBasedTransliterator(ID, ruleData);
+ Transliterator *trans = Transliterator::createFromRules(ID, rules, dir, parseError, status);
+ if (U_FAILURE(status)) {
+ std::cout << "Failed to create transliterator" << std::endl;
+ std::cout << "status " << u_errorName(status) << std::endl;
+ std::cout << "Parse error: line " << parseError.line << std::endl;
+ std::cout << "Parse error: offset " << parseError.offset << std::endl;
+ std::cout << "Parse error: preContext " << *parseError.preContext << std::endl;
+ std::cout << "Parse error: postContext " << *parseError.postContext << std::endl;
+ std::cout << "rules were" << std::endl;
+ std::cout << rules << std::endl;
+ return NULL;
+ }
+
+ Transliterator::registerInstance(trans);
+ return trans;
+}
+
+void initiateSwordTransliterators(UErrorCode &status)
+{
+ static const char translit_swordindex[] = "translit_swordindex";
+
+ UResourceBundle *bundle, *transIDs, *colBund;
+ bundle = ures_openDirect(SW_RESDATA, translit_swordindex, &status);
+ if (U_FAILURE(status)) {
+ std::cout << "no resource index to load" << std::endl;
+ return;
+ }
+
+ transIDs = ures_getByKey(bundle, RB_RULE_BASED_IDS, 0, &status);
+ UParseError parseError;
+
+ int32_t row, maxRows;
+ if (U_SUCCESS(status)) {
+ maxRows = ures_getSize(transIDs);
+ for (row = 0; row < maxRows; row++) {
+ colBund = ures_getByIndex(transIDs, row, 0, &status);
+
+ if (U_SUCCESS(status) && ures_getSize(colBund) == 4) {
+ UnicodeString id = ures_getUnicodeStringByIndex(colBund, 0, &status);
+ UChar type = ures_getUnicodeStringByIndex(colBund, 1, &status).charAt(0);
+ UnicodeString resString = ures_getUnicodeStringByIndex(colBund, 2, &status);
+
+ if (U_SUCCESS(status)) {
+ switch (type) {
+ case 0x66: // 'f'
+ case 0x69: // 'i'
+ // 'file' or 'internal';
+ // row[2]=resource, row[3]=direction
+ {
+ //UBool visible = (type == 0x0066 /*f*/);
+ UTransDirection dir =
+ (ures_getUnicodeStringByIndex(colBund, 3, &status).charAt(0) ==
+ 0x0046 /*F*/) ?
+ UTRANS_FORWARD : UTRANS_REVERSE;
+ //registry->put(id, resString, dir, visible);
+ std::cout << "instantiating " << resString << std::endl;
+ instantiateTrans(id, resString, dir, parseError, status);
+ }
+ break;
+ case 0x61: // 'a'
+ // 'alias'; row[2]=createInstance argument
+ //registry->put(id, resString, TRUE);
+ break;
+ }
+ }
+ else std::cout << "Failed to get resString" << std:: endl;
+ }
+ else std::cout << "Failed to get row" << std:: endl;
+
+ ures_close(colBund);
+ }
+ }
+ else
+ {
+ std::cout << "no resource index to load" << std::endl;
+ }
+
+ ures_close(transIDs);
+ ures_close(bundle);
+}
+
+
+
+void initiateSwordTransliteratorsByFactory(UErrorCode &status)
+{
+ static const char translit_swordindexf[] = "translit_swordindex";
+
+ UResourceBundle *bundle, *transIDs, *colBund;
+ bundle = ures_openDirect(SW_RESDATA, translit_swordindexf, &status);
+ if (U_FAILURE(status)) {
+ std::cout << "no resource index to load" << std::endl;
+ std::cout << "status " << u_errorName(status) << std::endl;
+ return;
+ }
+
+ transIDs = ures_getByKey(bundle, RB_RULE_BASED_IDS, 0, &status);
+ UParseError parseError;
+
+ int32_t row, maxRows;
+ if (U_SUCCESS(status)) {
+ maxRows = ures_getSize(transIDs);
+ for (row = 0; row < maxRows; row++) {
+ colBund = ures_getByIndex(transIDs, row, 0, &status);
+
+ if (U_SUCCESS(status) && ures_getSize(colBund) == 4) {
+ UnicodeString id = ures_getUnicodeStringByIndex(colBund, 0, &status);
+ UChar type = ures_getUnicodeStringByIndex(colBund, 1, &status).charAt(0);
+ UnicodeString resString = ures_getUnicodeStringByIndex(colBund, 2, &status);
+ std::cout << "ok so far" << std::endl;
+
+ if (U_SUCCESS(status)) {
+ switch (type) {
+ case 0x66: // 'f'
+ case 0x69: // 'i'
+ // 'file' or 'internal';
+ // row[2]=resource, row[3]=direction
+ {
+ //UBool visible = (type == 0x0066 /*f*/);
+ UTransDirection dir =
+ (ures_getUnicodeStringByIndex(colBund, 3, &status).charAt(0) ==
+ 0x0046 /*F*/) ?
+ UTRANS_FORWARD : UTRANS_REVERSE;
+ //registry->put(id, resString, dir, visible);
+ std::cout << "instantiating " << resString << " ..." << std::endl;
+ instantiateTransFactory(id, resString, dir, parseError, status);
+ std::cout << "done." << std::endl;
+ }
+ break;
+ case 0x61: // 'a'
+ // 'alias'; row[2]=createInstance argument
+ //registry->put(id, resString, TRUE);
+ break;
+ }
+ }
+ else std::cout << "Failed to get resString" << std:: endl;
+ }
+ else std::cout << "Failed to get row" << std:: endl;
+
+ ures_close(colBund);
+ }
+ }
+ else
+ {
+ std::cout << "no resource index to load" << std::endl;
+ std::cout << "status " << u_errorName(status) << std::endl;
+ }
+
+ ures_close(transIDs);
+ ures_close(bundle);
+}
+
+
+void initiateSwordTransliteratorsToMap(UErrorCode &status)
+{
+ static const char translit_swordindexf[] = "translit_swordindex";
+
+ UResourceBundle *bundle, *transIDs, *colBund;
+ bundle = ures_openDirect(SW_RESDATA, translit_swordindexf, &status);
+ if (U_FAILURE(status)) {
+ std::cout << "no resource index to load" << std::endl;
+ std::cout << "status " << u_errorName(status) << std::endl;
+ return;
+ }
+
+ transIDs = ures_getByKey(bundle, RB_RULE_BASED_IDS, 0, &status);
+ //UParseError parseError;
+
+ int32_t row, maxRows;
+ if (U_SUCCESS(status)) {
+ maxRows = ures_getSize(transIDs);
+ for (row = 0; row < maxRows; row++) {
+ colBund = ures_getByIndex(transIDs, row, 0, &status);
+
+ if (U_SUCCESS(status) && ures_getSize(colBund) == 4) {
+ UnicodeString id = ures_getUnicodeStringByIndex(colBund, 0, &status);
+ UChar type = ures_getUnicodeStringByIndex(colBund, 1, &status).charAt(0);
+ UnicodeString resString = ures_getUnicodeStringByIndex(colBund, 2, &status);
+ std::cout << "ok so far" << std::endl;
+
+ if (U_SUCCESS(status)) {
+ switch (type) {
+ case 0x66: // 'f'
+ case 0x69: // 'i'
+ // 'file' or 'internal';
+ // row[2]=resource, row[3]=direction
+ {
+ //UBool visible = (type == 0x0066 /*f*/);
+ UTransDirection dir =
+ (ures_getUnicodeStringByIndex(colBund, 3, &status).charAt(0) ==
+ 0x0046 /*F*/) ?
+ UTRANS_FORWARD : UTRANS_REVERSE;
+ //registry->put(id, resString, dir, visible);
+ std::cout << "instantiating " << resString << " ..." << std::endl;
+ registerTrans(id, resString, dir, status);
+ std::cout << "done." << std::endl;
+ }
+ break;
+ case 0x61: // 'a'
+ // 'alias'; row[2]=createInstance argument
+ //registry->put(id, resString, TRUE);
+ break;
+ }
+ }
+ else std::cout << "Failed to get resString" << std:: endl;
+ }
+ else std::cout << "Failed to get row" << std:: endl;
+
+ ures_close(colBund);
+ }
+ }
+ else
+ {
+ std::cout << "no resource index to load" << std::endl;
+ std::cout << "status " << u_errorName(status) << std::endl;
+ }
+
+ ures_close(transIDs);
+ ures_close(bundle);
+}
+
+
+
+
+
+int main()
+{
+ sw_tmap = new SWTransMap();
+ UErrorCode status = U_ZERO_ERROR;
+ std::cout << "Available before: " << Transliterator::countAvailableIDs() << std::endl;
+ //initiateSwordTransliterators(status);
+ //initiateSwordTransliteratorsByFactory(status);
+ initiateSwordTransliteratorsToMap(status);
+ int32_t cids = Transliterator::countAvailableIDs();
+ std::cout << "Available after: " << cids << std::endl;
+
+ //for ( int32_t i=0;i<cids;i++) {
+ // std::cout << i << ": " << Transliterator::getAvailableID(i) << std::endl;
+ //}
+
+ //Transliterator *trans = Transliterator::createInstance("NFD;Latin-Gothic;NFC", UTRANS_FORWARD,status);
+ Transliterator *trans = createTrans("NFD;", "Latin-Gothic", ";NFC", UTRANS_FORWARD,status);
+ if (U_FAILURE(status)) {
+ std::cout << "Failed to get Latin-Gothic" << std::endl;
+ status = U_ZERO_ERROR;
+ }
+ else
+ {
+ std::cout << "Got Latin-Gothic :)" << std::endl;
+ delete trans;
+ }
+
+ std::cout << "Available after gothic: " << Transliterator::countAvailableIDs() << std::endl;
+
+ //trans = Transliterator::createInstance("NFD;BGreek-Greek;NFC", UTRANS_FORWARD, status);
+ trans = createTrans("NFD;", "BGreek-Greek", ";NFC", UTRANS_FORWARD, status);
+ if (U_FAILURE(status)) {
+ std::cout << "Failed to get BGreek-Greek" << std::endl;
+ status = U_ZERO_ERROR;
+ }
+ else
+ {
+ std::cout << "Got BGreek-Greek :)" << std::endl;
+ delete trans;
+ }
+ std::cout << "Available after greek: " << Transliterator::countAvailableIDs() << std::endl;
+
+ delete sw_tmap;
+
+ return 1;
+}
+
+//gcc -I../source/i18n -I../source/common swtest.cpp -L../source/i18n -licui18n -L../source/common -licuuc
+
diff --git a/tests/tmp/.cvsignore b/tests/tmp/.cvsignore
new file mode 100644
index 0000000..a5a5838
--- /dev/null
+++ b/tests/tmp/.cvsignore
@@ -0,0 +1,2 @@
+lextest.dat
+lextest.idx \ No newline at end of file
diff --git a/tests/tmp/Makefile.am b/tests/tmp/Makefile.am
new file mode 100644
index 0000000..07dabd8
--- /dev/null
+++ b/tests/tmp/Makefile.am
@@ -0,0 +1,3 @@
+swtesttmpdir = $(top_srcdir)/tests/tmp
+
+EXTRA_DIST += $(swtesttmpdir)/README \ No newline at end of file
diff --git a/tests/tmp/README b/tests/tmp/README
new file mode 100644
index 0000000..a53b060
--- /dev/null
+++ b/tests/tmp/README
@@ -0,0 +1,2 @@
+This directory is used for temporary files created by the test files
+
diff --git a/tests/translittest.cpp b/tests/translittest.cpp
new file mode 100644
index 0000000..5775d4a
--- /dev/null
+++ b/tests/translittest.cpp
@@ -0,0 +1,142 @@
+#include <iostream>
+#include <string>
+
+#include "unicode/udata.h" /* Data structures */
+#include "unicode/ures.h" /* Data structures */
+#include "unicode/utypes.h" /* Basic ICU data types */
+#include "unicode/ucnv.h" /* C Converter API */
+#include "unicode/ustring.h" /* some more string fcns*/
+
+#include "unicode/translit.h"
+
+#include "utf8transliterator.h"
+
+using namespace std;
+
+// Print the given string to stdout
+void uprintf(const UnicodeString &str) {
+ char *buf = 0;
+ int32_t len = str.length();
+ // int32_t bufLen = str.extract(0, len, buf); // Preflight
+ /* Preflighting seems to be broken now, so assume 1-1 conversion,
+ plus some slop. */
+ int32_t bufLen = len + 16;
+ int32_t actualLen;
+ buf = new char[bufLen + 1];
+ actualLen = str.extract(0, len, buf/*, bufLen*/); // Default codepage conversion
+ buf[actualLen] = 0;
+ //printf("%s", buf);
+ std::cout << buf;
+ delete buf;
+}
+
+
+int main() {
+
+
+ UErrorCode status = U_ZERO_ERROR;
+// UDataMemory *pappData = udata_open("/usr/local/lib/sword/swicu", "res", "root", &status);
+ if (U_FAILURE(status))
+ {
+ std::cout << "error: " << status << ":" <<
+ u_errorName(status) << std::endl;
+ return 0;
+ }
+ UChar * uBuf;
+ UChar * target;
+ UConverter *conv;
+ //UParseError perr = U_ZERO_ERROR;
+ int32_t uBufSize = 0, uLength = 0;
+// void * pAppData=NULL;
+ const char * samplestring = "If this compiles and runs without errors, apparently ICU is working.";
+ //ures_open("/usr/local/lib/sword/swicu.dat",
+ // NULL, &status);
+ //UDataMemory *pappData = udata_open("/usr/local/lib/sword/swicu",
+// "res", "root", &status);
+ if (U_FAILURE(status))
+ {
+ std::cout << "error: " << status << ":" <<
+ u_errorName(status) << std::endl;
+ return 0;
+ }
+ //UDataMemory *pappData2 = udata_open("/usr/local/lib/sword/swicu",
+// "res", "translit_Latin_Gothic", &status);
+ std::cout << status << std::endl;
+ if (U_FAILURE(status))
+ {
+ std::cout << "error: " << status << ":" <<
+ u_errorName(status) << std::endl;
+ return 0;
+ }
+ std::cout << "available " << Transliterator::countAvailableIDs() << std::endl;
+ //udata_setAppData("/usr/local/lib/sword/swicu.dat" , pAppData, &status);
+ //if (U_FAILURE(status))
+ //{
+ //std::cout << "error: " << status << ":" <<
+ // u_errorName(status) << std::endl;
+ //return 0;
+ //}
+
+ int32_t i_ids = Transliterator::countAvailableIDs();
+
+ std::cout << "available " << i_ids << std::endl;
+ for (int i=0; i<i_ids;i++)
+ {
+ std::cout << "id " << i << ": ";
+ uprintf(Transliterator::getAvailableID(i));
+ std::cout << std::endl;
+ }
+
+
+ //UTF8Transliterator utran = new UTF8Transliterator();
+ std::cout << "creating transliterator 2" << std::endl;
+ Transliterator *btrans = Transliterator::createInstance("NFD;Latin-Greek;NFC",
+ UTRANS_FORWARD, status);
+ if (U_FAILURE(status))
+ {
+ std::cout << "error: " << status << ":" <<
+ u_errorName(status) << std::endl;
+ return 0;
+ }
+ std::cout << "creating transliterator 1" << std::endl;
+ Transliterator *trans = Transliterator::createInstance("NFD;Latin-Gothic;NFC",
+ UTRANS_FORWARD, status);
+ if (U_FAILURE(status))
+ {
+ delete btrans;
+ std::cout << "error: " << status << ":" <<
+ u_errorName(status) << std::endl;
+ return 0;
+ }
+
+ std::cout << "deleting transliterator 1" << std::endl;
+ delete trans;
+ std::cout << "deleting transliterator 2" << std::endl;
+ delete btrans;
+ std::cout << "the rest" << std::endl;
+ uLength = strlen(samplestring);
+ conv = ucnv_open("utf-8", &status);
+ if (U_FAILURE(status))
+ {
+ std::cout << "error: " << status << ":" <<
+ u_errorName(status) << std::endl;
+ return 0;
+ }
+ uBufSize = (uLength/ucnv_getMinCharSize(conv));
+ uBuf = (UChar*)malloc(uBufSize * sizeof(UChar));
+
+ target = uBuf;
+
+ ucnv_toUChars(conv, target, uLength,
+ samplestring, uLength, &status);
+ if (U_FAILURE(status))
+ {
+ std::cout << "error: " << status << ":" <<
+ u_errorName(status) << std::endl;
+ return 0;
+ }
+
+ cout << samplestring << endl;
+
+ return 0;
+}
diff --git a/tests/versekeytest.cpp b/tests/versekeytest.cpp
new file mode 100644
index 0000000..ec2168a
--- /dev/null
+++ b/tests/versekeytest.cpp
@@ -0,0 +1,58 @@
+#include <iostream>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <versekey.h>
+#include <listkey.h>
+#include <localemgr.h>
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+int main(int argc, char **argv) {
+ VerseKey parser;
+
+ ListKey scope = parser.ParseVerseList("amos", parser, true);
+
+ ListKey result;
+
+ scope++;
+ scope++;
+ scope++;
+ scope++;
+
+ VerseKey x = scope;
+ x.clearBound();
+
+ std::cout << "x: " << x.getText() << "\n";
+
+ result << x;
+
+ std::cout << result.getText() << "\n";
+
+ result = TOP;
+
+ std::cout << result.getText() << "\n";
+
+ const char *bounds = "lk,acts";
+ scope = parser.ParseVerseList(bounds, parser, true);
+
+ VerseKey boundTest("lk", "acts");
+
+ boundTest.setText("Is.1.13");
+ std::cout << "Error: " << (int)boundTest.Error() << "\n";
+ boundTest.setText("1Sam.21.1");
+ std::cout << "Error: " << (int)boundTest.Error() << "\n";
+
+
+ x = "Is.1.13";
+ scope = x;
+// if (scope == x) std::cout << "Error restricting bounds: " << x.getText() << " is in " << bounds << "\n";
+ if (!scope.Error()) std::cout << "Error restricting bounds: " << x.getText() << " is in " << bounds << "\n";
+
+ x = "1Sam.21.1";
+ scope = x;
+ if (!scope.Error()) std::cout << "Error restricting bounds: " << x.getText() << " is in " << bounds << "\n";
+
+ return 0;
+}
diff --git a/tests/webiftest.cpp b/tests/webiftest.cpp
new file mode 100644
index 0000000..5aa8d54
--- /dev/null
+++ b/tests/webiftest.cpp
@@ -0,0 +1,56 @@
+#ifndef __GNUC__
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+#include <fcntl.h>
+#include <errno.h>
+#include <iostream>
+#include <thmlhtmlhref.h>
+#include <unicodertf.h>
+#include <thmlosis.h>
+#include <gbfosis.h>
+#include <thmlosis.h>
+#include <versekey.h>
+#include <swmgr.h>
+#include <swmodule.h>
+#include <markupfiltmgr.h>
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+using namespace std;
+
+#define MAXBUF 30000
+
+int main(int argc, char **argv) {
+
+ const char* modName = (argc >= 2) ? argv[1] : "KJV";
+ const char* keyName = (argc == 3) ? argv[2] : "John 1:1";
+
+ SWMgr mgr(0, 0, true, new MarkupFilterMgr(FMT_WEBIF, ENC_UTF8));
+ mgr.setGlobalOption("Strong's Numbers", "on");
+ mgr.setGlobalOption("Morphological Tags", "on");
+
+ SWModule *module = mgr.Modules[modName];
+ if (!module) {
+ module = mgr.Modules.begin()->second;
+ }
+ module->setKey(keyName);
+ std::cout << module->RenderText() << std::endl<< std::endl<< std::endl;
+
+ //------------------------
+
+ SWMgr mgr2(0, 0, true, new MarkupFilterMgr(FMT_HTMLHREF, ENC_UTF8));
+ mgr2.setGlobalOption("Strong's Numbers", "on");
+ mgr2.setGlobalOption("Morphological Tags", "on");
+ module = mgr2.Modules[modName];
+ if (!module) {
+ module = mgr2.Modules.begin()->second;
+ }
+
+ module->setKey(keyName);
+ std::cout << module->RenderText() << std::endl;
+
+ return 0;
+}
+
diff --git a/tests/xmltest.cpp b/tests/xmltest.cpp
new file mode 100644
index 0000000..c8e1830
--- /dev/null
+++ b/tests/xmltest.cpp
@@ -0,0 +1,52 @@
+#include <utilxml.h>
+#include <iostream>
+
+using namespace sword;
+using namespace std;
+
+int main(int argc, char **argv) {
+
+ const char *xml = "<verse osisID=\"John.1.1\" type=\'test type\' yeah = \"stuff\" />";
+ cout << ((argc > 1) ? argv[1]: xml) << "\n";
+
+ XMLTag x((argc > 1) ? argv[1] : xml);
+
+ cout << x.toString() << "\n";
+ x.setAttribute("addedAttribute", "with a \" quote");
+ cout << x.toString() << "\n";
+ cout << "Tag name: [" << x.getName() << "]\n";
+ StringList attributes = x.getAttributeNames();
+ for (StringList::iterator it = attributes.begin(); it != attributes.end(); it++) {
+ const char *name = it->c_str();
+ cout << " - attribute: [" << name << "] = [";
+ cout << x.getAttribute(name) << "]\n";
+ int count = x.getAttributePartCount(name, ' ');
+ cout << "\t" << count << " parts:\n";
+ int i = (count > 1) ? 0 : -1; // -1 for whole value cuz it's faster, but does the same thing as 0
+ do {
+ cout << "\t" << x.getAttribute(name, i, ' ') << "\n";
+ if (i < 0) i = 0; // to handle our -1 condition
+ } while (++i < count);
+ }
+ cout << " isEmpty: " << x.isEmpty() << "\n";
+ cout << " isEndTag: " << x.isEndTag() << "\n";
+ cout << "\n";
+
+
+ if (argc < 2) { // only run if we're defaulted
+ const char *testParts="ABC D EF GHIJ";
+ cout << "Setting attribute 'multiPart' to: '" << testParts << "'\n";
+ x.setAttribute("multiPart", testParts);
+ cout << x << "\n";
+ cout << "Setting part 2 to 'MMM'\n";
+ x.setAttribute("multiPart", "MMM", 2, ' ');
+ cout << x << "\n";
+ cout << "Removing part 1\n";
+ x.setAttribute("multiPart", 0, 1, ' ');
+ cout << x << "\n";
+ cout << "Removing part 2\n";
+ x.setAttribute("multiPart", 0, 2, ' ');
+ cout << x << "\n";
+ }
+
+}