diff --git a/root/meta/ROOT-10804/CMakeLists.txt b/root/meta/ROOT-10804/CMakeLists.txt index 4aca5a8e44..1b036534c9 100644 --- a/root/meta/ROOT-10804/CMakeLists.txt +++ b/root/meta/ROOT-10804/CMakeLists.txt @@ -1,8 +1,62 @@ ROOTTEST_GENERATE_REFLEX_DICTIONARY(ROOT10804 ROOT10804.h SELECTION selection.xml) set(depends ${GENERATE_REFLEX_TEST}) -ROOTTEST_ADD_TEST(execROOT10804 - MACRO execROOT10804.C - OUTREF execROOT10804.oref - ERRREF execROOT10804.eref - DEPENDS ${depends}) +# Class names starting with '!': check that they do *not* have a protoclass. +set(CLASSES_TO_TEST + "Outer::Inline::Class" + "Outer::Class" + + "list" + "list" + "std::list" + "std::list" + + "Outer::Container" + "Outer::Container" + + "Outer::Inline::Template" + "Outer::Template" + "Outer::Inline::Template" + "Outer::Template" + + "Outer::Container>" + "Outer::Container>" + "Outer::Container>>" + + "Outer::Container>" + + # Container is not `Inline::`: + "!Outer::Inline::Container>" + + # Float16_t won't get a demangled alternate name, + # only as-written-in-selection.xml + "Outer::Template" + + # Found because of fwd decl of Inline as inline: + "Outer::Inline::Template" + + # Double32_t won't get a demangled alternate name, + # only as-written-in-selection.xml + "Outer::Container>" + # Found because of fwd decl of Inline as inline: + "Outer::Container>" + + # Cross-check: not selected. + "!Outer::Container" + "!Outer::Container>" + "!Outer::Template" # but did select Template! + ) + +list(LENGTH CLASSES_TO_TEST LEN_CLASSES_TO_TEST) +math(EXPR LAST_CLASS_TO_TEST ${LEN_CLASSES_TO_TEST}-1) +# foreach takes *last*, not num-elements :-( +foreach(INDEX RANGE ${LAST_CLASS_TO_TEST}) + list(GET CLASSES_TO_TEST ${INDEX} TEST_CLASS) + + ROOTTEST_ADD_TEST(execROOT10804_${INDEX} + MACRO execROOT10804.C + MACROARG "\"${TEST_CLASS}\"" + OUTREF execROOT10804.oref + ERRREF execROOT10804.eref + DEPENDS ${depends}) +endforeach() diff --git a/root/meta/ROOT-10804/execROOT10804.C b/root/meta/ROOT-10804/execROOT10804.C index 34d434c4ce..d10056e74b 100644 --- a/root/meta/ROOT-10804/execROOT10804.C +++ b/root/meta/ROOT-10804/execROOT10804.C @@ -15,71 +15,15 @@ void check_not(const char *what) { } } -int execROOT10804() { +int execROOT10804(const char *className) { if (gSystem->Load("libROOT10804_dictrflx") < 0) { std::cerr << "Failed to load ROOT10804Dict!\n"; return 1; } - check("Outer::Inline::Class"); - check("Outer::Class"); + if (className[0] == '!') + check_not(className + 1); + else + check(className); - check("list"); - check("list"); - check("std::list"); - check("std::list"); - - check("Outer::Container"); - check("Outer::Container"); - check("Outer::Container"); - - check("Outer::Inline::Template"); - check("Outer::Template"); - check("Outer::Inline::Template"); - check("Outer::Template"); - - check("Outer::Container<" - "Outer::Inline::Template<" - "Outer::Inline::Class>>"); - - check("Outer::Container<" - "Outer::Inline::Template<" - "Outer::Inline::Class>>>"); - - check("Outer::Container<" - "Outer::Inline::Template<" - "Outer::Class>>"); - check("Outer::Container<" - "Outer::Template<" - "Outer::Inline::Class>>"); - - check("Outer::Container<" - "Outer::Template<" - "Outer::Class>>"); - - // Container is not Inline:: - check_not("Outer::Inline::Container<" - "Outer::Inline::Template<" - "Outer::Inline::Class>>"); - - // Float16_t won't get a demangled alternate name, - // only as-written-in-selection.xml - check("Outer::Template"); - // FIXME: can be resolved now that the payload has been parsed. - // And that shows that the test needs to check *one* type name only, - // before parsing the payload. - //!!! check_not("Outer::Inline::Template"); - - // Double32_t won't get a demangled alternate name, - // only as-written-in-selection.xml - check("Outer::Container>"); - // FIXME: can be resolved now that the payload has been parsed. - // And that shows that the test needs to check *one* type name only, - // before parsing the payload. - //!!! check_not("Outer::Container>"); - - // Cross-check: not selected. - check_not("Outer::Container"); - check_not("Outer::Container>"); - check_not("Outer::Template"); // but did select Template! return numErrors ? 1 : 0; }