38
38
}
39
39
catch (expectation_failure<char const *> const & x)
40
40
{
41
- std::cout << " expected: " << x.which ();
42
- std::cout << " got: \" " << x.where () << ' " ' << std::endl ;
41
+ BOOST_TEST_CSTR_EQ ( x.which (). c_str (), " 'o' " );
42
+ BOOST_TEST_CSTR_EQ ( x.where (), " i " ) ;
43
43
}
44
44
}
45
45
55
55
}
56
56
catch (expectation_failure<char const *> const & x)
57
57
{
58
- std::cout << " expected: " << x.which ();
59
- std::cout << " got: \" " << x.where () << ' " ' << std::endl ;
58
+ BOOST_TEST_CSTR_EQ ( x.which (). c_str (), " 'o' " );
59
+ BOOST_TEST_CSTR_EQ ( x.where (), " i " ) ;
60
60
}
61
61
}
62
62
@@ -67,8 +67,12 @@ main()
67
67
}
68
68
catch (expectation_failure<char const *> const & x)
69
69
{
70
- std::cout << " expected: " << x.which ();
71
- std::cout << " got: \" " << x.where () << ' "' << std::endl;
70
+ #ifndef BOOST_SPIRIT_X3_NO_RTTI
71
+ BOOST_TEST (x.which ().find (" sequence" ) != std::string::npos);
72
+ #else
73
+ BOOST_TEST_CSTR_EQ (x.which ().c_str (), " undefined" );
74
+ #endif
75
+ BOOST_TEST_CSTR_EQ (x.where (), " y:a" );
72
76
}
73
77
}
74
78
@@ -128,8 +132,8 @@ main()
128
132
}
129
133
catch (expectation_failure<char const *> const & x)
130
134
{
131
- std::cout << " expected: " << x.which ();
132
- std::cout << " got: \" " << x.where () << ' " ' << std::endl ;
135
+ BOOST_TEST_CSTR_EQ ( x.which (). c_str (), " 'o' " );
136
+ BOOST_TEST_CSTR_EQ ( x.where (), " i " ) ;
133
137
}
134
138
}
135
139
@@ -140,8 +144,8 @@ main()
140
144
}
141
145
catch (expectation_failure<char const *> const & x)
142
146
{
143
- std::cout << " expected: " << x.which ();
144
- std::cout << " got: \" " << x.where () << ' " ' << std::endl ;
147
+ BOOST_TEST_CSTR_EQ ( x.which (). c_str (), " \" foo \" " );
148
+ BOOST_TEST_CSTR_EQ ( x.where (), " bar " ) ;
145
149
}
146
150
}
147
151
0 commit comments