25 #ifndef LSST_AFW_TYPEHANDLING_TEST_H 26 #define LSST_AFW_TYPEHANDLING_TEST_H 28 #define BOOST_TEST_DYN_LINK 29 #pragma clang diagnostic push 30 #pragma clang diagnostic ignored "-Wunused-variable" 31 #include "boost/test/unit_test.hpp" 32 #pragma clang diagnostic pop 40 #include <boost/mpl/list.hpp> 49 namespace typehandling {
60 class SimpleStorable :
public Storable {
62 virtual ~SimpleStorable() =
default;
66 std::string toString()
const override {
return "Simplest possible representation"; }
68 bool equals(
Storable const&
other)
const noexcept
override {
return singleClassEquals(*
this, other); }
69 virtual bool operator==(SimpleStorable
const& other)
const {
return true; }
70 bool operator!=(SimpleStorable
const& other)
const {
return !(*
this ==
other); }
73 class ComplexStorable final :
public SimpleStorable {
75 constexpr ComplexStorable(
double storage) : SimpleStorable(), storage(storage) {}
77 ComplexStorable& operator=(
double newValue) {
83 return std::make_unique<ComplexStorable>(storage);
92 auto complexOther =
dynamic_cast<ComplexStorable const*
>(&
other);
94 return this->storage == complexOther->storage;
99 bool operator==(SimpleStorable
const& other)
const override {
return this->equals(other); }
105 template <
typename T>
115 auto const KEY0 = makeKey<bool>(0);
116 bool const VALUE0 =
true;
117 auto const KEY1 = makeKey<int>(1);
118 int const VALUE1 = 42;
119 auto const KEY2 = makeKey<double>(2);
120 int const VALUE2 = VALUE1;
121 auto const KEY3 = makeKey<std::string>(3);
122 std::string const VALUE3 =
"How many roads must a man walk down?";
123 auto const KEY4 = makeKey<std::shared_ptr<SimpleStorable const>>(4);
124 auto const VALUE4 = SimpleStorable();
125 auto const KEY5 = makeKey<ComplexStorable>(5);
126 auto const VALUE5 = ComplexStorable(-100.0);
127 auto const KEY6 = makeKey<std::shared_ptr<Storable const>>(6);
156 static GenericMapFactory
const factory;
159 BOOST_TEST(demoMap->at(KEY0) == VALUE0);
160 BOOST_TEST(demoMap->at(KEY1) == VALUE1);
161 BOOST_TEST(demoMap->at(KEY2) == VALUE2);
162 BOOST_TEST(demoMap->at(KEY3) == VALUE3);
163 BOOST_TEST(*(demoMap->at(KEY4)) == VALUE4);
164 BOOST_TEST(demoMap->at(KEY5) == VALUE5);
165 BOOST_TEST(demoMap->at(KEY6) == VALUE6);
171 static GenericMapFactory
const factory;
174 BOOST_TEST(demoMap->at(KEY0) == VALUE0);
175 demoMap->at(KEY0) =
false;
176 BOOST_TEST(demoMap->at(KEY0) ==
false);
179 BOOST_TEST(demoMap->at(KEY1) == VALUE1);
181 BOOST_TEST(demoMap->at(KEY1) == VALUE1 + 1);
184 BOOST_TEST(demoMap->at(KEY2) == VALUE2);
185 demoMap->at(KEY2) = 0.0;
186 BOOST_TEST(demoMap->at(KEY2) == 0.0);
188 using Type2 = std::remove_const_t<decltype(VALUE2)>;
191 BOOST_TEST(demoMap->at(KEY3) == VALUE3);
192 demoMap->at(KEY3).append(
" Oops, wrong question."s);
193 BOOST_TEST(demoMap->at(KEY3) == VALUE3 +
" Oops, wrong question."s);
195 BOOST_TEST(*(demoMap->at(KEY4)) == VALUE4);
197 using Type4 = std::remove_const_t<decltype(VALUE4)>;
200 BOOST_TEST(demoMap->at(KEY5) == VALUE5);
201 BOOST_TEST(demoMap->at(makeKey<SimpleStorable>(KEY5.getId())) == VALUE5);
203 ComplexStorable newValue(5.0);
204 demoMap->at(KEY5) = newValue;
205 BOOST_TEST(demoMap->at(KEY5) == newValue);
207 BOOST_TEST(demoMap->at(KEY6) == VALUE6);
211 static GenericMapFactory
const factory;
212 auto map1 = factory.makeGenericMap();
215 BOOST_CHECK(*map1 == *map1);
217 BOOST_CHECK(*map1 != *(factory.makeGenericMap()));
221 static GenericMapFactory
const factory;
227 auto bruteForcePrinter = [&map](
int key) {
230 return universalToString(map->at(KEY0));
232 return universalToString(map->at(KEY1));
234 return universalToString(map->at(KEY2));
236 return universalToString(map->at(KEY3));
238 return universalToString(map->at(KEY4));
240 return universalToString(map->at(KEY5));
242 return universalToString(map->at(KEY6));
248 for (
int key : mapKeys) {
258 void operator()(
int,
bool value) { results.
push_back(universalToString(value)); }
261 void operator()(
int,
float const& value) { results.
push_back(universalToString(value)); }
262 void operator()(
int,
double value) { results.
push_back(universalToString(value)); }
264 void operator()(
int,
Storable const& value) { results.
push_back(universalToString(value)); }
266 results.
push_back(universalToString(value));
270 BOOST_REQUIRE(printer.results.size() == expected.
size());
271 for (
std::size_t i = 0; i < printer.results.size(); ++i) {
272 BOOST_TEST(printer.results[i] == expected[i],
273 printer.results[i] <<
" != " << expected[i] <<
", key = " << mapKeys[i]);
278 map->apply([](
int,
auto const& value) {
return universalToString(value); });
279 BOOST_REQUIRE(strings.
size() == expected.
size());
281 BOOST_TEST(strings[i] == expected[i],
282 strings[i] <<
" != " << expected[i] <<
", key = " << mapKeys[i]);
287 static GenericMapFactory
const factory;
295 void operator()(
int,
bool& value) { value = !value; }
296 void operator()(
int,
std::int32_t& value) { value *= 2; }
297 void operator()(
int,
std::int64_t& value) { value *= 2; }
298 void operator()(
int,
float& value) { value *= 2; }
299 void operator()(
int,
double& value) { value *= 2; }
300 void operator()(
int,
std::string& value) { value +=
"Appendix"; }
301 void operator()(
int,
Storable& value) {
302 auto complexStorable =
dynamic_cast<ComplexStorable*
>(&value);
303 if (complexStorable !=
nullptr) {
304 *complexStorable = 42;
312 BOOST_TEST(newKeys == originalKeys);
313 BOOST_TEST(map->at(KEY0) == !VALUE0);
314 BOOST_TEST(map->at(KEY1) == 2 * VALUE1);
315 BOOST_TEST(map->at(KEY2) == 2 * VALUE2);
316 BOOST_TEST(map->at(KEY3) == VALUE3 +
"Appendix");
317 BOOST_TEST(*(map->at(KEY4)) == VALUE4);
318 BOOST_TEST(map->at(KEY5) != VALUE5);
319 BOOST_TEST(map->at(KEY5) == ComplexStorable(42));
320 BOOST_TEST(map->at(KEY6) ==
nullptr);
324 static GenericMapFactory
const factory;
332 int operator()(
int key,
bool& value) {
344 int operator()(
int key,
float& value) {
348 int operator()(
int key,
double& value) {
356 int operator()(
int key,
Storable& value) {
357 auto complexStorable =
dynamic_cast<ComplexStorable*
>(&value);
358 if (complexStorable !=
nullptr) {
359 *complexStorable = 42;
366 BOOST_TEST(editedKeys == originalKeys);
369 BOOST_TEST(newKeys == originalKeys);
370 BOOST_TEST(map->at(KEY0) == !VALUE0);
371 BOOST_TEST(map->at(KEY1) == 2 * VALUE1);
372 BOOST_TEST(map->at(KEY2) == 2 * VALUE2);
373 BOOST_TEST(map->at(KEY3) == VALUE3 +
"Appendix");
374 BOOST_TEST(*(map->at(KEY4)) == VALUE4);
375 BOOST_TEST(map->at(KEY5) != VALUE5);
376 BOOST_TEST(map->at(KEY5) == ComplexStorable(42));
377 BOOST_TEST(map->at(KEY6) ==
nullptr);
383 static GenericMapFactory
const factory;
384 auto map1 = factory.makeMutableGenericMap();
385 auto map2 = factory.makeMutableGenericMap();
388 BOOST_CHECK(*map1 == *map2);
390 auto primitiveKey = makeKey<int>(
"primitive"s);
391 map1->insert(primitiveKey, 42);
392 BOOST_CHECK(*map1 != *map2);
393 map2->insert(primitiveKey, 42);
394 BOOST_CHECK(*map1 == *map2);
396 auto sharedKey = makeKey<std::shared_ptr<SimpleStorable const>>(
"shared"s);
397 auto common = std::make_shared<SimpleStorable const>(VALUE4);
398 map1->insert(sharedKey, common);
399 BOOST_CHECK(*map1 != *map2);
400 map2->insert(sharedKey, std::make_shared<SimpleStorable const>(VALUE4));
401 BOOST_CHECK(*map1 != *map2);
402 map2->erase(sharedKey);
403 map2->insert(sharedKey, common);
404 BOOST_CHECK(*map1 == *map2);
406 auto storableKey = makeKey<ComplexStorable>(
"storable"s);
407 map1->insert(storableKey, VALUE5);
408 BOOST_CHECK(*map1 != *map2);
409 map2->insert(storableKey, VALUE5);
410 BOOST_CHECK(*map1 == *map2);
412 auto nullKey = makeKey<std::shared_ptr<ComplexStorable const>>(
"null"s);
413 map1->insert(nullKey, std::static_pointer_cast<ComplexStorable const>(VALUE6));
414 BOOST_CHECK(*map1 != *map2);
415 map2->insert(nullKey, std::static_pointer_cast<ComplexStorable const>(VALUE6));
416 BOOST_CHECK(*map1 == *map2);
420 static GenericMapFactory
const factory;
423 BOOST_TEST(demoMap->size() == 7);
424 BOOST_TEST(!demoMap->empty());
430 static GenericMapFactory
const factory;
433 BOOST_TEST_REQUIRE(demoMap->size() == 0);
434 BOOST_TEST_REQUIRE(demoMap->empty());
436 demoMap->insert(makeKey<int>(
"Negative One"s), -1);
437 BOOST_TEST(demoMap->size() == 1);
438 BOOST_TEST(!demoMap->empty());
440 demoMap->erase(makeKey<int>(
"Negative One"s));
441 BOOST_TEST(demoMap->size() == 0);
442 BOOST_TEST(demoMap->empty());
448 static GenericMapFactory
const factory;
451 BOOST_TEST(demoMap->contains(KEY0.getId()));
452 BOOST_TEST(demoMap->contains(KEY1.getId()));
453 BOOST_TEST(demoMap->contains(KEY2.getId()));
454 BOOST_TEST(demoMap->contains(KEY3.getId()));
455 BOOST_TEST(demoMap->contains(KEY4.getId()));
456 BOOST_TEST(demoMap->contains(KEY5.getId()));
457 BOOST_TEST(demoMap->contains(KEY6.getId()));
461 static GenericMapFactory
const factory;
464 BOOST_TEST(demoMap->contains(KEY0));
465 BOOST_TEST(!demoMap->contains(makeKey<int>(KEY0.getId())));
467 BOOST_TEST(demoMap->contains(KEY1));
468 BOOST_TEST(!demoMap->contains(makeKey<bool>(KEY1.getId())));
470 BOOST_TEST(demoMap->contains(KEY2));
472 BOOST_TEST(!demoMap->contains(
makeKey<decltype(VALUE2)>(KEY2.getId())));
474 BOOST_TEST(demoMap->contains(KEY3));
476 BOOST_TEST(demoMap->contains(KEY4));
478 BOOST_TEST(!demoMap->contains(
makeKey<decltype(VALUE4)>(KEY4.getId())));
480 BOOST_TEST(demoMap->contains(KEY5));
481 BOOST_TEST(demoMap->contains(makeKey<SimpleStorable>(KEY5.getId())));
482 BOOST_TEST(demoMap->contains(makeKey<Storable>(KEY5.getId())));
484 BOOST_TEST(demoMap->contains(KEY6));
490 static GenericMapFactory
const factory;
492 auto orderedKeys = demoMap->keys();
496 BOOST_TEST(
keys ==
std::set<int>({KEY0.getId(), KEY1.getId(), KEY2.getId(), KEY3.getId(), KEY4.getId(),
497 KEY5.getId(), KEY6.getId()}));
501 static GenericMapFactory
const factory;
503 auto keys = demoMap->keys();
506 demoMap->apply([&iterOrder](
int key,
auto value) { iterOrder.
push_back(key); });
507 BOOST_TEST(
keys == iterOrder);
511 static GenericMapFactory
const factory;
514 BOOST_TEST_REQUIRE(demoMap->empty());
516 BOOST_TEST(demoMap->empty());
522 static GenericMapFactory
const factory;
525 demoMap->insert(makeKey<int>(
"prime"s), 3);
526 demoMap->insert(makeKey<std::string>(
"foo"s),
"bar"s);
528 BOOST_TEST_REQUIRE(!demoMap->empty());
530 BOOST_TEST(demoMap->empty());
536 static GenericMapFactory
const factory;
539 BOOST_TEST_REQUIRE(demoMap->empty());
542 BOOST_TEST(demoMap->insert(makeKey<int>(
"cube"s), x) ==
true);
543 BOOST_TEST(demoMap->insert(makeKey<int>(
"cube"s), 0) ==
false);
545 BOOST_TEST(!demoMap->empty());
546 BOOST_TEST(demoMap->size() == 1);
547 BOOST_TEST(demoMap->contains(
"cube"s));
548 BOOST_TEST(demoMap->contains(makeKey<int>(
"cube"s)));
549 BOOST_TEST(!demoMap->contains(makeKey<double>(
"cube"s)));
550 BOOST_TEST(demoMap->at(makeKey<int>(
"cube"s)) ==
x);
553 BOOST_TEST(demoMap->at(makeKey<int>(
"cube"s)) !=
x);
555 demoMap->at(makeKey<int>(
"cube"s)) = 0;
556 BOOST_TEST(demoMap->at(makeKey<int>(
"cube"s)) == 0);
562 static GenericMapFactory
const factory;
565 BOOST_TEST_REQUIRE(demoMap->empty());
567 auto insertResult = demoMap->insert(
"cube"s, 27);
568 BOOST_TEST(insertResult.second ==
true);
569 BOOST_TEST(demoMap->insert(
"cube"s, 0).second ==
false);
571 BOOST_TEST(!demoMap->empty());
572 BOOST_TEST(demoMap->size() == 1);
573 BOOST_TEST(demoMap->contains(
"cube"s));
574 BOOST_TEST(demoMap->contains(insertResult.first));
575 BOOST_TEST(demoMap->contains(makeKey<int>(
"cube"s)));
576 BOOST_TEST(!demoMap->contains(makeKey<double>(
"cube"s)));
577 BOOST_TEST(demoMap->at(insertResult.first) == 27);
578 BOOST_TEST(demoMap->at(makeKey<int>(
"cube"s)) == 27);
580 demoMap->at(insertResult.first) = 0;
581 BOOST_TEST(demoMap->at(insertResult.first) == 0);
587 static GenericMapFactory
const factory;
590 BOOST_TEST_REQUIRE(demoMap->empty());
593 "I have a most elegant and wonderful proof, but this string is too small to contain it."s);
594 BOOST_TEST(demoMap->insert(makeKey<std::string>(
"Ultimate answer"s), answer) ==
true);
595 BOOST_TEST(demoMap->insert(makeKey<std::string>(
"OK"s),
"Ook!"s) ==
true);
596 BOOST_TEST(demoMap->insert(makeKey<std::string>(
"Ultimate answer"s),
"Something philosophical"s) ==
599 BOOST_TEST(!demoMap->empty());
600 BOOST_TEST(demoMap->size() == 2);
601 BOOST_TEST(demoMap->contains(
"OK"s));
602 BOOST_TEST(demoMap->contains(makeKey<std::string>(
"Ultimate answer"s)));
603 BOOST_TEST(demoMap->at(makeKey<std::string>(
"Ultimate answer"s)) == answer);
604 BOOST_TEST(demoMap->at(makeKey<std::string>(
"OK"s)) ==
"Ook!"s);
606 answer =
"I don't know"s;
607 BOOST_TEST(demoMap->at(makeKey<std::string>(
"Ultimate answer"s)) != answer);
613 static GenericMapFactory
const factory;
616 BOOST_TEST_REQUIRE(demoMap->empty());
618 auto insertResult1 = demoMap->insert(
"Ultimate answer"s,
"Something philosophical"s);
619 BOOST_TEST(insertResult1.second ==
true);
620 auto insertResult2 = demoMap->insert(
"OK"s,
"Ook!"s);
621 BOOST_TEST(insertResult2.second ==
true);
623 BOOST_TEST(!demoMap->empty());
624 BOOST_TEST(demoMap->size() == 2);
625 BOOST_TEST(demoMap->contains(insertResult1.first));
626 BOOST_TEST(demoMap->contains(insertResult2.first));
627 BOOST_TEST(demoMap->contains(
"OK"s));
628 BOOST_TEST(demoMap->contains(makeKey<std::string>(
"Ultimate answer"s)));
629 BOOST_TEST(demoMap->at(insertResult1.first) ==
"Something philosophical"s);
630 BOOST_TEST(demoMap->at(makeKey<std::string>(
"Ultimate answer"s)) ==
"Something philosophical"s);
631 BOOST_TEST(demoMap->at(insertResult2.first) ==
"Ook!"s);
632 BOOST_TEST(demoMap->at(makeKey<std::string>(
"OK"s)) ==
"Ook!"s);
638 static GenericMapFactory
const factory;
641 BOOST_TEST_REQUIRE(demoMap->empty());
643 ComplexStorable object(3.1416);
644 BOOST_TEST(demoMap->insert<
Storable>(makeKey<Storable>(
"foo"s),
object) ==
true);
646 std::make_shared<ComplexStorable const>(3.141)) ==
true);
647 BOOST_TEST(demoMap->insert<
Storable>(makeKey<Storable>(
"foo"s), SimpleStorable()) ==
false);
649 std::make_shared<SimpleStorable const>()) ==
false);
651 std::make_shared<SimpleStorable const>()) ==
true);
653 BOOST_TEST(!demoMap->empty());
654 BOOST_TEST(demoMap->size() == 3);
655 BOOST_TEST(demoMap->contains(
"foo"s));
656 BOOST_TEST(demoMap->contains(makeKey<Storable>(
"foo"s)));
661 BOOST_TEST(
object == demoMap->at(makeKey<SimpleStorable>(
"foo"s)));
662 object = ComplexStorable(1.4);
663 BOOST_TEST(
object != demoMap->at(makeKey<SimpleStorable>(
"foo"s)));
665 ComplexStorable(3.141));
671 static GenericMapFactory
const factory;
674 BOOST_TEST_REQUIRE(demoMap->empty());
676 BOOST_TEST(demoMap->insert(makeKey<int>(
"key1"s), 3) ==
true);
677 BOOST_TEST(demoMap->insert(makeKey<double>(
"key1"s), 1.0) ==
false);
678 BOOST_TEST(demoMap->insert<
Storable>(makeKey<Storable>(
"key2"s), SimpleStorable()) ==
true);
679 BOOST_TEST(demoMap->insert(makeKey<std::string>(
"key3"s),
"Test value"s) ==
true);
680 BOOST_TEST(demoMap->insert(makeKey<std::string>(
"key4"s),
"This is some text"s) ==
true);
681 std::string const message =
"Unknown value for key5."s;
682 BOOST_TEST(demoMap->insert(makeKey<std::string>(
"key5"s), message) ==
true);
683 BOOST_TEST(demoMap->insert(makeKey<int>(
"key3"s), 20) ==
false);
684 BOOST_TEST(demoMap->insert<
double>(makeKey<double>(
"key6"s), 42) ==
true);
686 BOOST_TEST(!demoMap->empty());
687 BOOST_TEST(demoMap->size() == 6);
688 BOOST_TEST(demoMap->at(makeKey<int>(
"key1"s)) == 3);
689 BOOST_TEST(demoMap->at(makeKey<double>(
"key6"s)) == 42);
690 BOOST_TEST(demoMap->at(makeKey<SimpleStorable>(
"key2"s)) == SimpleStorable());
691 BOOST_TEST(demoMap->at(makeKey<std::string>(
"key3"s)) ==
"Test value"s);
692 BOOST_TEST(demoMap->at(makeKey<std::string>(
"key4"s)) ==
"This is some text"s);
693 BOOST_TEST(demoMap->at(makeKey<std::string>(
"key5"s)) == message);
699 static GenericMapFactory
const factory;
702 demoMap->insert(makeKey<int>(
"Ultimate answer"s), 42);
703 BOOST_TEST_REQUIRE(demoMap->size() == 1);
705 BOOST_TEST(demoMap->erase(makeKey<std::string>(
"Ultimate answer"s)) ==
false);
706 BOOST_TEST(demoMap->size() == 1);
707 BOOST_TEST(demoMap->erase(makeKey<int>(
"Ultimate answer"s)) ==
true);
708 BOOST_TEST(demoMap->size() == 0);
714 static GenericMapFactory
const factory;
717 BOOST_TEST_REQUIRE(demoMap->empty());
719 BOOST_TEST(demoMap->insert(makeKey<int>(
"Ultimate answer"s), 42) ==
true);
720 BOOST_TEST(demoMap->insert(makeKey<int>(
"OK"s), 200) ==
true);
721 BOOST_TEST(demoMap->erase(makeKey<int>(
"Ultimate answer"s)) ==
true);
722 BOOST_TEST(demoMap->insert(makeKey<double>(
"Ultimate answer"s), 3.1415927) ==
true);
724 BOOST_TEST(!demoMap->empty());
725 BOOST_TEST(demoMap->size() == 2);
726 BOOST_TEST(demoMap->contains(
"OK"s));
727 BOOST_TEST(!demoMap->contains(makeKey<int>(
"Ultimate answer"s)));
728 BOOST_TEST(demoMap->contains(makeKey<double>(
"Ultimate answer"s)));
729 BOOST_TEST(demoMap->at(makeKey<double>(
"Ultimate answer"s)) == 3.1415927);
739 template <
class GenericMapFactory>
741 using factories = boost::mpl::list<GenericMapFactory>;
743 suite->add(BOOST_TEST_CASE_TEMPLATE(TestConstAt, factories));
744 suite->add(BOOST_TEST_CASE_TEMPLATE(TestAt, factories));
745 suite->add(BOOST_TEST_CASE_TEMPLATE(TestEquals, factories));
746 suite->add(BOOST_TEST_CASE_TEMPLATE(TestSize, factories));
747 suite->add(BOOST_TEST_CASE_TEMPLATE(TestWeakContains, factories));
748 suite->add(BOOST_TEST_CASE_TEMPLATE(TestContains, factories));
749 suite->add(BOOST_TEST_CASE_TEMPLATE(TestKeys, factories));
750 suite->add(BOOST_TEST_CASE_TEMPLATE(TestKeyOrder, factories));
751 suite->add(BOOST_TEST_CASE_TEMPLATE(TestConstVisitor, factories));
752 suite->add(BOOST_TEST_CASE_TEMPLATE(TestModifyingVoidVisitor, factories));
753 suite->add(BOOST_TEST_CASE_TEMPLATE(TestModifyingReturningVisitor, factories));
765 template <
class GenericMapFactory>
767 using factories = boost::mpl::list<GenericMapFactory>;
769 addGenericMapTestCases<GenericMapFactory>(suite);
771 suite->add(BOOST_TEST_CASE_TEMPLATE(TestMutableEquals, factories));
772 suite->add(BOOST_TEST_CASE_TEMPLATE(TestMutableSize, factories));
773 suite->add(BOOST_TEST_CASE_TEMPLATE(TestClear, factories));
774 suite->add(BOOST_TEST_CASE_TEMPLATE(TestClearIdempotent, factories));
775 suite->add(BOOST_TEST_CASE_TEMPLATE(TestInsertInt, factories));
776 suite->add(BOOST_TEST_CASE_TEMPLATE(TestInsertString, factories));
777 suite->add(BOOST_TEST_CASE_TEMPLATE(TestInsertStorable, factories));
778 suite->add(BOOST_TEST_CASE_TEMPLATE(TestInterleavedInserts, factories));
779 suite->add(BOOST_TEST_CASE_TEMPLATE(TestErase, factories));
780 suite->add(BOOST_TEST_CASE_TEMPLATE(TestInsertEraseInsert, factories));
791 template <
class GenericMapFactory>
793 addGenericMapTestCases<GenericMapFactory>(&(boost::unit_test::framework::master_test_suite()));
805 template <
class GenericMapFactory>
807 addMutableGenericMapTestCases<GenericMapFactory>(&(boost::unit_test::framework::master_test_suite()));
Interface supporting iteration over heterogenous containers.
BOOST_TEST_CASE_TEMPLATE_FUNCTION(TestConstAt, GenericMapFactory)
ItemVariant const * other
std::size_t hash_value(Extent< T, N > const &extent) noexcept
constexpr Key< K, V > makeKey(K const &id)
Factory function for Key, to enable type parameter inference.
void addMutableGenericMapTestCases(boost::unit_test::test_suite *const suite)
Create generic test cases for a specific MutableGenericMap implementation.
A base class for image defects.
Abstract factory that creates GenericMap and MutableGenericMap instances as needed.
void addGenericMapTestCases(boost::unit_test::test_suite *const suite)
Create generic test cases for a specific GenericMap implementation.