Skip to content

Commit

Permalink
Fix stl exception test.
Browse files Browse the repository at this point in the history
  • Loading branch information
cfis committed Dec 7, 2024
1 parent 91328e3 commit 8af2282
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ add_executable (unittest
"test_Ownership.cpp"
"test_Overloads.cpp"
"test_Self.cpp"
"test_Stl_Exception.cpp"
"test_Stl_Map.cpp"
"test_Stl_Optional.cpp"
"test_Stl_Pair.cpp"
Expand Down
10 changes: 8 additions & 2 deletions test/test_Stl_Exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ using namespace Rice;

TESTSUITE(StlException);

SETUP(Exception)
SETUP(StlException)
{
embed_ruby();
}
Expand Down Expand Up @@ -43,6 +43,12 @@ TESTCASE(StlExceptionCreate)
Object result = exception.call("hello");
ASSERT_EQUAL("Hello", detail::From_Ruby<std::string>().convert(result.value()));

#ifdef _MSC_VER
std::string expected = "Uknown exception";
#else
std::string expected = "std::exception";
#endif

result = exception.call("what");
ASSERT_EQUAL("Unknown exception", detail::From_Ruby<std::string>().convert(result.value()));
ASSERT_EQUAL(expected, detail::From_Ruby<std::string>().convert(result.value()));
}

0 comments on commit 8af2282

Please sign in to comment.