Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locale setting and unittests #98

Open
kjetilly opened this issue Apr 9, 2014 · 2 comments
Open

Locale setting and unittests #98

kjetilly opened this issue Apr 9, 2014 · 2 comments

Comments

@kjetilly
Copy link
Member

kjetilly commented Apr 9, 2014

On a standard Ubuntu 13.10-setup the CombinedUnitests fails with errors referring to boost lexical cast:

$ ./unittests/combined/combined_unittest 
Running 127 test cases...
unknown location(0): fatal error in "parseExposedModelDocument": std::bad_cast: bad lexical cast: source type value could not be interpreted as target
/home/kjetilo/projects/tinia/unittests/modelxml/ExposedModelTest.cpp(479): last checkpoint
unknown location(0): fatal error in "getExposedModelUpdate": std::bad_cast: bad lexical cast: source type value could not be interpreted as target
/home/kjetilo/projects/tinia/unittests/modelxml/ExposedModelTest.cpp(635): last checkpoint
unknown location(0): fatal error in "getExposedModelUpdate2": std::bad_cast: bad lexical cast: source type value could not be interpreted as target
/home/kjetilo/projects/tinia/unittests/modelxml/ExposedModelTest.cpp(635): last checkpoint
unknown location(0): fatal error in "getExposedModelUpdate3": std::bad_cast: bad lexical cast: source type value could not be interpreted as target
/home/kjetilo/projects/tinia/unittests/modelxml/ExposedModelTest.cpp(635): last checkpoint
unknown location(0): fatal error in "getExposedModelUpdate4": std::bad_cast: bad lexical cast: source type value could not be interpreted as target
/home/kjetilo/projects/tinia/unittests/modelxml/ExposedModelTest.cpp(635): last checkpoint
unknown location(0): fatal error in "getExposedModelUpdateForMatrix": std::bad_cast: bad lexical cast: source type value could not be interpreted as target
/home/kjetilo/projects/tinia/unittests/modelxml/ExposedModelTest.cpp(635): last checkpoint
unknown location(0): fatal error in "updateState": std::bad_cast: bad lexical cast: source type value could not be interpreted as target
/home/kjetilo/projects/tinia/unittests/modelxml/ExposedModelTest.cpp(635): last checkpoint
(... renderlistoutput left out...)

*** 7 failures detected in test suite "CombinedTest"

while setting the LC_NUMERIC to en_US.UTF-8 works, i.e. running the program as
LC_NUMERIC="en_US.UTF-8" ./unittests/combined/combined_unittest

Also running the modelxml_unittest seperately does not exhibit the same errors.

@cdyk
Copy link
Contributor

cdyk commented Apr 9, 2014

Isn't this the same issue we had in the FRView VTK-parser? The fix there was setlocale to "C" afairc.

@kjetilly
Copy link
Member Author

kjetilly commented Apr 9, 2014

Kinda, but the weird thing is that it doesn't happen when we run the modelxml-unittests isolated. So the locale must be changed before it reaches the modelxml-unittests somehow.

So to repeat:

  • modelxml_unittest runs without errors
  • combined_unittest gives 7 errors from the modelxml-unittests
  • LC_NUMERIC="en_US.UTF-8" combined_unittest runs without errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants