@@ -89,7 +89,7 @@ BOOST_AUTO_TEST_CASE(no_initialization) {
8989 try {
9090 registry::require_initialized ();
9191 } catch (not_initialized&) {
92- BOOST_TEST_FAIL (" should have not thrown in release variant" );
92+ BOOST_TEST_FAIL (" should not have thrown in release variant" );
9393 }
9494 }
9595}
@@ -155,14 +155,22 @@ using registry = errors_<__COUNTER__>;
155155BOOST_OPENMETHOD_CLASSES (matrix, dense_matrix, diagonal_matrix, registry);
156156
157157BOOST_OPENMETHOD (
158- times, (virtual_<const matrix&>, virtual_<const matrix&>), void , registry);
158+ times,
159+ (virtual_ptr<const matrix, registry>, virtual_ptr<const matrix, registry>),
160+ void , registry);
159161
160162BOOST_OPENMETHOD_OVERRIDE (
161- times, (const matrix&, const diagonal_matrix&), void ) {
163+ times,
164+ (virtual_ptr<const matrix, registry>,
165+ virtual_ptr<const diagonal_matrix, registry>),
166+ void ) {
162167}
163168
164169BOOST_OPENMETHOD_OVERRIDE (
165- times, (const diagonal_matrix&, const matrix&), void ) {
170+ times,
171+ (virtual_ptr<const diagonal_matrix, registry>,
172+ virtual_ptr<const matrix, registry>),
173+ void ) {
166174}
167175
168176BOOST_AUTO_TEST_CASE (bad_call) {
@@ -172,18 +180,36 @@ BOOST_AUTO_TEST_CASE(bad_call) {
172180
173181 {
174182 registry::capture capture;
175- BOOST_CHECK_THROW (times (matrix (), matrix ()), no_overrider);
183+ matrix a, b;
184+ BOOST_CHECK_THROW (times (a, b), no_overrider);
176185 BOOST_TEST (capture ().find (" not implemented" ) != std::string::npos);
177186 }
178187
179188 {
180189 registry::capture capture;
181- BOOST_CHECK_THROW (
182- times (diagonal_matrix (), diagonal_matrix () ), ambiguous_call);
190+ diagonal_matrix a, b;
191+ BOOST_CHECK_THROW ( times (a, b ), ambiguous_call);
183192 BOOST_TEST (capture ().find (" ambiguous" ) != std::string::npos);
184193 }
185194}
186195
196+ BOOST_AUTO_TEST_CASE (bad_call_type_ids) {
197+ auto report = initialize<registry>().report ;
198+ registry::capture capture;
199+
200+ try {
201+ diagonal_matrix a, b;
202+ times (a, b);
203+ BOOST_FAIL (" should have thrown" );
204+ } catch (const ambiguous_call& error) {
205+ BOOST_TEST (error.arity == 2u );
206+ BOOST_TEST (error.types [0 ] == &typeid (diagonal_matrix));
207+ BOOST_TEST (error.types [1 ] == &typeid (diagonal_matrix));
208+ } catch (...) {
209+ BOOST_FAIL (" wrong exception" );
210+ }
211+ }
212+
187213} // namespace TEST_NS
188214
189215namespace TEST_NS {
0 commit comments