[sword-svn] r2121 - in trunk: bindings/corba/java bindings/corba/orbitcpp include src/modules tests tests/testsuite

scribe at www.crosswire.org scribe at www.crosswire.org
Sat Nov 24 09:42:33 MST 2007


Author: scribe
Date: 2007-11-24 09:42:32 -0700 (Sat, 24 Nov 2007)
New Revision: 2121

Added:
   trunk/tests/testsuite/versekey.good
   trunk/tests/testsuite/versekey.sh
   trunk/tests/versekeytest.cpp
Modified:
   trunk/bindings/corba/java/Makefile
   trunk/bindings/corba/java/testclient
   trunk/bindings/corba/orbitcpp/Makefile
   trunk/include/swkey.h
   trunk/src/modules/swmodule.cpp
   trunk/tests/Makefile.am
   trunk/tests/tlitmgrtest.cpp
Log:
Now that VerseKey clone honors bounds, it caused
a problem when a range was set on a module a search
was performed.  The range key was pulled as when a
hit occured and the range key had a bounds set, so
when adding to the results listkey, it also had a
bounds set.



Modified: trunk/bindings/corba/java/Makefile
===================================================================
--- trunk/bindings/corba/java/Makefile	2007-10-17 00:30:47 UTC (rev 2120)
+++ trunk/bindings/corba/java/Makefile	2007-11-24 16:42:32 UTC (rev 2121)
@@ -2,7 +2,7 @@
 #SERVLET_LIB=${TOMCAT_HOME}/common/lib/servlet-api.jar
 SERVLET_LIB=${TOMCAT_HOME}/lib/servlet-api.jar
 #instdir=/home/scribe/public_html/
-instdir=/home/swordweb/livehtml/webapp
+instdir=/home/scribe/src/swordweb/webapp
 all: src/org/crosswire/sword/orb/SWMgr.java classes/org/crosswire/sword/orb/SwordOrb.class
 
 src/org/crosswire/sword/orb/SWMgr.java: ../swordorb.idl

Modified: trunk/bindings/corba/java/testclient
===================================================================
--- trunk/bindings/corba/java/testclient	2007-10-17 00:30:47 UTC (rev 2120)
+++ trunk/bindings/corba/java/testclient	2007-11-24 16:42:32 UTC (rev 2121)
@@ -1,3 +1,6 @@
 #!/bin/sh
+TOMCAT_HOME=/opt/tomcat
+#SERVLET_LIB=${TOMCAT_HOME}/common/lib/servlet-api.jar
+SERVLET_LIB=${TOMCAT_HOME}/lib/servlet-api.jar
 TOMCAT_HOME=/usr/local/tomcat
-java -cp $TOMCAT_HOME/common/lib/servlet-api.jar:classes org.crosswire.sword.orb.SwordOrb $*
+java -cp $SERVLET_LIB:classes org.crosswire.sword.orb.SwordOrb $*

Modified: trunk/bindings/corba/orbitcpp/Makefile
===================================================================
--- trunk/bindings/corba/orbitcpp/Makefile	2007-10-17 00:30:47 UTC (rev 2120)
+++ trunk/bindings/corba/orbitcpp/Makefile	2007-11-24 16:42:32 UTC (rev 2121)
@@ -13,9 +13,9 @@
 LIBS += $(shell orbit2-config --libs)
 
 #orbitcpp stuff-- this is silly.  Is there really NOT a way to derive this?
-CFLAGS += -I/usr/local/include/orbitcpp-2.0
-CXXFLAGS += -I/usr/local/include/orbitcpp-2.0
-LIBS += -L/usr/local/lib -lORBit-2-cpp
+CFLAGS += -I/usr/include/orbitcpp-2.0
+CXXFLAGS += -I/usr/include/orbitcpp-2.0
+LIBS += -L/usr/lib64 -lORBit-2-cpp
 
 #comment out for release
 CXXFLAGS += -g -O0

Modified: trunk/include/swkey.h
===================================================================
--- trunk/include/swkey.h	2007-10-17 00:30:47 UTC (rev 2120)
+++ trunk/include/swkey.h	2007-11-24 16:42:32 UTC (rev 2121)
@@ -141,6 +141,7 @@
 	virtual const char *getShortText() const { return getText(); }
 	virtual const char *getRangeText() const;
 	virtual bool isBoundSet() const { return boundSet; }
+	virtual void clearBound() const { boundSet = false; }
 
 	/** Compares this key object to another SWKey object
 	 * @param ikey key to compare with this one

Modified: trunk/src/modules/swmodule.cpp
===================================================================
--- trunk/src/modules/swmodule.cpp	2007-10-17 00:30:47 UTC (rev 2120)
+++ trunk/src/modules/swmodule.cpp	2007-11-24 16:42:32 UTC (rev 2121)
@@ -641,6 +641,7 @@
 		if (searchType >= 0) {
 			if (!regexec(&preg,  StripText(), 0, 0, 0)) {
 				*resultKey = *getKey();
+				resultKey->clearBound();
 				listKey << *resultKey;
 			}
 		}
@@ -657,6 +658,7 @@
 				sres = strstr(textBuf.c_str(), term.c_str());
 				if (sres) { //it's also in the StripText(), so we have a valid search result item now
 					*resultKey = *getKey();
+					resultKey->clearBound();
 					listKey << *resultKey;
 				}
 				break;
@@ -683,6 +685,7 @@
 				
 				if ((loopCount == 2) && (foundWords == words.size())) { //we found the right words in both raw and stripped text, which means it's a valid result item
 					*resultKey = *getKey();
+					resultKey->clearBound();
 					listKey << *resultKey;
 				}
 				} break;
@@ -738,6 +741,7 @@
 								}
 								if (sres) {
 									*resultKey = *getKey();
+									resultKey->clearBound();
 									listKey << *resultKey;
 									break;
 								}

Modified: trunk/tests/Makefile.am
===================================================================
--- trunk/tests/Makefile.am	2007-10-17 00:30:47 UTC (rev 2120)
+++ trunk/tests/Makefile.am	2007-11-24 16:42:32 UTC (rev 2121)
@@ -4,7 +4,7 @@
 
 SUBDIRS = cppunit
 
-noinst_PROGRAMS = ciphertest keytest mgrtest parsekey listtest casttest \
+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
@@ -40,6 +40,7 @@
 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

Added: trunk/tests/testsuite/versekey.good
===================================================================
--- trunk/tests/testsuite/versekey.good	                        (rev 0)
+++ trunk/tests/testsuite/versekey.good	2007-11-24 16:42:32 UTC (rev 2121)
@@ -0,0 +1,3 @@
+x: Amos 1:5
+Amos 1:5
+Amos 1:5

Added: trunk/tests/testsuite/versekey.sh
===================================================================
--- trunk/tests/testsuite/versekey.sh	                        (rev 0)
+++ trunk/tests/testsuite/versekey.sh	2007-11-24 16:42:32 UTC (rev 2121)
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+../versekeytest


Property changes on: trunk/tests/testsuite/versekey.sh
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/tests/tlitmgrtest.cpp
===================================================================
--- trunk/tests/tlitmgrtest.cpp	2007-10-17 00:30:47 UTC (rev 2120)
+++ trunk/tests/tlitmgrtest.cpp	2007-11-24 16:42:32 UTC (rev 2121)
@@ -223,6 +223,7 @@
 #include "unicode/resbund.h"
 #include "unicode/translit.h"
 #include "unicode/ustream.h"
+#include <iostream>
 
 class SWCharString {
  public:

Added: trunk/tests/versekeytest.cpp
===================================================================
--- trunk/tests/versekeytest.cpp	                        (rev 0)
+++ trunk/tests/versekeytest.cpp	2007-11-24 16:42:32 UTC (rev 2121)
@@ -0,0 +1,38 @@
+#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";
+
+	return 0;
+}




More information about the sword-cvs mailing list