[sword-svn] r3488 - in trunk: include src/modules tests/testsuite

scribe at crosswire.org scribe at crosswire.org
Fri Aug 18 09:22:23 MST 2017


Author: scribe
Date: 2017-08-18 09:22:22 -0700 (Fri, 18 Aug 2017)
New Revision: 3488

Added:
   trunk/tests/testsuite/gbsReference.imp
   trunk/tests/testsuite/gbs_basic.good
   trunk/tests/testsuite/gbs_basic.sh
Modified:
   trunk/include/swkey.h
   trunk/src/modules/swmodule.cpp
Log:
Fixed a bug in swmodule which cleared the module's key error in setText when it shouldn't have

Added getter to swkey error which only peeks and doesn't pop
Added gbs_basic test to testsuite

Modified: trunk/include/swkey.h
===================================================================
--- trunk/include/swkey.h	2017-08-01 08:51:22 UTC (rev 3487)
+++ trunk/include/swkey.h	2017-08-18 16:22:22 UTC (rev 3488)
@@ -159,6 +159,7 @@
 	 */
 	SWDEPRECATED char Error() { return popError(); }
 	virtual char popError();
+	virtual char getError() { return error; }
 	virtual void setError(char err) { error = err; }
 
 	/** Sets this SWKey with a character string

Modified: trunk/src/modules/swmodule.cpp
===================================================================
--- trunk/src/modules/swmodule.cpp	2017-08-01 08:51:22 UTC (rev 3487)
+++ trunk/src/modules/swmodule.cpp	2017-08-18 16:22:22 UTC (rev 3488)
@@ -303,7 +303,7 @@
 	if (oldKey)
 		delete oldKey;
 
-	return error = key->popError();
+	return error = key->getError();
 }
 
 

Added: trunk/tests/testsuite/gbsReference.imp
===================================================================
--- trunk/tests/testsuite/gbsReference.imp	                        (rev 0)
+++ trunk/tests/testsuite/gbsReference.imp	2017-08-18 16:22:22 UTC (rev 3488)
@@ -0,0 +1,42 @@
+$$$Chapter 1
+Text of chapter 1.
+$$$/Chapter 2
+Text
+of chapter 2.
+$$$/Chapter 3/
+Text
+of
+chapter
+3.
+$$$Chapter 4/
+Text of chapter 4.
+$$$/Chapter 4/Section 1
+Text of section 1 in chapter 4.
+$$$Chapter 5
+Text of chapter 5.
+$$$/Chapter 5/Section 1/
+Text of section 1 in chapter 5.
+$$$Chapter 5/Section 2/
+Text of section 2 in chapter 5.
+$$$Chapter 6
+Text of chapter 6.
+$$$Chapter 6/Section 1
+Text of section 1 in chapter 6.
+$$$Chapter 6/Section 2
+Text of section 2 in chapter 6.
+$$$Chapter 6/Section 3
+Text of section 3 in chapter 6.
+$$$Chapter 7
+Text of chapter 7.
+$$$Chapter 7/Section 1
+Text of section 1 in chapter 7.
+$$$Chapter 7/Section 1/Subsection 1
+Text of subsection 1 in section 1 of chapter 7.
+$$$Chapter 7/Section 1/Subsection 1/Paragraph 1
+Text of paragraph 1 in subsection 1 of section 1 in chapter 7.
+$$$Chapter 7/Section 1/Subsection 1/Paragraph 1/Sentence 1
+Text of sentence 1 in paragraph 1 of subsection 1 in section 1 of chapter 7.
+$$$Chapter 8
+Text of chapter 8.
+
+

Added: trunk/tests/testsuite/gbs_basic.good
===================================================================
--- trunk/tests/testsuite/gbs_basic.good	                        (rev 0)
+++ trunk/tests/testsuite/gbs_basic.good	2017-08-18 16:22:22 UTC (rev 3488)
@@ -0,0 +1,66 @@
+Chapter 1
+/Chapter 2
+/Chapter 3/
+Chapter 4/
+/Chapter 4/Section 1
+Chapter 5
+/Chapter 5/Section 1/
+Chapter 5/Section 2/
+Chapter 6
+Chapter 6/Section 1
+Chapter 6/Section 2
+Chapter 6/Section 3
+Chapter 7
+Chapter 7/Section 1
+Chapter 7/Section 1/Subsection 1
+Chapter 7/Section 1/Subsection 1/Paragraph 1
+Chapter 7/Section 1/Subsection 1/Paragraph 1/Sentence 1
+Chapter 8
+
+-- Plain output
+/Chapter 7: Text of chapter 7.
+
+-- RTF output
+{\rtf1\ansi{\fonttbl{\f0\froman\fcharset0\fprq2 Times New Roman;}{\f1\fdecor\fprq2 Gentium;}{\f7\froman\fcharset2\fprq2 Symbol;}}/Chapter 8: {\f1 Text of chapter 8.}\par 
+}
+
+-- imp dump
+$$$
+
+$$$/Chapter 1
+Text of chapter 1.
+$$$/Chapter 2
+Text of chapter 2.
+$$$/Chapter 3
+Text of chapter 3.
+$$$/Chapter 4
+Text of chapter 4.
+$$$/Chapter 4/Section 1
+Text of section 1 in chapter 4.
+$$$/Chapter 5
+Text of chapter 5.
+$$$/Chapter 5/Section 1
+Text of section 1 in chapter 5.
+$$$/Chapter 5/Section 2
+Text of section 2 in chapter 5.
+$$$/Chapter 6
+Text of chapter 6.
+$$$/Chapter 6/Section 1
+Text of section 1 in chapter 6.
+$$$/Chapter 6/Section 2
+Text of section 2 in chapter 6.
+$$$/Chapter 6/Section 3
+Text of section 3 in chapter 6.
+$$$/Chapter 7
+Text of chapter 7.
+$$$/Chapter 7/Section 1
+Text of section 1 in chapter 7.
+$$$/Chapter 7/Section 1/Subsection 1
+Text of subsection 1 in section 1 of chapter 7.
+$$$/Chapter 7/Section 1/Subsection 1/Paragraph 1
+Text of paragraph 1 in subsection 1 of section 1 in chapter 7.
+$$$/Chapter 7/Section 1/Subsection 1/Paragraph 1/Sentence 1
+Text of sentence 1 in paragraph 1 of subsection 1 in section 1 of chapter 7.
+$$$/Chapter 8
+Text of chapter 8.
+

Added: trunk/tests/testsuite/gbs_basic.sh
===================================================================
--- trunk/tests/testsuite/gbs_basic.sh	                        (rev 0)
+++ trunk/tests/testsuite/gbs_basic.sh	2017-08-18 16:22:22 UTC (rev 3488)
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+rm -rf tmp/gbs_basic/
+mkdir -p tmp/gbs_basic/mods.d
+mkdir -p tmp/gbs_basic/modules
+
+cat > tmp/gbs_basic/mods.d/gbsreference.conf <<!
+[GBSReference]
+DataPath=./modules/gbsreference
+ModDrv=RawGenBook
+Encoding=UTF-8
+SourceType=OSIS
+Lang=en
+Feature=StrongsNumbers
+!
+
+../../utilities/imp2gbs gbsReference.imp -o tmp/gbs_basic/modules/gbsreference 2>&1 | grep -v \$Rev
+
+cd tmp/gbs_basic
+#../../../gbstest GBSReference
+
+echo
+echo "-- Plain output"
+../../../../utilities/diatheke/diatheke -b GBSReference -f plain -k "Chapter 7" | grep -v GBSReference
+echo
+echo "-- RTF output"
+../../../../utilities/diatheke/diatheke -b GBSReference -f RTF -k "Chapter 8" | grep -v GBSReference
+echo
+echo "-- imp dump"
+../../../../utilities/mod2imp GBSReference


Property changes on: trunk/tests/testsuite/gbs_basic.sh
___________________________________________________________________
Added: svn:executable
   + *




More information about the sword-cvs mailing list