[sword-cvs] sword/tests outputcps.cpp,NONE,1.1 Makefile.am,1.16,1.17
sword@www.crosswire.org
sword@www.crosswire.org
Thu, 8 Apr 2004 15:52:11 -0700
Update of /cvs/core/sword/tests
In directory www:/tmp/cvs-serv5568/tests
Modified Files:
Makefile.am
Added Files:
outputcps.cpp
Log Message:
dglassey: draft header containing default bks and cps for KJV versification
test program used to generate the cps
--- NEW FILE: outputcps.cpp ---
#include <stdio.h>
#include <versekey.h>
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}, // 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, 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, vmax, tk->getBookName(), tk->Chapter());
tk->Chapter(tk->Chapter()+1);
}
delete tk;
return 0;
}
Index: Makefile.am
===================================================================
RCS file: /cvs/core/sword/tests/Makefile.am,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- Makefile.am 10 Feb 2004 17:59:46 -0000 1.16
+++ Makefile.am 8 Apr 2004 22:52:09 -0000 1.17
@@ -6,7 +6,7 @@
noinst_PROGRAMS = keytest mgrtest parsekey listtest casttest modtest \
compnone complzss localetest introtest indextest configtest keycast \
romantest testblocks filtertest rawldidxtest lextest swaptest genbooktest treeidxtest \
-swbuftest xmltest webiftest
+swbuftest xmltest webiftest outputcps
if ICU
ICUPROG = icutest translittest tlitmgrtest
@@ -60,6 +60,7 @@
swbuftest_SOURCES = swbuftest.cpp
webiftest_SOURCES = webiftest.cpp
xmltest_SOURCES = xmltest.cpp
+outputcps_SOURCES = outputcps.cpp
EXTRA_DIST =
include bcppmake/Makefile.am