Project

General

Profile

Actions

Bug #859

closed

OFVector unit test fails on VS2017 in DEBUG mode.

Added by Marco Eichelberg almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Jan Schlamelcher
Category:
Library
Target version:
-
Start date:
2018-11-30
Due date:
% Done:

100%

Estimated time:
Module:
ofstd
Operating System:
Compiler:

Description

The first test in ofstd/tests/tvec.cc fails when STL vectors are enabled and the compiler is VS2017 in DEBUG mode.
[The reason] is that the test case code is non-compliant with the C++ standard in a subtle way: For some reason it is defined that a past-the-end iterator (such as the result from the first begin() call) is invalidated by push_back even if no reallocation occurs. Don’t ask me why, but apparently Microsoft is taking this restriciton seriously and actually checks it in their iterator-checking mechanism which is active in Debug mode. So it is not the actual OFCHECK macro that fails, but the operator== triggers an assert inside the Microsoft runtime as the ‘it’ iterator is considered invalid.

Reported 2018-11-29 by Bengt Gustafsson <>.

Actions

Also available in: Atom PDF