mrosenbladt / yaml-cpp

Automatically exported from code.google.com/p/yaml-cpp
MIT License
0 stars 0 forks source link

Unit test fails when building shared libs #277

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build as a shared library (BUILD_SHARED_LIBS=ON)
2. Run the unit tests

What is the expected output? What do you see instead?
I expect the unit tests to all pass, instead I get this:

[----------] 7 tests from NodeEmitterTest
[ RUN      ] NodeEmitterTest.SimpleFlowSeqNode
[       OK ] NodeEmitterTest.SimpleFlowSeqNode (0 ms)
[ RUN      ] NodeEmitterTest.NestFlowSeqNode
[       OK ] NodeEmitterTest.NestFlowSeqNode (0 ms)
[ RUN      ] NodeEmitterTest.MixBlockFlowSeqNode
[       OK ] NodeEmitterTest.MixBlockFlowSeqNode (0 ms)
[ RUN      ] NodeEmitterTest.NestBlockFlowMapListNode
[       OK ] NodeEmitterTest.NestBlockFlowMapListNode (0 ms)
[ RUN      ] NodeEmitterTest.NestBlockMixMapListNode
/home/paul/Source/yaml-cpp-collab/test/node/node_test.cpp:286: Failure
Value of: emitter.c_str()
  Actual: "object: {position: [1.01, 2.01, 3.01]}\nscalar: 1.01"
Expected: output
Which is: "scalar: 1.01\nobject: {position: [1.01, 2.01, 3.01]}"
[  FAILED  ] NodeEmitterTest.NestBlockMixMapListNode (0 ms)
[ RUN      ] NodeEmitterTest.NestBlockMapListNode
[       OK ] NodeEmitterTest.NestBlockMapListNode (0 ms)
[ RUN      ] NodeEmitterTest.NestFlowMapListNode
[       OK ] NodeEmitterTest.NestFlowMapListNode (0 ms)
[----------] 7 tests from NodeEmitterTest (0 ms total)

What version of the product are you using? On what operating system?
Current trunk, Debian Sid.

Please provide any additional information below.
It appears that the ordering of the node output is reversed, but still correct. 
The attached patch just checks for both possible orders.

Original issue reported on code.google.com by paul.nov...@gmail.com on 21 Feb 2015 at 2:30

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed, r70dc98fb859b.

I used the googlemock AnyOf matcher, but same gist. Thanks for the report!

Original comment by jbe...@gmail.com on 21 Feb 2015 at 6:21