[sword-cvs] sword/tests swbuftest.cpp,NONE,1.1 Makefile.am,1.10,1.11 Makefile.in,1.19,1.20 filtertest.cpp,1.15,1.16

sword@www.crosswire.org sword@www.crosswire.org
Wed, 19 Feb 2003 20:12:40 -0700


Update of /usr/local/cvsroot/sword/tests
In directory www:/tmp/cvs-serv14731/tests

Modified Files:
	Makefile.am Makefile.in filtertest.cpp 
Added Files:
	swbuftest.cpp 
Log Message:
	Added utilfuns/swbuf.cpp and tests/swbuftest
	Fixed make system to include osisrtf and osisplain



--- NEW FILE: swbuftest.cpp ---
#include <swbuf.h>
#include <iostream>

using namespace std;
using namespace sword;

int main(int argc, char **argv) {
	SWBuf 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";
	SWBuf y = x + " " + x;
	cout << "should be (hello wurld hello world): (" << y << ")\n";
}


Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/sword/tests/Makefile.am,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Makefile.am	13 Sep 2002 20:47:38 -0000	1.10
--- Makefile.am	20 Feb 2003 03:12:37 -0000	1.11
***************
*** 6,10 ****
  noinst_PROGRAMS = keytest mgrtest parsekey listtest casttest modtest \
  compnone complzss localetest keycast introtest indextest configtest \
! romantest testblocks filtertest rawldidxtest lextest swaptest genbooktest treeidxtest
  
  if ICU
--- 6,11 ----
  noinst_PROGRAMS = keytest mgrtest parsekey listtest casttest modtest \
  compnone complzss localetest keycast introtest indextest configtest \
! romantest testblocks filtertest rawldidxtest lextest swaptest genbooktest treeidxtest \
! swbuftest
  
  if ICU
***************
*** 57,58 ****
--- 58,61 ----
  treeidxtest_SOURCES = treeidxtest.cpp
  genbooktest_SOURCES = genbooktest.cpp
+ swbuftest_SOURCES = swbuftest.cpp
+ 

Index: Makefile.in
===================================================================
RCS file: /usr/local/cvsroot/sword/tests/Makefile.in,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** Makefile.in	13 Feb 2003 22:27:53 -0000	1.19
--- Makefile.in	20 Feb 2003 03:12:37 -0000	1.20
***************
*** 165,169 ****
  noinst_PROGRAMS = keytest mgrtest parsekey listtest casttest modtest \
  compnone complzss localetest keycast introtest indextest configtest \
! romantest testblocks filtertest rawldidxtest lextest swaptest genbooktest treeidxtest\
  $(ICUPROG) $(ZLIBPROG)
  
--- 165,170 ----
  noinst_PROGRAMS = keytest mgrtest parsekey listtest casttest modtest \
  compnone complzss localetest keycast introtest indextest configtest \
! romantest testblocks filtertest rawldidxtest lextest swaptest genbooktest treeidxtest \
! swbuftest\
  $(ICUPROG) $(ZLIBPROG)
  
***************
*** 202,205 ****
--- 203,207 ----
  treeidxtest_SOURCES = treeidxtest.cpp
  genbooktest_SOURCES = genbooktest.cpp
+ swbuftest_SOURCES = swbuftest.cpp
  subdir = tests
  mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
***************
*** 217,221 ****
  @ICU_FALSE@@ZLIB_TRUE@	lextest$(EXEEXT) swaptest$(EXEEXT) \
  @ICU_FALSE@@ZLIB_TRUE@	genbooktest$(EXEEXT) treeidxtest$(EXEEXT) \
! @ICU_FALSE@@ZLIB_TRUE@	compzip$(EXEEXT)
  @ICU_FALSE@@ZLIB_FALSE@noinst_PROGRAMS = keytest$(EXEEXT) \
  @ICU_FALSE@@ZLIB_FALSE@	mgrtest$(EXEEXT) parsekey$(EXEEXT) \
--- 219,223 ----
  @ICU_FALSE@@ZLIB_TRUE@	lextest$(EXEEXT) swaptest$(EXEEXT) \
  @ICU_FALSE@@ZLIB_TRUE@	genbooktest$(EXEEXT) treeidxtest$(EXEEXT) \
! @ICU_FALSE@@ZLIB_TRUE@	swbuftest$(EXEEXT) compzip$(EXEEXT)
  @ICU_FALSE@@ZLIB_FALSE@noinst_PROGRAMS = keytest$(EXEEXT) \
  @ICU_FALSE@@ZLIB_FALSE@	mgrtest$(EXEEXT) parsekey$(EXEEXT) \
***************
*** 229,233 ****
  @ICU_FALSE@@ZLIB_FALSE@	rawldidxtest$(EXEEXT) lextest$(EXEEXT) \
  @ICU_FALSE@@ZLIB_FALSE@	swaptest$(EXEEXT) genbooktest$(EXEEXT) \
! @ICU_FALSE@@ZLIB_FALSE@	treeidxtest$(EXEEXT)
  @ICU_TRUE@@ZLIB_TRUE@noinst_PROGRAMS = keytest$(EXEEXT) mgrtest$(EXEEXT) \
  @ICU_TRUE@@ZLIB_TRUE@	parsekey$(EXEEXT) listtest$(EXEEXT) \
--- 231,235 ----
  @ICU_FALSE@@ZLIB_FALSE@	rawldidxtest$(EXEEXT) lextest$(EXEEXT) \
  @ICU_FALSE@@ZLIB_FALSE@	swaptest$(EXEEXT) genbooktest$(EXEEXT) \
! @ICU_FALSE@@ZLIB_FALSE@	treeidxtest$(EXEEXT) swbuftest$(EXEEXT)
  @ICU_TRUE@@ZLIB_TRUE@noinst_PROGRAMS = keytest$(EXEEXT) mgrtest$(EXEEXT) \
  @ICU_TRUE@@ZLIB_TRUE@	parsekey$(EXEEXT) listtest$(EXEEXT) \
***************
*** 240,246 ****
  @ICU_TRUE@@ZLIB_TRUE@	rawldidxtest$(EXEEXT) lextest$(EXEEXT) \
  @ICU_TRUE@@ZLIB_TRUE@	swaptest$(EXEEXT) genbooktest$(EXEEXT) \
! @ICU_TRUE@@ZLIB_TRUE@	treeidxtest$(EXEEXT) icutest$(EXEEXT) \
! @ICU_TRUE@@ZLIB_TRUE@	translittest$(EXEEXT) tlitmgrtest$(EXEEXT) \
! @ICU_TRUE@@ZLIB_TRUE@	compzip$(EXEEXT)
  @ICU_TRUE@@ZLIB_FALSE@noinst_PROGRAMS = keytest$(EXEEXT) \
  @ICU_TRUE@@ZLIB_FALSE@	mgrtest$(EXEEXT) parsekey$(EXEEXT) \
--- 242,248 ----
  @ICU_TRUE@@ZLIB_TRUE@	rawldidxtest$(EXEEXT) lextest$(EXEEXT) \
  @ICU_TRUE@@ZLIB_TRUE@	swaptest$(EXEEXT) genbooktest$(EXEEXT) \
! @ICU_TRUE@@ZLIB_TRUE@	treeidxtest$(EXEEXT) swbuftest$(EXEEXT) \
! @ICU_TRUE@@ZLIB_TRUE@	icutest$(EXEEXT) translittest$(EXEEXT) \
! @ICU_TRUE@@ZLIB_TRUE@	tlitmgrtest$(EXEEXT) compzip$(EXEEXT)
  @ICU_TRUE@@ZLIB_FALSE@noinst_PROGRAMS = keytest$(EXEEXT) \
  @ICU_TRUE@@ZLIB_FALSE@	mgrtest$(EXEEXT) parsekey$(EXEEXT) \
***************
*** 254,258 ****
  @ICU_TRUE@@ZLIB_FALSE@	lextest$(EXEEXT) swaptest$(EXEEXT) \
  @ICU_TRUE@@ZLIB_FALSE@	genbooktest$(EXEEXT) treeidxtest$(EXEEXT) \
! @ICU_TRUE@@ZLIB_FALSE@	icutest$(EXEEXT) translittest$(EXEEXT) \
  @ICU_TRUE@@ZLIB_FALSE@	tlitmgrtest$(EXEEXT)
  PROGRAMS = $(noinst_PROGRAMS)
--- 256,261 ----
  @ICU_TRUE@@ZLIB_FALSE@	lextest$(EXEEXT) swaptest$(EXEEXT) \
  @ICU_TRUE@@ZLIB_FALSE@	genbooktest$(EXEEXT) treeidxtest$(EXEEXT) \
! @ICU_TRUE@@ZLIB_FALSE@	swbuftest$(EXEEXT) icutest$(EXEEXT) \
! @ICU_TRUE@@ZLIB_FALSE@	translittest$(EXEEXT) \
  @ICU_TRUE@@ZLIB_FALSE@	tlitmgrtest$(EXEEXT)
  PROGRAMS = $(noinst_PROGRAMS)
***************
*** 365,368 ****
--- 368,376 ----
  swaptest_DEPENDENCIES =
  swaptest_LDFLAGS =
+ am_swbuftest_OBJECTS = swbuftest.$(OBJEXT)
+ swbuftest_OBJECTS = $(am_swbuftest_OBJECTS)
+ swbuftest_LDADD = $(LDADD)
+ swbuftest_DEPENDENCIES =
+ swbuftest_LDFLAGS =
  am_testblocks_OBJECTS = testblocks.$(OBJEXT)
  testblocks_OBJECTS = $(am_testblocks_OBJECTS)
***************
*** 402,406 ****
  @AMDEP_TRUE@	./$(DEPDIR)/rawldidxtest.Po \
  @AMDEP_TRUE@	./$(DEPDIR)/romantest.Po ./$(DEPDIR)/swaptest.Po \
! @AMDEP_TRUE@	./$(DEPDIR)/testblocks.Po \
  @AMDEP_TRUE@	./$(DEPDIR)/tlitmgrtest.Po \
  @AMDEP_TRUE@	./$(DEPDIR)/translittest.Po \
--- 410,414 ----
  @AMDEP_TRUE@	./$(DEPDIR)/rawldidxtest.Po \
  @AMDEP_TRUE@	./$(DEPDIR)/romantest.Po ./$(DEPDIR)/swaptest.Po \
! @AMDEP_TRUE@	./$(DEPDIR)/swbuftest.Po ./$(DEPDIR)/testblocks.Po \
  @AMDEP_TRUE@	./$(DEPDIR)/tlitmgrtest.Po \
  @AMDEP_TRUE@	./$(DEPDIR)/translittest.Po \
***************
*** 422,430 ****
  	$(localetest_SOURCES) $(mgrtest_SOURCES) $(modtest_SOURCES) \
  	$(parsekey_SOURCES) $(rawldidxtest_SOURCES) \
! 	$(romantest_SOURCES) $(swaptest_SOURCES) $(testblocks_SOURCES) \
! 	$(am__tlitmgrtest_SOURCES_DIST) \
  	$(am__translittest_SOURCES_DIST) $(treeidxtest_SOURCES)
  DIST_COMMON = Makefile.am Makefile.in
! SOURCES = $(casttest_SOURCES) $(complzss_SOURCES) $(compnone_SOURCES) $(compzip_SOURCES) $(configtest_SOURCES) $(filtertest_SOURCES) $(genbooktest_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) $(testblocks_SOURCES) $(tlitmgrtest_SOURCES) $(translittest_SOURCES) $(treeidxtest_SOURCES)
  
  all: all-am
--- 430,438 ----
  	$(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) $(treeidxtest_SOURCES)
  DIST_COMMON = Makefile.am Makefile.in
! SOURCES = $(casttest_SOURCES) $(complzss_SOURCES) $(compnone_SOURCES) $(compzip_SOURCES) $(configtest_SOURCES) $(filtertest_SOURCES) $(genbooktest_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) $(treeidxtest_SOURCES)
  
  all: all-am
***************
*** 507,510 ****
--- 515,521 ----
  	@rm -f swaptest$(EXEEXT)
  	$(CXXLINK) $(swaptest_LDFLAGS) $(swaptest_OBJECTS) $(swaptest_LDADD) $(LIBS)
+ swbuftest$(EXEEXT): $(swbuftest_OBJECTS) $(swbuftest_DEPENDENCIES) 
+ 	@rm -f swbuftest$(EXEEXT)
+ 	$(CXXLINK) $(swbuftest_LDFLAGS) $(swbuftest_OBJECTS) $(swbuftest_LDADD) $(LIBS)
  testblocks$(EXEEXT): $(testblocks_OBJECTS) $(testblocks_DEPENDENCIES) 
  	@rm -f testblocks$(EXEEXT)
***************
*** 547,550 ****
--- 558,562 ----
  @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@

Index: filtertest.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/tests/filtertest.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** filtertest.cpp	8 Jan 2003 23:31:48 -0000	1.15
--- filtertest.cpp	20 Feb 2003 03:12:37 -0000	1.16
***************
*** 14,18 ****
  #define MAXBUF 30000
  int main(int argc, char **argv) {
! 	SWMgr mgr(0, 0, true, new MarkupFilterMgr(FMT_RTF, ENC_RTF));
  	mgr.setGlobalOption("Strong's Numbers", "on");
  	mgr.setGlobalOption("Morphological Tags", "on");
--- 14,18 ----
  #define MAXBUF 30000
  int main(int argc, char **argv) {
! 	SWMgr mgr(0, 0, true, new MarkupFilterMgr(FMT_HTMLHREF, ENC_RTF));
  	mgr.setGlobalOption("Strong's Numbers", "on");
  	mgr.setGlobalOption("Morphological Tags", "on");
***************
*** 22,26 ****
  
      //ThMLOSIS filter;
!     module->Key() = ((argc > 1) ? argv[1] : "acts 2:1");
      /*
      char *buf = new char [ MAXBUF ];
--- 22,26 ----
  
      //ThMLOSIS filter;
!     module->Key() = ((argc > 1) ? argv[1] : "john 1:1");
      /*
      char *buf = new char [ MAXBUF ];
***************
*** 35,39 ****
      delete [] buf;
      */
!     cout << *module << "\n";
      return 0;
  }
--- 35,40 ----
      delete [] buf;
      */
!     cout << module->Name() << " : " << module->KeyText() << "\n";
!     cout << module->RenderText() << "\n";
      return 0;
  }