bugBattle for Wesnoth - Bugs: bug #21746, Unit tests for the unit_map class...

 
 
Show feedback again

bug #21746: Unit tests for the unit_map class are no longer working

Submitted by:  Fabian Müller <fendrin>
Submitted on:  Mon 03 Mar 2014 07:11:48 AM UTC  
 
Category: BugSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Unit Tests
Status: FixedPrivacy: Public
Assigned to: B. Lipka <lipk>Open/Closed: Closed
Release: 1.11.11+Operating System: All

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 03 Jun 2014 05:25:10 AM UTC, comment #2:

I think AI fixed the rest of them, I'm not sure. But they seem to work fine now, so I'm marking this fixed.

Chris Beck <involution>
Project Member
Wed 12 Mar 2014 12:16:02 AM UTC, comment #1:

I fixed the unit_map tests, in that now they no longer segfault / give division by zero error.

See commit: https://github.com/cbeck88/wesnoth-old/commit/426721f03f46b9a74387498df065ba1d1687e65e

It still has some failures: The console output associated to the unit map tests is now:

20140311 20:13:09 error engine: Trying to add - Orcish Grunt-4294967294 - 4294967294 (2,2) over - Orcish Grunt-4294967294 - 4294967294 (2,2). The new unit will be assigned underlying_id=1 to prevent duplicate id conflicts.
20140311 20:13:09 warning unit: assigning new id to clone of generic unit Orcish Grunt-4294967294
20140311 20:13:09 error engine: Trying to add - Orcish Grunt-4294967294 at an invalid location; Discarding.
20140311 20:13:09 error engine: Trying to add - Orcish Grunt-4294967294 - 4294967294 (2,3) over - Orcish Grunt-4294967294 - 4294967294 (2,2). The new unit will be assigned underlying_id=2 to prevent duplicate id conflicts.
20140311 20:13:09 warning unit: assigning new id to clone of generic unit Orcish Grunt-4294967294
src/tests/test_unit_map.cpp(236): error in "track_real_unit_by_iterator": Iterator should be invalid after extraction and reinsertion.
src/tests/test_unit_map.cpp(272): error in "track_fake_unit_by_iterator": Iterator should be invalid after extraction and reinsertion.

So I guess that only the last two messages are being reported by Boost unit tests, and the others are automatic from the engine and reflect correct behavior. If so, then the only actually problem above is that iterators are not being properly invalidated -- not sure what is actually going wrong there.

Chris Beck <involution>
Project Member
Mon 03 Mar 2014 07:11:48 AM UTC, original submission:

I disabled all unit tests for the unit_map class, they trow exceptions and thus prevent the test suite to terminate properly.

Please have a look at the commit:
http://git.io/y9g5EA

Fabian Müller <fendrin>
Project Member

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by shadowmaster (Updated the item)
  • -unavailable- added by involution (Posted a comment)
  • -unavailable- added by fendrin (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 15 Jul 2014 04:17:45 AM UTCshadowmasterOpen/ClosedOpen=>Closed
    Tue 03 Jun 2014 05:25:10 AM UTCinvolutionStatusNone=>Fixed
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup