@@ -48,9 +48,9 @@ namespace tst {
4848 * @param source_location - object with source file:line information.
4949 */
5050void check (
51- bool c,
51+ bool c, //
5252 const std::function<void (std::ostream&)>& print,
53- utki::source_location&& source_location
53+ utki::source_location source_location
5454#if CFG_CPP >= 20
5555 = utki::std_source_location::current()
5656#endif
@@ -67,15 +67,19 @@ void check(
6767 */
6868template <class check_type >
6969void check (
70- const check_type& p,
70+ const check_type& p, //
7171 const std::function<void (std::ostream&)>& print,
72- utki::source_location&& source_location
72+ utki::source_location source_location
7373#if CFG_CPP >= 20
7474 = utki::std_source_location::current()
7575#endif
7676)
7777{
78- check (static_cast <bool >(p), print, std::move (source_location));
78+ check (
79+ static_cast <bool >(p), //
80+ print,
81+ std::move (source_location)
82+ );
7983}
8084
8185/* *
@@ -88,15 +92,15 @@ void check(
8892 */
8993class check_result
9094{
91- friend check_result check (bool , utki::source_location&& );
95+ friend check_result check (bool , utki::source_location);
9296
9397 bool failed = false ;
9498 utki::source_location source_location;
9599 std::stringstream ss;
96100
97101 check_result () = default ;
98102
99- check_result (utki::source_location&& source_location) :
103+ check_result (utki::source_location source_location) :
100104 failed (true ),
101105 source_location (std::move(source_location))
102106 {}
@@ -142,7 +146,7 @@ class check_result
142146 */
143147check_result check (
144148 bool c,
145- utki::source_location&& source_location
149+ utki::source_location source_location
146150#if CFG_CPP >= 20
147151 = utki::std_source_location::current()
148152#endif
@@ -158,13 +162,16 @@ check_result check(
158162template <class check_type >
159163check_result check (
160164 const check_type& p,
161- utki::source_location&& source_location
165+ utki::source_location source_location
162166#if CFG_CPP >= 20
163167 = utki::std_source_location::current()
164168#endif
165169)
166170{
167- return check (static_cast <bool >(p), std::move (source_location));
171+ return check (
172+ static_cast <bool >(p), //
173+ std::move (source_location)
174+ );
168175}
169176
170177/* *
@@ -183,7 +190,7 @@ void check_eq(
183190 const parameter_type& a,
184191 const parameter_type& b,
185192 const std::function<void (std::ostream&)>& print,
186- utki::source_location&& source_location
193+ utki::source_location source_location
187194#if CFG_CPP >= 20
188195 = utki::std_source_location::current()
189196#endif
@@ -212,9 +219,9 @@ void check_eq(
212219 */
213220template <class parameter_type >
214221check_result check_eq (
215- const parameter_type& a,
222+ const parameter_type& a, //
216223 const parameter_type& b,
217- utki::source_location&& source_location
224+ utki::source_location source_location
218225#if CFG_CPP >= 20
219226 = utki::std_source_location::current()
220227#endif
@@ -238,10 +245,10 @@ check_result check_eq(
238245 */
239246template <class parameter_type >
240247void check_ne (
241- const parameter_type& a,
248+ const parameter_type& a, //
242249 const parameter_type& b,
243250 const std::function<void (std::ostream&)>& print,
244- utki::source_location&& source_location
251+ utki::source_location source_location
245252#if CFG_CPP >= 20
246253 = utki::std_source_location::current()
247254#endif
@@ -270,9 +277,9 @@ void check_ne(
270277 */
271278template <class parameter_type >
272279check_result check_ne (
273- const parameter_type& a,
280+ const parameter_type& a, //
274281 const parameter_type& b,
275- utki::source_location&& source_location
282+ utki::source_location source_location
276283#if CFG_CPP >= 20
277284 = utki::std_source_location::current()
278285#endif
@@ -296,10 +303,10 @@ check_result check_ne(
296303 */
297304template <class parameter_type >
298305void check_lt (
299- const parameter_type& a,
306+ const parameter_type& a, //
300307 const parameter_type& b,
301308 const std::function<void (std::ostream&)>& print,
302- utki::source_location&& source_location
309+ utki::source_location source_location
303310#if CFG_CPP >= 20
304311 = utki::std_source_location::current()
305312#endif
@@ -328,9 +335,9 @@ void check_lt(
328335 */
329336template <class parameter_type >
330337check_result check_lt (
331- const parameter_type& a,
338+ const parameter_type& a, //
332339 const parameter_type& b,
333- utki::source_location&& source_location
340+ utki::source_location source_location
334341#if CFG_CPP >= 20
335342 = utki::std_source_location::current()
336343#endif
@@ -354,10 +361,10 @@ check_result check_lt(
354361 */
355362template <class parameter_type >
356363void check_gt (
357- const parameter_type& a,
364+ const parameter_type& a, //
358365 const parameter_type& b,
359366 const std::function<void (std::ostream&)>& print,
360- utki::source_location&& source_location
367+ utki::source_location source_location
361368#if CFG_CPP >= 20
362369 = utki::std_source_location::current()
363370#endif
@@ -386,9 +393,9 @@ void check_gt(
386393 */
387394template <class parameter_type >
388395check_result check_gt (
389- const parameter_type& a,
396+ const parameter_type& a, //
390397 const parameter_type& b,
391- utki::source_location&& source_location
398+ utki::source_location source_location
392399#if CFG_CPP >= 20
393400 = utki::std_source_location::current()
394401#endif
@@ -412,10 +419,10 @@ check_result check_gt(
412419 */
413420template <class parameter_type >
414421void check_le (
415- const parameter_type& a,
422+ const parameter_type& a, //
416423 const parameter_type& b,
417424 const std::function<void (std::ostream&)>& print,
418- utki::source_location&& source_location
425+ utki::source_location source_location
419426#if CFG_CPP >= 20
420427 = utki::std_source_location::current()
421428#endif
@@ -444,15 +451,18 @@ void check_le(
444451 */
445452template <class parameter_type >
446453check_result check_le (
447- const parameter_type& a,
454+ const parameter_type& a, //
448455 const parameter_type& b,
449- utki::source_location&& source_location
456+ utki::source_location source_location
450457#if CFG_CPP >= 20
451458 = utki::std_source_location::current()
452459#endif
453460)
454461{
455- auto ret = check (a <= b, std::move (source_location));
462+ auto ret = check (
463+ a <= b, //
464+ std::move (source_location)
465+ );
456466 ret << " check_le(" << a << " , " << b << " )" ;
457467 return ret;
458468}
@@ -470,17 +480,17 @@ check_result check_le(
470480 */
471481template <class parameter_type >
472482void check_ge (
473- const parameter_type& a,
483+ const parameter_type& a, //
474484 const parameter_type& b,
475485 const std::function<void (std::ostream&)>& print,
476- utki::source_location&& source_location
486+ utki::source_location source_location
477487#if CFG_CPP >= 20
478488 = utki::std_source_location::current()
479489#endif
480490)
481491{
482492 check (
483- a >= b,
493+ a >= b, //
484494 [&](auto & o) {
485495 o << " check_ge(" << a << " , " << b << " )" ;
486496 if (print) {
@@ -502,15 +512,18 @@ void check_ge(
502512 */
503513template <class parameter_type >
504514check_result check_ge (
505- const parameter_type& a,
515+ const parameter_type& a, //
506516 const parameter_type& b,
507- utki::source_location&& source_location
517+ utki::source_location source_location
508518#if CFG_CPP >= 20
509519 = utki::std_source_location::current()
510520#endif
511521)
512522{
513- auto ret = check (a >= b, std::move (source_location));
523+ auto ret = check (
524+ a >= b, //
525+ std::move (source_location)
526+ );
514527 ret << " check_ge(" << a << " , " << b << " )" ;
515528 return ret;
516529}
0 commit comments