Re: [sword-devel] breakage in verse management at -r2785?

2013-03-22 Thread David Haslam
Has anyone tested how -r2785 manages for John 8 in the SBLGNT which omits the
Pericope Adulterae?

In the SBLGNT module, John 8 starts at verse 12, and John 7 omits verse 53.

Question prompted by an unrelated bug reported for And Bible.

David





--
View this message in context: 
http://sword-dev.350566.n4.nabble.com/breakage-in-verse-management-at-r2785-tp4652055p4652098.html
Sent from the SWORD Dev mailing list archive at Nabble.com.

___
sword-devel mailing list: sword-devel@crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page


Re: [sword-devel] breakage in verse management at -r2785?

2013-03-22 Thread Troy A. Griffitts

Hi Greg,

In your test, on like 19, you turn off auto normalization.  This means 
SWORD won't mess with the values you set for the components of a verse.  
If you setText("Gen.1.1"); setChapter(999); setVerse(); and print, 
you should get "Genesis 999:".  If you want normalization, then you 
need to remove the line in your test which says key->setAutoNormalize(0);


There is a good encapsulation of how I expect normalization to work in 
the test suite.  The specific test is:


http://crosswire.org/svn/sword/trunk/tests/versekeytest.cpp

And the expected output is:

http://crosswire.org/svn/sword/trunk/tests/testsuite/versekeytest.good

(the labels in that test still use the old terminology of 'headings', 
but this is really 'intros')




On 03/22/2013 02:02 AM, Greg Hellings wrote:

Test code: https://gist.github.com/greg-hellings/5218094

Output with your current patch, Troy, is $ g++ `pkg-config --cflags 
sword` `pkg-config --libs sword` test.cpp -o test && ./test

intro:  0
bk (1): 1
ch (1): 1
vs (1): 1
-
intro:  0
bk (1): 0
ch (1): 0
vs (1): 0
-
intro:  1
bk (0): 0
ch (0): 0
vs (0): 0
-

The value in parenthsis represents what I thought the value "should" 
be. If I comment out line 19, I get this result $ g++ `pkg-config 
--cflags sword` `pkg-config --libs sword` test.cpp -o test && ./test

intro:  0
bk (1): 1
ch (1): 1
vs (1): 1
-
intro:  0
bk (1): 1
ch (1): 1
vs (1): 1
-
intro:  1
bk (0): 0
ch (0): 0
vs (0): 0
-

which matches the expected results. So Xiphos is getting around 
calling setIntros(1) by instead disabling auto-normalizing. It's odd 
to me that you can set a key to a value in the intros while setIntros 
is false. That doesn't seem like normalizing to me, that seems more 
like bounds checking, but that's not necessarily a bug in the API, 
possibly it's a bug in my understanding of intended behavior.


Troy's fix along with shuffling the location of setTestament (a change 
I made earlier to Xiphos' Subversion) fixes the known bugs I've seen 
in Xiphos regarding chapters not rendering and Genesis 1:1 causing a 
SegFault.


--Greg



On Thu, Mar 21, 2013 at 6:51 PM, Greg Hellings 
mailto:greg.helli...@gmail.com>> wrote:





On Thu, Mar 21, 2013 at 6:26 PM, Troy A. Griffitts
mailto:scr...@crosswire.org>> wrote:

Thanks Karl,

Yes, each snippet was helpful. Nic's was a quick test which
caused the bug and was easy to use for testing. Greg's snippet
wasn't as helpful as all his comments and stack traces leading
up to his patch. He is preventing book from getting to 0 which
does alleviate the problem but also stops a book from becoming
an intro. Hope that explains.


If the conditional in my code is changed to

if (book > (intros?0:1) ) {

Then my code corrects the problem that -- was moving a VerseKey
from Genesis 1:1 to [Testament 1 Intro] when intros is false.
While not a SegFault producing bug, this is still a bug. Similar
checks should be made through the same run of code to ensure
moving to verse 0 and chapter 0 are not possible when intros is
false. Both your fix and an adapted form of mine should be
introduced. Additionally, the issue with OSISFootnotes should
probably be fixed.

I will write up a simple test case for that, if it helps, once I
get back to my development machine.

--Greg


Troy

Karl Kleinpaste mailto:k...@kleinpaste.org>> wrote:

You didn't also need this snippet from Greg a couple days
ago? --- src/keys/versekey.cpp (revision 2792) +++
src/keys/versekey.cpp (working copy) @@ -1347,7 +1347,9 @@
} if (verse < (intros?0:1)) { if (--chapter <
(intros?0:1)) { - --book; + if (book > 1) { + --book; + }
chapter += (getChapterMax() + (intros?1:0)); } verse +=
(getVerseMax() + (intros?1:0));


sword-devel mailing list: sword-devel@crosswire.org

http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above
page


-- 
Sent from my Android phone with K-9 Mail. Please excuse my

brevity.

___

sword-devel mailing list: sword-devel@crosswire.org

http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page





___
sword-devel mailing list: sword-devel@crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page


__

Re: [sword-devel] breakage in verse management at -r2785?

2013-03-22 Thread DM Smith
The presence or absence of a verse in a particular module should not matter. It 
should merely be a matter of whether the v11n defines it.

On Mar 22, 2013, at 5:02 AM, David Haslam  wrote:

> Has anyone tested how -r2785 manages for John 8 in the SBLGNT which omits the
> Pericope Adulterae?
> 
> In the SBLGNT module, John 8 starts at verse 12, and John 7 omits verse 53.
> 
> Question prompted by an unrelated bug reported for And Bible.
> 
> David


___
sword-devel mailing list: sword-devel@crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page