Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Bug in delta.inc
Topic Summary:
Created On: 7-Feb-2007 18:30
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 7-Feb-2007 18:30
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

The delta.inc function has a bug in it where sometimes when the old text is not empty and the new text is empty, the result returned is incorrect.   For example.  In one instance in one of our modules the old value of the attribute in a baseline was "NO GO" and the current value of the attribute was "".  The result returned by the delta.inc function deltaText() was "NONONO GO" with the "NONO" portion being marked up as new text and the "NO GO" portion being marked up as unchanged except the space which was marked as deleted.  (The deltaText() function returns RTF formated text with new text being bolded and underlined and deleted text from the old text being bolded and strike-through). 

Attached is my version.  Basically I changed the file to creating the Skip lists and array used in the file inside the deltaText() function and after the value has been calculated.  The problem (I think) was that values from some previous iteration were being left in one of the skip lists or array and being output with the correct stuff. 

I wouldn't replace your old file with this as I am not positive some things don't use the functions of this file without calling the main deltaText() function.  But as long as you do, you shouldn't get any errors.  I just saved it as delta2.inc and put it in the same directory as delta.inc (/DOORS/lib/dxl/example/include).

I don't take credit for Telelogic's code I'm just posting the whole thing with my few changes.



-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com

Edited: 7-Feb-2007 at 18:32 by David Pechacek
Report this to a Moderator Report this to a Moderator
 13-Feb-2007 23:11
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Yes. deltaText.inc worked fine for Layout DXL since only one calculation was made. But it failed when called regularly. Comparing it to delteBuf.inc revealed the bug: one of the token lists was preserved between runs resulting in strange results. I 'fixed' it by deleting and creating one of the skips in the interface function (at the bottom), the 'mapping' Skip IIRC. The other globabl data structures could reasonably be preserved since they just map words to tokens; and in fact keeping them made it run faster; but I found for massive runs of deltaText (e.g. comparing source text to Proposed Text for all active CPs in the project) I had to delete and recreate them every now and then since they got out of hand.

Anyway the new 'diff' function works pretty well although it has a memory leak issue.

- Louie
Report this to a Moderator Report this to a Moderator
 13-Feb-2007 23:11
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Yes. deltaText.inc worked fine for Layout DXL since only one calculation was made. But it failed when called regularly. Comparing it to delteBuf.inc revealed the bug: one of the token lists was preserved between runs resulting in strange results. I 'fixed' it by deleting and creating one of the skips in the interface function (at the bottom), the 'mapping' Skip IIRC. The other globabl data structures could reasonably be preserved since they just map words to tokens; and in fact keeping them made it run faster; but I found for massive runs of deltaText (e.g. comparing source text to Proposed Text for all active CPs in the project) I had to delete and recreate them every now and then since they got out of hand.

Anyway the new 'diff' function works pretty well although it has a memory leak issue.

- Louie
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.