MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0027571Open CASCADE[OCCT] OCCT:Foundation Classespublic2016-06-06 16:292018-05-12 21:36
Reporteragv 
Assigned Toabv 
PrioritynormalSeverityminor 
StatusresolvedResolutionopen 
PlatformWindowsOSVC++ 2013OS Version32 bit
Product Version[OCCT] 7.0.0 
Target Version[OCCT] 7.4.0*Fixed in Version 
Summary0027571: Foundation Classes - bad implementation of NCollection_Sequence::Iterator in reversed mode
DescriptionRegression after 0024831 "Make iterators of NCollection classes STL-compatible".

When the Iterator is initialized for reverse iteration (isStart==False) then it is placed to empty position beyond the end of collection. The OCCT loop semantics requires that an iterator after creation should point to the first iterated item, as it was implemented before version 6.8.0

I propose to restore the original definition of method NCollection_BaseSequence::Iterator::Init() and then revise the STL methods of NCollection_Sequence, particularly now end() and cend() likely lead to crash.
Steps To Reproducetest bugs fclasses bug27571
TagsNo tags attached.
Test case number
Attached Files

- Relationships
related to 0024831closedapn Open CASCADE Make iterators of NCollection classes STL-compatible 

-  Notes
(0058286)
git (administrator)
2016-09-28 19:32

Branch CR27571 has been created by ski.

SHA-1: 48c6f7b63627de2828e6e5333daa86c1236e0a54


Detailed log of new commits:

Author: ski
Date: Wed Sep 28 17:13:47 2016 +0300

    0027571: Bad implementation of NCollection_Sequence::Iterator
    
    Reverse iterator after creation points to the first iterated item now (last item of sequence).
    Test case was created.
(0058314)
git (administrator)
2016-09-29 13:23

Branch CR27571 has been updated forcibly by ski.

SHA-1: 52bb4675a9f9c381f290c6831c7df99d7f7da5f1
(0058321)
ski (developer)
2016-09-29 15:12

Dear abv,

all changes are located in branch CR27571.

When the Iterator is initialized for reverse iteration (isStart==False) then it
points to the first iterated item of reversed sequence.
For example:
sequence = 1 2 3 4 5
reversed sequence = 5 4 3 2 1
so, reversed iterator will point to the item 5 after initialization.

It is possible to use Next() with reversed iterator, it will set iterator to the next item 5 -> 4.
More() is also usable.
Previous() will reset iterator to the previous item 4 -> 5.

Methods rbegin()/rend(), increment / decrement operators can be used to work with reversed iterator too.

Test case bugs fclasses bug27571 was created.

Please, review.

- Issue History
Date Modified Username Field Change
2016-06-06 16:29 agv New Issue
2016-06-06 16:29 agv Assigned To => abv
2016-06-06 19:26 agv Relationship added related to 0027572
2016-09-23 12:20 abv Assigned To abv => ski
2016-09-23 12:20 abv Status new => assigned
2016-09-28 19:32 git Note Added: 0058286
2016-09-28 19:37 kgv Relationship added related to 0024831
2016-09-29 13:23 git Note Added: 0058314
2016-09-29 14:01 kgv Summary Bad implementation of NCollection_Sequence::Iterator => Foundation Classes - bad implementation of NCollection_Sequence::Iterator in reversed mode
2016-09-29 15:12 ski Note Added: 0058321
2016-09-29 15:12 ski Assigned To ski => abv
2016-09-29 15:12 ski Status assigned => resolved
2016-09-29 15:12 ski Steps to Reproduce Updated View Revisions
2016-10-07 17:46 kgv Relationship added related to 0027941
2016-11-22 12:25 abv Target Version 7.1.0 => 7.2.0
2017-08-29 09:37 abv Target Version 7.2.0 => 7.3.0
2018-05-12 21:36 abv Target Version 7.3.0 => 7.4.0*


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker