@@ -413,8 +413,8 @@ TEST_CASE("Collection AllocatorAwareContainer types", "[collection][container][t
413413}
414414// TODO add tests for AllocatorAwareContainer statements and expressions
415415
416- TEST_CASE (" Collection and iterator concepts" , " [collection][container][iterator][std]" ) {
417416#if (__cplusplus >= 202002L)
417+ TEST_CASE (" Collection and iterator concepts" , " [collection][container][iterator][std]" ) {
418418
419419 SECTION (" input_or_output_iterator" ) {
420420 // weakly incrementable
@@ -495,126 +495,33 @@ TEST_CASE("Collection and iterator concepts", "[collection][container][iterator]
495495 // const_iterator
496496 STATIC_REQUIRE (std::input_iterator<const_iterator>);
497497 }
498+ }
498499
499- SECTION (" output_iterator" ) {
500- // indirectly_writable
501- // iterator
502- DOCUMENTED_STATIC_FAILURE (std::indirectly_writable<iterator, CollectionType::value_type>);
503- // STATIC_REQUIRE(std::is_same_v<std::iter_value_t<iterator>, std::decay_t<iterator::value_type>>);
504- // {
505- // auto coll = CollectionType{};
506- // coll.create().cellID(42);
507- // auto e = iterator::value_type{13, 0, 0, 0, 0};
508- // auto e_copy = e;
509- // auto o = coll.begin();
510- // *o = e;
511- // REQUIRE(*o == e_copy);
512- // }
513- DOCUMENTED_STATIC_FAILURE (std::indirectly_writable<iterator, CollectionType::value_type::mutable_type>);
514- // STATIC_REQUIRE(std::is_same_v<std::iter_value_t<iterator>, std::decay_t<iterator::value_type::mutable_type>>);
515- // {
516- // auto coll = CollectionType{};
517- // coll.create().cellID(42);
518- // auto e = iterator::value_type::mutable_type{13, 0, 0, 0, 0};
519- // auto e_copy =e;
520- // auto o = coll.begin();
521- // *o = e;
522- // REQUIRE(*o == e_copy);
523- // }
524- // const_iterator
525- DOCUMENTED_STATIC_FAILURE (std::indirectly_writable<const_iterator, CollectionType::value_type>);
526- // STATIC_REQUIRE(std::is_same_v<std::iter_value_t<const_iterator>, std::decay_t<const_iterator::value_type>>);
527- // {
528- // auto coll = CollectionType{};
529- // coll.create().cellID(42);
530- // auto e = iterator::value_type{13, 0, 0, 0, 0};
531- // auto e_copy = e;
532- // auto o = coll.cbegin();
533- // *o = e;
534- // REQUIRE(*o == e_copy);
535- // }
536- DOCUMENTED_STATIC_FAILURE (std::indirectly_writable<const_iterator, CollectionType::value_type::mutable_type>);
537- // STATIC_REQUIRE(std::is_same_v<std::iter_value_t<const_iterator>,
538- // std::decay_t<const_iterator::value_type::mutable_type>>);
539- // {
540- // auto coll = CollectionType{};
541- // coll.create().cellID(42);
542- // auto e = iterator::value_type::mutable_type{13, 0, 0, 0, 0};
543- // auto e_copy = e;
544- // auto o = coll.cbegin();
545- // *o = e;
546- // REQUIRE(*o == e_copy);
547- // }
548-
549- // iterator
550- DOCUMENTED_STATIC_FAILURE (std::output_iterator<iterator, CollectionType::value_type>);
551- DOCUMENTED_STATIC_FAILURE (std::output_iterator<iterator, CollectionType::value_type::mutable_type>);
552- // const_iterator
553- DOCUMENTED_STATIC_FAILURE (std::output_iterator<const_iterator, CollectionType::value_type>);
554- DOCUMENTED_STATIC_FAILURE (std::output_iterator<const_iterator, CollectionType::value_type::mutable_type>);
555- }
556-
557- SECTION (" forward_iterator" ) {
558- // iterator
559- DOCUMENTED_STATIC_FAILURE (std::forward_iterator<iterator>);
560- // {
561- // REQUIRE(iterator{} == iterator{});
562- // auto coll = CollectionType();
563- // coll.create();
564- // auto i = coll.begin();
565- // auto j = coll.begin();
566- // REQUIRE(i == j);
567- // REQUIRE(++i == ++j);
568- // i = coll.begin();
569- // REQUIRE(((void)[](auto x) { ++x; }(i), *i) == *i);
570- // Pointers and references obtained from a forward iterator into a range remain valid while the range exists.
571- // Is this even unit-testable?
572- // }
573- // const_iterator
574- DOCUMENTED_STATIC_FAILURE (std::forward_iterator<const_iterator>);
575- // {
576- // REQUIRE(const_iterator{} == const_iterator{});
577- // auto coll = CollectionType();
578- // coll.create();
579- // auto i = coll.cbegin();
580- // auto j = coll.cbegin();
581- // REQUIRE(i == j);
582- // REQUIRE(++i == ++j);
583- // i = coll.cbegin();
584- // REQUIRE(((void)[](auto x) { ++x; }(i), *i) == *i);
585- // Pointers and references obtained from a forward iterator into a range remain valid while the range exists.
586- // Is this even unit-testable?
587- // }
588- }
589-
590- SECTION (" bidirectional_iterator" ) {
591- // iterator
592- DOCUMENTED_STATIC_FAILURE (std::bidirectional_iterator<iterator>);
593- // TODO check semantic requirements
594- // const_iterator
595- DOCUMENTED_STATIC_FAILURE (std::bidirectional_iterator<const_iterator>);
596- // TODO check semantic requirements
597- }
598-
599- SECTION (" random_access_iterator" ) {
600- // iterator
601- DOCUMENTED_STATIC_FAILURE (std::random_access_iterator<iterator>);
602- // TODO check semantic requirements
603- // const_iterator
604- DOCUMENTED_STATIC_FAILURE (std::random_access_iterator<const_iterator>);
605- // TODO check semantic requirements
606- }
607-
608- SECTION (" contiguous_iterator_iterator" ) {
609- // iterator
610- DOCUMENTED_STATIC_FAILURE (std::contiguous_iterator<iterator>);
611- // TODO check semantic requirements
612- // const_iterator
613- DOCUMENTED_STATIC_FAILURE (std::contiguous_iterator<const_iterator>);
614- // TODO check semantic requirements
615- }
616- #endif
500+ TEST_CASE (" Collection and unsupported iterator concepts" , " [collection][container][iterator][std]" ) {
501+ // std::indirectly_writable
502+ DOCUMENTED_STATIC_FAILURE (std::indirectly_writable<iterator, CollectionType::value_type>);
503+ DOCUMENTED_STATIC_FAILURE (std::indirectly_writable<iterator, CollectionType::value_type::mutable_type>);
504+ DOCUMENTED_STATIC_FAILURE (std::indirectly_writable<const_iterator, CollectionType::value_type>);
505+ DOCUMENTED_STATIC_FAILURE (std::indirectly_writable<const_iterator, CollectionType::value_type::mutable_type>);
506+ // std::output_iterator
507+ DOCUMENTED_STATIC_FAILURE (std::output_iterator<iterator, CollectionType::value_type>);
508+ DOCUMENTED_STATIC_FAILURE (std::output_iterator<iterator, CollectionType::value_type::mutable_type>);
509+ DOCUMENTED_STATIC_FAILURE (std::output_iterator<const_iterator, CollectionType::value_type>);
510+ DOCUMENTED_STATIC_FAILURE (std::output_iterator<const_iterator, CollectionType::value_type::mutable_type>);
511+ // std::forward_iterator
512+ DOCUMENTED_STATIC_FAILURE (std::forward_iterator<iterator>);
513+ DOCUMENTED_STATIC_FAILURE (std::forward_iterator<const_iterator>);
514+ // std::bidirectional_iterator
515+ DOCUMENTED_STATIC_FAILURE (std::bidirectional_iterator<iterator>);
516+ DOCUMENTED_STATIC_FAILURE (std::bidirectional_iterator<const_iterator>);
517+ // std::random_access_iterator
518+ DOCUMENTED_STATIC_FAILURE (std::random_access_iterator<iterator>);
519+ DOCUMENTED_STATIC_FAILURE (std::random_access_iterator<const_iterator>);
520+ // std::contiguous_iterator
521+ DOCUMENTED_STATIC_FAILURE (std::contiguous_iterator<iterator>);
522+ DOCUMENTED_STATIC_FAILURE (std::contiguous_iterator<const_iterator>);
617523}
524+ #endif // __cplusplus >= 202002L
618525
619526TEST_CASE (" Collection iterators" , " [collection][container][iterator][std]" ) {
620527 // the checks are duplicated for iterator and const_iterator as expectations on them are slightly different
0 commit comments