diff --git a/FWCore/ParameterSet/test/BuildFile.xml b/FWCore/ParameterSet/test/BuildFile.xml
index f46a56b75d474..af77e27b94d1c 100644
--- a/FWCore/ParameterSet/test/BuildFile.xml
+++ b/FWCore/ParameterSet/test/BuildFile.xml
@@ -2,11 +2,6 @@
-
-
-
-
-
diff --git a/FWCore/ParameterSet/test/parameterSetDescription_t.cc b/FWCore/ParameterSet/test/test_catch_ParameterSetDescription.cc
similarity index 60%
rename from FWCore/ParameterSet/test/parameterSetDescription_t.cc
rename to FWCore/ParameterSet/test/test_catch_ParameterSetDescription.cc
index f6a888284cdc8..af7e9eb2891cf 100644
--- a/FWCore/ParameterSet/test/parameterSetDescription_t.cc
+++ b/FWCore/ParameterSet/test/test_catch_ParameterSetDescription.cc
@@ -2,6 +2,8 @@
// Test code for the ParameterSetDescription and ParameterDescription
// classes.
+#include "catch.hpp"
+
#include "DataFormats/Provenance/interface/EventID.h"
#include "DataFormats/Provenance/interface/LuminosityBlockID.h"
#include "FWCore/ParameterSet/interface/AllowedLabelsDescription.h"
@@ -34,22 +36,38 @@ namespace testParameterSetDescription {
edm::ParameterSet& pset,
bool exists,
bool validates) {
- assert(node.exists(pset) == exists);
- assert(node.partiallyExists(pset) == exists);
- assert(node.howManyXORSubNodesExist(pset) == (exists ? 1 : 0));
+ CHECK(node.exists(pset) == exists);
+ CHECK(node.partiallyExists(pset) == exists);
+ CHECK(node.howManyXORSubNodesExist(pset) == (exists ? 1 : 0));
if (validates) {
psetDesc.validate(pset);
} else {
- try {
- psetDesc.validate(pset);
- assert(0);
- } catch (edm::Exception const&) {
- // There should be an exception
- }
+ REQUIRE_THROWS_AS(psetDesc.validate(pset), edm::Exception);
}
}
- void testWildcards() {
+ struct TestPluginBase {
+ virtual ~TestPluginBase() = default;
+ };
+
+ struct ATestPlugin : public TestPluginBase {
+ static void fillPSetDescription(edm::ParameterSetDescription& iPS) { iPS.add("anInt", 5); }
+ };
+
+ struct BTestPlugin : public TestPluginBase {
+ static void fillPSetDescription(edm::ParameterSetDescription& iPS) { iPS.add("aDouble", 0.5); }
+ };
+
+ using TestPluginFactory = edmplugin::PluginFactory;
+
+} // namespace testParameterSetDescription
+
+using TestPluginFactory = testParameterSetDescription::TestPluginFactory;
+
+using testParameterSetDescription::testDesc;
+
+TEST_CASE("test ParameterSetDescription", "[ParameterSetDescription]") {
+ SECTION("testWildcards") {
{
edm::ParameterSetDescription set;
edm::ParameterWildcard w("*", edm::RequireZeroOrMore, true);
@@ -117,20 +135,10 @@ namespace testParameterSetDescription {
edm::ParameterWildcard w("*", edm::RequireAtLeastOne, true);
set.addNode(w);
set.add("testTypeChecking1", 11);
- try {
- set.add("testTypeChecking2", 11.0);
- assert(0);
- } catch (edm::Exception const&) {
- // There should be an exception
- }
+ REQUIRE_THROWS_AS(set.add("testTypeChecking2", 11.0), edm::Exception);
}
- try {
- edm::ParameterWildcard wrong("a*", edm::RequireZeroOrMore, true);
- assert(0);
- } catch (edm::Exception const&) {
- // There should be an exception
- }
+ REQUIRE_THROWS_AS(edm::ParameterWildcard("a*", edm::RequireZeroOrMore, true), edm::Exception);
edm::ParameterSet nestedPset;
nestedPset.addUntrackedParameter("n1", 1);
@@ -293,11 +301,9 @@ namespace testParameterSetDescription {
pset.addParameter>("nested2", nestedVPset);
testDesc(w, set, pset, true, true);
}
-
- return;
}
- void testWildcardWithExceptions() {
+ SECTION("testWildcardWithExceptions") {
{
edm::ParameterSetDescription set;
@@ -347,77 +353,62 @@ namespace testParameterSetDescription {
// ---------------------------------------------------------------------------------
- void testAllowedValues() {
+ SECTION("testAllowedValues") {
// Duplicate case values not allowed
edm::ParameterSetDescription psetDesc;
psetDesc.ifValue(edm::ParameterDescription("sswitch", "a", true),
edm::allowedValues("a", "h", "z"));
}
- void testSwitch() {
+ SECTION("testSwitch") {
// Duplicate case values not allowed
edm::ParameterSetDescription psetDesc;
- try {
- psetDesc.ifValue(edm::ParameterDescription("oiswitch", 1, true),
- 0 >> edm::ParameterDescription("oivalue", 100, true) or
- 1 >> (edm::ParameterDescription("oivalue1", 101.0, true) and
- edm::ParameterDescription("oivalue2", 101.0, true)) or
- 1 >> edm::ParameterDescription("oivalue", "102", true));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc.ifValue(edm::ParameterDescription("oiswitch", 1, true),
+ 0 >> edm::ParameterDescription("oivalue", 100, true) or
+ 1 >> (edm::ParameterDescription("oivalue1", 101.0, true) and
+ edm::ParameterDescription("oivalue2", 101.0, true)) or
+ 1 >> edm::ParameterDescription("oivalue", "102", true)),
+ edm::Exception);
// Types used in case parameters cannot duplicate type already used in a wildcard
edm::ParameterSetDescription psetDesc1;
edm::ParameterWildcard w("*", edm::RequireAtLeastOne, true);
psetDesc1.addNode(w);
- try {
- psetDesc1.ifValue(edm::ParameterDescription("oiswitch", 1, true),
- 0 >> edm::ParameterDescription("oivalue", 100, true) or
- 1 >> (edm::ParameterDescription("oivalue1", 101.0, true) and
- edm::ParameterDescription("oivalue2", 101.0, true)) or
- 2 >> edm::ParameterDescription("oivalue", "102", true));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc1.ifValue(edm::ParameterDescription("oiswitch", 1, true),
+ 0 >> edm::ParameterDescription("oivalue", 100, true) or
+ 1 >> (edm::ParameterDescription("oivalue1", 101.0, true) and
+ edm::ParameterDescription("oivalue2", 101.0, true)) or
+ 2 >> edm::ParameterDescription("oivalue", "102", true)),
+ edm::Exception);
// Types used in the switch parameter cannot duplicate type already used in a wildcard
edm::ParameterSetDescription psetDesc2;
edm::ParameterWildcard w1("*", edm::RequireAtLeastOne, true);
psetDesc2.addNode(w1);
- try {
- psetDesc2.ifValue(edm::ParameterDescription("aswitch", 1, true),
- 1 >> (edm::ParameterDescription("avalue1", 101, true) and
- edm::ParameterDescription("avalue2", 101, true)) or
- 2 >> edm::ParameterDescription("avalue", "102", true));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc2.ifValue(edm::ParameterDescription("aswitch", 1, true),
+ 1 >> (edm::ParameterDescription("avalue1", 101, true) and
+ edm::ParameterDescription("avalue2", 101, true)) or
+ 2 >> edm::ParameterDescription("avalue", "102", true)),
+ edm::Exception);
// Type used in the switch parameter cannot duplicate type in a case wildcard
edm::ParameterSetDescription psetDesc3;
- try {
- psetDesc3.ifValue(edm::ParameterDescription("xswitch", 1, true),
- 0 >> edm::ParameterWildcard("*", edm::RequireAtLeastOne, true) or
- 1 >> (edm::ParameterDescription("xvalue1", 101.0, true) and
- edm::ParameterDescription("xvalue2", 101.0, true)));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc3.ifValue(edm::ParameterDescription("xswitch", 1, true),
+ 0 >> edm::ParameterWildcard("*", edm::RequireAtLeastOne, true) or
+ 1 >> (edm::ParameterDescription("xvalue1", 101.0, true) and
+ edm::ParameterDescription("xvalue2", 101.0, true))),
+ edm::Exception);
// Type used in a parameter cannot duplicate type in a case wildcard
edm::ParameterSetDescription psetDesc4;
psetDesc4.add("testunsigned", 1U);
- try {
- psetDesc4.ifValue(edm::ParameterDescription("xswitch", 1, true),
- 0 >> edm::ParameterWildcard("*", edm::RequireAtLeastOne, true) or
- 1 >> (edm::ParameterDescription("xvalue1", 101.0, true) and
- edm::ParameterDescription("xvalue2", 101.0, true)));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc4.ifValue(edm::ParameterDescription("xswitch", 1, true),
+ 0 >> edm::ParameterWildcard("*", edm::RequireAtLeastOne, true) or
+ 1 >> (edm::ParameterDescription("xvalue1", 101.0, true) and
+ edm::ParameterDescription("xvalue2", 101.0, true))),
+ edm::Exception);
// No problem is wildcard type and parameter type are the same for different cases.
edm::ParameterSetDescription psetDesc5;
@@ -429,51 +420,39 @@ namespace testParameterSetDescription {
// The switch parameter label cannot be the same as a label that already exists
edm::ParameterSetDescription psetDesc6;
psetDesc6.add("xswitch", 1U);
- try {
- psetDesc6.ifValue(edm::ParameterDescription("xswitch", 1, true),
- 0 >> edm::ParameterWildcard("*", edm::RequireAtLeastOne, true) or
- 1 >> (edm::ParameterDescription("xvalue1", 101.0, true) and
- edm::ParameterDescription("xvalue2", 101.0, true)));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc6.ifValue(edm::ParameterDescription("xswitch", 1, true),
+ 0 >> edm::ParameterWildcard("*", edm::RequireAtLeastOne, true) or
+ 1 >> (edm::ParameterDescription("xvalue1", 101.0, true) and
+ edm::ParameterDescription("xvalue2", 101.0, true))),
+ edm::Exception);
// Case labels cannot be the same as a label that already exists
edm::ParameterSetDescription psetDesc7;
psetDesc7.add("xvalue1", 1U);
- try {
- psetDesc7.ifValue(edm::ParameterDescription("xswitch", 1, true),
- 0 >> edm::ParameterWildcard("*", edm::RequireAtLeastOne, true) or
- 1 >> (edm::ParameterDescription("xvalue1", 101.0, true) and
- edm::ParameterDescription("xvalue2", 101.0, true)));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc7.ifValue(edm::ParameterDescription("xswitch", 1, true),
+ 0 >> edm::ParameterWildcard("*", edm::RequireAtLeastOne, true) or
+ 1 >> (edm::ParameterDescription("xvalue1", 101.0, true) and
+ edm::ParameterDescription("xvalue2", 101.0, true))),
+ edm::Exception);
// Case labels cannot be the same as a switch label
edm::ParameterSetDescription psetDesc8;
- try {
- psetDesc8.ifValue(edm::ParameterDescription("xswitch", 1, true),
- 0 >> edm::ParameterWildcard("*", edm::RequireAtLeastOne, true) or
- 1 >> (edm::ParameterDescription("xswitch", 101.0, true) and
- edm::ParameterDescription("xvalue2", 101.0, true)));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc8.ifValue(edm::ParameterDescription("xswitch", 1, true),
+ 0 >> edm::ParameterWildcard("*", edm::RequireAtLeastOne, true) or
+ 1 >> (edm::ParameterDescription("xswitch", 101.0, true) and
+ edm::ParameterDescription("xvalue2", 101.0, true))),
+ edm::Exception);
// Parameter set switch value must be one of the defined cases
edm::ParameterSetDescription psetDesc9;
- try {
- psetDesc9.ifValue(edm::ParameterDescription("xswitch", 1, true),
- 0 >> edm::ParameterWildcard("*", edm::RequireAtLeastOne, true) or
- 1 >> (edm::ParameterDescription("xvalue1", 101.0, true) and
- edm::ParameterDescription("xvalue2", 101.0, true)));
- edm::ParameterSet pset;
- pset.addParameter("xswitch", 5);
- psetDesc9.validate(pset);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+
+ psetDesc9.ifValue(edm::ParameterDescription("xswitch", 1, true),
+ 0 >> edm::ParameterWildcard("*", edm::RequireAtLeastOne, true) or
+ 1 >> (edm::ParameterDescription("xvalue1", 101.0, true) and
+ edm::ParameterDescription("xvalue2", 101.0, true)));
+ edm::ParameterSet pset;
+ pset.addParameter("xswitch", 5);
+ REQUIRE_THROWS_AS(psetDesc9.validate(pset), edm::Exception);
edm::ParameterSwitch pswitch(edm::ParameterDescription("xswitch", 1, true),
0 >> edm::ParameterWildcard("*", edm::RequireAtLeastOne, true) or
@@ -489,7 +468,7 @@ namespace testParameterSetDescription {
// ---------------------------------------------------------------------------------
- void testXor() {
+ SECTION("testXor") {
edm::ParameterSetDescription psetDesc1;
std::unique_ptr node1(
edm::ParameterDescription("x1", 101.0, true) xor
@@ -504,28 +483,20 @@ namespace testParameterSetDescription {
pset2.addParameter("x1", 11.0);
pset2.addParameter("x2", 12.0);
- assert(node1->exists(pset1) == false);
- assert(node1->partiallyExists(pset1) == false);
- assert(node1->howManyXORSubNodesExist(pset1) == 0);
+ CHECK(node1->exists(pset1) == false);
+ CHECK(node1->partiallyExists(pset1) == false);
+ CHECK(node1->howManyXORSubNodesExist(pset1) == 0);
- assert(node1->exists(pset2) == false);
- assert(node1->partiallyExists(pset2) == false);
- assert(node1->howManyXORSubNodesExist(pset2) == 4);
+ CHECK(node1->exists(pset2) == false);
+ CHECK(node1->partiallyExists(pset2) == false);
+ CHECK(node1->howManyXORSubNodesExist(pset2) == 4);
// 0 of the options existing should fail validation
psetDesc1.addNode(std::move(node1));
- try {
- psetDesc1.validate(pset1);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc1.validate(pset1), edm::Exception);
// More than one of the options existing should also fail
- try {
- psetDesc1.validate(pset2);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc1.validate(pset2), edm::Exception);
// One of the labels cannot already exist in the description
edm::ParameterSetDescription psetDesc2;
@@ -536,11 +507,7 @@ namespace testParameterSetDescription {
edm::ParameterDescription("x1", 101.0, true) xor
(edm::ParameterDescription("xvalue1", 101.0, true) or
edm::ParameterDescription("x2", 101.0, true)));
- try {
- psetDesc2.addNode(std::move(node2));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc2.addNode(std::move(node2)), edm::Exception);
// One of the labels cannot already exist in the description, other order
edm::ParameterSetDescription psetDesc3;
@@ -551,11 +518,7 @@ namespace testParameterSetDescription {
(edm::ParameterDescription("xvalue1", 101.0, true) or
edm::ParameterDescription("x2", 101.0, true)));
psetDesc3.addNode(std::move(node3));
- try {
- psetDesc3.add("xvalue1", 1U);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc3.add("xvalue1", 1U), edm::Exception);
// A parameter cannot use the same type as a wildcard
edm::ParameterSetDescription psetDesc4;
@@ -568,11 +531,7 @@ namespace testParameterSetDescription {
psetDesc4.addNode(std::move(node4));
edm::ParameterWildcard w4("*", edm::RequireAtLeastOne, true);
- try {
- psetDesc4.addNode(w4);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc4.addNode(w4), edm::Exception);
// A parameter cannot use the same type as a wildcard
edm::ParameterSetDescription psetDesc5;
@@ -586,16 +545,12 @@ namespace testParameterSetDescription {
psetDesc5.addNode(std::move(node5));
edm::ParameterDescription n5("z5", edm::RequireAtLeastOne, true);
- try {
- psetDesc5.addNode(n5);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc5.addNode(n5), edm::Exception);
}
// ---------------------------------------------------------------------------------
- void testOr() {
+ SECTION("testOr") {
edm::ParameterSetDescription psetDesc1;
std::unique_ptr node1(edm::ParameterDescription("x1", 101.0, true) or
(edm::ParameterDescription("x2", 101.0, true) and
@@ -613,13 +568,13 @@ namespace testParameterSetDescription {
pset2.addParameter("x4", 14.0);
pset2.addParameter("x5", 15.0);
- assert(node1->exists(pset1) == false);
- assert(node1->partiallyExists(pset1) == false);
- assert(node1->howManyXORSubNodesExist(pset1) == 0);
+ CHECK(node1->exists(pset1) == false);
+ CHECK(node1->partiallyExists(pset1) == false);
+ CHECK(node1->howManyXORSubNodesExist(pset1) == 0);
- assert(node1->exists(pset2) == true);
- assert(node1->partiallyExists(pset2) == true);
- assert(node1->howManyXORSubNodesExist(pset2) == 1);
+ CHECK(node1->exists(pset2) == true);
+ CHECK(node1->partiallyExists(pset2) == true);
+ CHECK(node1->howManyXORSubNodesExist(pset2) == 1);
// 0 of the options existing should fail validation
psetDesc1.addNode(std::move(node1));
@@ -635,11 +590,7 @@ namespace testParameterSetDescription {
(edm::ParameterDescription("x2", 101.0, true) and
edm::ParameterDescription("x3", 101.0, true)) or
edm::ParameterDescription("x4", 101.0, true));
- try {
- psetDesc2.addNode(std::move(node2));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc2.addNode(std::move(node2)), edm::Exception);
// One of the labels cannot already exist in the description, other order
edm::ParameterSetDescription psetDesc3;
@@ -649,11 +600,7 @@ namespace testParameterSetDescription {
edm::ParameterDescription("x4", 101.0, true));
psetDesc3.addNode(std::move(node3));
- try {
- psetDesc3.add("x1", 1U);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc3.add("x1", 1U), edm::Exception);
// Put the duplicate labels in different nodes of the "or" expression
edm::ParameterSetDescription psetDesc4;
@@ -661,11 +608,7 @@ namespace testParameterSetDescription {
(edm::ParameterDescription("x2", 101.0, true) and
edm::ParameterDescription("x3", 101.0, true)) or
edm::ParameterDescription("x1", 101.0, true));
- try {
- psetDesc4.addNode(std::move(node4));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc4.addNode(std::move(node4)), edm::Exception);
// A type used in a wildcard should not be the same as a type
// used for another parameter
@@ -675,11 +618,7 @@ namespace testParameterSetDescription {
(edm::ParameterDescription("x2", 101.0, true) and
edm::ParameterDescription("x3", 101U, true)) or
edm::ParameterDescription("x1", 101U, true));
- try {
- psetDesc5.addNode(std::move(node5));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc5.addNode(std::move(node5)), edm::Exception);
// A type used in a wildcard should not be the same as a type
// used for another parameter node
@@ -690,11 +629,7 @@ namespace testParameterSetDescription {
(edm::ParameterDescription("x2", 101U, true) and
edm::ParameterDescription("x3", 101U, true)) or
edm::ParameterDescription("x1", 101U, true));
- try {
- psetDesc6.addNode(std::move(node6));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc6.addNode(std::move(node6)), edm::Exception);
// A type used in a wildcard should not be the same as a type
// used for another parameter node
@@ -704,16 +639,12 @@ namespace testParameterSetDescription {
(edm::ParameterDescription("x2", 101U, true) and
edm::ParameterDescription("x3", 101U, true)) or
edm::ParameterDescription("x1", 101U, true));
- try {
- psetDesc7.addNode(std::move(node7));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc7.addNode(std::move(node7)), edm::Exception);
}
// ---------------------------------------------------------------------------------
- void testAnd() {
+ SECTION("testAnd") {
edm::ParameterSetDescription psetDesc1;
std::unique_ptr node1(edm::ParameterDescription("x1", 101.0, true) and
(edm::ParameterDescription("x2", 101.0, true) or
@@ -734,17 +665,17 @@ namespace testParameterSetDescription {
edm::ParameterSet pset3;
pset3.addParameter("x3", 13.0);
- assert(node1->exists(pset1) == false);
- assert(node1->partiallyExists(pset1) == false);
- assert(node1->howManyXORSubNodesExist(pset1) == 0);
+ CHECK(node1->exists(pset1) == false);
+ CHECK(node1->partiallyExists(pset1) == false);
+ CHECK(node1->howManyXORSubNodesExist(pset1) == 0);
- assert(node1->exists(pset2) == true);
- assert(node1->partiallyExists(pset2) == true);
- assert(node1->howManyXORSubNodesExist(pset2) == 1);
+ CHECK(node1->exists(pset2) == true);
+ CHECK(node1->partiallyExists(pset2) == true);
+ CHECK(node1->howManyXORSubNodesExist(pset2) == 1);
- assert(node1->exists(pset3) == false);
- assert(node1->partiallyExists(pset3) == true);
- assert(node1->howManyXORSubNodesExist(pset3) == 0);
+ CHECK(node1->exists(pset3) == false);
+ CHECK(node1->partiallyExists(pset3) == true);
+ CHECK(node1->howManyXORSubNodesExist(pset3) == 0);
psetDesc1.addNode(std::move(node1));
psetDesc1.validate(pset1);
@@ -758,11 +689,7 @@ namespace testParameterSetDescription {
(edm::ParameterDescription("x2", 101.0, true) or
edm::ParameterDescription("x3", 101.0, true)) and
edm::ParameterDescription("x4", 101.0, true));
- try {
- psetDesc2.addNode(std::move(node2));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc2.addNode(std::move(node2)), edm::Exception);
// One of the labels cannot already exist in the description, other order
edm::ParameterSetDescription psetDesc3;
@@ -772,11 +699,7 @@ namespace testParameterSetDescription {
edm::ParameterDescription("x4", 101.0, true));
psetDesc3.addNode(std::move(node3));
- try {
- psetDesc3.add("x1", 1U);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc3.add("x1", 1U), edm::Exception);
// Put the duplicate labels in different nodes of the "and" expression
edm::ParameterSetDescription psetDesc4;
@@ -784,11 +707,7 @@ namespace testParameterSetDescription {
(edm::ParameterDescription("x2", 101.0, true) or
edm::ParameterDescription("x3", 101.0, true)) and
edm::ParameterDescription("x1", 101.0, true));
- try {
- psetDesc4.addNode(std::move(node4));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc4.addNode(std::move(node4)), edm::Exception);
// A type used in a wildcard should not be the same as a type
// used for another parameter
@@ -798,11 +717,7 @@ namespace testParameterSetDescription {
(edm::ParameterDescription("x2", 101.0, true) or
edm::ParameterDescription("x3", 101U, true)) and
edm::ParameterDescription("x1", 101U, true));
- try {
- psetDesc5.addNode(std::move(node5));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc5.addNode(std::move(node5)), edm::Exception);
// A type used in a wildcard should not be the same as a type
// used for another parameter node
@@ -813,11 +728,7 @@ namespace testParameterSetDescription {
(edm::ParameterDescription("x2", 101U, true) or
edm::ParameterDescription("x3", 101U, true)) and
edm::ParameterDescription("x1", 101U, true));
- try {
- psetDesc6.addNode(std::move(node6));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc6.addNode(std::move(node6)), edm::Exception);
// A type used in a wildcard should not be the same as a type
// used for another parameter node
@@ -827,16 +738,12 @@ namespace testParameterSetDescription {
(edm::ParameterDescription("x2", 101U, true) or
edm::ParameterDescription("x3", 101U, true)) and
edm::ParameterDescription("x1", 101U, true));
- try {
- psetDesc7.addNode(std::move(node7));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc7.addNode(std::move(node7)), edm::Exception);
}
// ---------------------------------------------------------------------------------
- void testIfExists() {
+ SECTION("testIfExists") {
edm::ParameterSetDescription psetDesc1;
std::unique_ptr node1(
std::make_unique(edm::ParameterDescription("x1", 101.0, true),
@@ -866,29 +773,29 @@ namespace testParameterSetDescription {
pset4.addParameter("x2", 15.0);
pset4.addParameter("x3", 16.0);
- assert(node1->exists(pset1) == true);
- assert(node1->partiallyExists(pset1) == true);
- assert(node1->howManyXORSubNodesExist(pset1) == 1);
- assert(node1a->exists(pset1) == true);
- assert(node1b->exists(pset1) == true);
-
- assert(node1->exists(pset2) == true);
- assert(node1->partiallyExists(pset2) == true);
- assert(node1->howManyXORSubNodesExist(pset2) == 1);
- assert(node1a->exists(pset2) == true);
- assert(node1b->exists(pset2) == true);
-
- assert(node1->exists(pset3) == false);
- assert(node1->partiallyExists(pset3) == false);
- assert(node1->howManyXORSubNodesExist(pset3) == 0);
- assert(node1a->exists(pset3) == false);
- assert(node1b->exists(pset3) == false);
-
- assert(node1->exists(pset4) == false);
- assert(node1->partiallyExists(pset4) == false);
- assert(node1->howManyXORSubNodesExist(pset4) == 0);
- assert(node1a->exists(pset4) == false);
- assert(node1b->exists(pset4) == false);
+ CHECK(node1->exists(pset1) == true);
+ CHECK(node1->partiallyExists(pset1) == true);
+ CHECK(node1->howManyXORSubNodesExist(pset1) == 1);
+ CHECK(node1a->exists(pset1) == true);
+ CHECK(node1b->exists(pset1) == true);
+
+ CHECK(node1->exists(pset2) == true);
+ CHECK(node1->partiallyExists(pset2) == true);
+ CHECK(node1->howManyXORSubNodesExist(pset2) == 1);
+ CHECK(node1a->exists(pset2) == true);
+ CHECK(node1b->exists(pset2) == true);
+
+ CHECK(node1->exists(pset3) == false);
+ CHECK(node1->partiallyExists(pset3) == false);
+ CHECK(node1->howManyXORSubNodesExist(pset3) == 0);
+ CHECK(node1a->exists(pset3) == false);
+ CHECK(node1b->exists(pset3) == false);
+
+ CHECK(node1->exists(pset4) == false);
+ CHECK(node1->partiallyExists(pset4) == false);
+ CHECK(node1->howManyXORSubNodesExist(pset4) == 0);
+ CHECK(node1a->exists(pset4) == false);
+ CHECK(node1b->exists(pset4) == false);
psetDesc1.addNode(std::move(node1));
psetDesc1.validate(pset1);
@@ -904,11 +811,7 @@ namespace testParameterSetDescription {
(edm::ParameterDescription("x2", 101.0, true) and
edm::ParameterDescription("x3", 101.0, true))));
- try {
- psetDesc2.addNode(std::move(node2));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc2.addNode(std::move(node2)), edm::Exception);
// One of the labels cannot already exist in the description, other order
edm::ParameterSetDescription psetDesc3;
@@ -918,11 +821,7 @@ namespace testParameterSetDescription {
edm::ParameterDescription("x3", 101.0, true))));
psetDesc3.addNode(std::move(node3));
- try {
- psetDesc3.add("x1", 1U);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc3.add("x1", 1U), edm::Exception);
// Put the duplicate labels in different nodes of the "and" expression
edm::ParameterSetDescription psetDesc4;
@@ -930,11 +829,7 @@ namespace testParameterSetDescription {
std::make_unique(edm::ParameterDescription("x1", 101.0, true),
(edm::ParameterDescription("x2", 101.0, true) and
edm::ParameterDescription("x1", 101.0, true))));
- try {
- psetDesc4.addNode(std::move(node4));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc4.addNode(std::move(node4)), edm::Exception);
// A type used in a wildcard should not be the same as a type
// used for another parameter
@@ -943,11 +838,7 @@ namespace testParameterSetDescription {
edm::ParameterDescription("x1", 101.0, true),
(edm::ParameterDescription("x2", 101U, true) and
edm::ParameterWildcard("*", edm::RequireAtLeastOne, true))));
- try {
- psetDesc5.addNode(std::move(node5));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc5.addNode(std::move(node5)), edm::Exception);
// A type used in a wildcard should not be the same as a type
// used for another parameter node
@@ -957,11 +848,7 @@ namespace testParameterSetDescription {
std::make_unique(edm::ParameterWildcard("*", edm::RequireAtLeastOne, true),
(edm::ParameterDescription("x2", 101U, true) and
edm::ParameterDescription("x3", 102U, true))));
- try {
- psetDesc6.addNode(std::move(node6));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc6.addNode(std::move(node6)), edm::Exception);
// A type used in a wildcard should not be the same as a type
// used for another parameter node
@@ -971,16 +858,12 @@ namespace testParameterSetDescription {
std::make_unique(edm::ParameterDescription("x1", 11.0, true),
(edm::ParameterDescription("x2", 101U, true) and
edm::ParameterDescription("x3", 102U, true))));
- try {
- psetDesc7.addNode(std::move(node7));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc7.addNode(std::move(node7)), edm::Exception);
}
// ---------------------------------------------------------------------------------
- void testAllowedLabels() {
+ SECTION("testAllowedLabels") {
{
std::unique_ptr node(
std::make_unique>("allowedLabels", true));
@@ -991,13 +874,13 @@ namespace testParameterSetDescription {
std::vector labels;
pset.addParameter>("allowedLabels", labels);
- assert(node->exists(emptyPset) == false);
- assert(node->partiallyExists(emptyPset) == false);
- assert(node->howManyXORSubNodesExist(emptyPset) == 0);
+ CHECK(node->exists(emptyPset) == false);
+ CHECK(node->partiallyExists(emptyPset) == false);
+ CHECK(node->howManyXORSubNodesExist(emptyPset) == 0);
- assert(node->exists(pset) == true);
- assert(node->partiallyExists(pset) == true);
- assert(node->howManyXORSubNodesExist(pset) == 1);
+ CHECK(node->exists(pset) == true);
+ CHECK(node->partiallyExists(pset) == true);
+ CHECK(node->howManyXORSubNodesExist(pset) == 1);
}
{
@@ -1007,11 +890,7 @@ namespace testParameterSetDescription {
std::unique_ptr node(
std::make_unique>("x1", true));
- try {
- psetDesc.addNode(std::move(node));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc.addNode(std::move(node)), edm::Exception);
}
{
@@ -1021,11 +900,7 @@ namespace testParameterSetDescription {
psetDesc.addWildcard>("*");
std::unique_ptr node(
std::make_unique>("x1", true));
- try {
- psetDesc.addNode(std::move(node));
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc.addNode(std::move(node)), edm::Exception);
}
{
edm::ParameterSet pset;
@@ -1038,11 +913,7 @@ namespace testParameterSetDescription {
psetDesc.labelsFrom("allowedLabelsA");
// nestedPset is an illegal parameter
- try {
- psetDesc.validate(pset);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc.validate(pset), edm::Exception);
std::vector labels;
labels.push_back(std::string("nestedPset"));
@@ -1060,11 +931,7 @@ namespace testParameterSetDescription {
psetDesc.labelsFrom("allowedLabelsA", edm::ParameterSetDescription());
// Now it should fail because the description says the nested ParameterSet
// should be empty, but it has parameter "x"
- try {
- psetDesc.validate(pset);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc.validate(pset), edm::Exception);
}
// Now include "x" in the description and it should once again pass validation
@@ -1086,11 +953,7 @@ namespace testParameterSetDescription {
edm::ParameterSetDescription psetDesc;
psetDesc.labelsFrom(std::string("allowedLabelsA"),
edm::ParameterSetDescription());
- try {
- psetDesc.validate(pset);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc.validate(pset), edm::Exception);
}
{
edm::ParameterSetDescription psetDesc;
@@ -1116,11 +979,7 @@ namespace testParameterSetDescription {
psetDesc.labelsFrom>("allowedLabelsC");
// nestedVPSet is an illegal parameter
- try {
- psetDesc.validate(pset);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc.validate(pset), edm::Exception);
std::vector labels;
labels.push_back(std::string("nestedVPSet"));
@@ -1137,11 +996,7 @@ namespace testParameterSetDescription {
psetDesc.labelsFrom>("allowedLabelsC", edm::ParameterSetDescription());
// Now it should fail because the description says the contained vector
// should have empty ParameterSets, but the ParameterSets have parameter "y"
- try {
- psetDesc.validate(pset);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc.validate(pset), edm::Exception);
}
// Now include "y" in the description and it should once again pass validation
@@ -1164,11 +1019,7 @@ namespace testParameterSetDescription {
edm::ParameterSetDescription psetDesc;
psetDesc.labelsFrom>(std::string("allowedLabelsC"),
edm::ParameterSetDescription());
- try {
- psetDesc.validate(pset);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc.validate(pset), edm::Exception);
}
{
edm::ParameterSetDescription psetDesc;
@@ -1179,120 +1030,75 @@ namespace testParameterSetDescription {
}
// ---------------------------------------------------------------------------------
- void testNoDefault() {
+ SECTION("testNoDefault") {
edm::ParameterSetDescription psetDesc;
psetDesc.add("x");
edm::ParameterSet pset;
- try {
- psetDesc.validate(pset);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc.validate(pset), edm::Exception);
pset.addParameter("x", 1);
psetDesc.validate(pset);
psetDesc.addVPSet("y", edm::ParameterSetDescription());
- try {
- psetDesc.validate(pset);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc.validate(pset), edm::Exception);
}
// ---------------------------------------------------------------------------------
- void testWrongTrackiness() {
+ SECTION("testWrongTrackiness") {
edm::ParameterSet pset1;
pset1.addParameter("test1", 1);
edm::ParameterSetDescription psetDesc1;
psetDesc1.addUntracked("test1", 1);
- try {
- psetDesc1.validate(pset1);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc1.validate(pset1), edm::Exception);
edm::ParameterSet pset2;
pset2.addParameter("test2", edm::ParameterSet());
edm::ParameterSetDescription psetDesc2;
psetDesc2.addUntracked("test2", edm::ParameterSetDescription());
- try {
- psetDesc2.validate(pset2);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc2.validate(pset2), edm::Exception);
edm::ParameterSet pset3;
pset3.addParameter>("test3", std::vector());
edm::ParameterSetDescription psetDesc3;
psetDesc3.addVPSetUntracked("test3", edm::ParameterSetDescription());
- try {
- psetDesc3.validate(pset3);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc3.validate(pset3), edm::Exception);
}
// ---------------------------------------------------------------------------------
- void testWrongType() {
+ SECTION("testWrongType") {
edm::ParameterSet pset1;
pset1.addParameter("test1", 1);
edm::ParameterSetDescription psetDesc1;
psetDesc1.add("test1", 1);
- try {
- psetDesc1.validate(pset1);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc1.validate(pset1), edm::Exception);
edm::ParameterSet pset2;
pset2.addParameter("test2", 1);
edm::ParameterSetDescription psetDesc2;
psetDesc2.add("test2", edm::ParameterSetDescription());
- try {
- psetDesc2.validate(pset2);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc2.validate(pset2), edm::Exception);
edm::ParameterSet pset3;
pset3.addParameter("test3", 1);
edm::ParameterSetDescription psetDesc3;
psetDesc3.addVPSetUntracked("test3", edm::ParameterSetDescription());
- try {
- psetDesc3.validate(pset3);
- assert(0);
- } catch (edm::Exception const&) { /* There should be an exception */
- }
+ REQUIRE_THROWS_AS(psetDesc3.validate(pset3), edm::Exception);
}
// ---------------------------------------------------------------------------------
- struct TestPluginBase {
- virtual ~TestPluginBase() = default;
- };
-
- struct ATestPlugin : public TestPluginBase {
- static void fillPSetDescription(edm::ParameterSetDescription& iPS) { iPS.add("anInt", 5); }
- };
-
- struct BTestPlugin : public TestPluginBase {
- static void fillPSetDescription(edm::ParameterSetDescription& iPS) { iPS.add("aDouble", 0.5); }
- };
-
- using TestPluginFactory = edmplugin::PluginFactory;
-
- void testPlugin() {
- edmplugin::PluginManager::configure(edmplugin::standard::config());
+ SECTION("testPlugin") {
+ static std::once_flag flag;
+ std::call_once(flag, []() { edmplugin::PluginManager::configure(edmplugin::standard::config()); });
{
edm::ParameterSetDescription desc;
desc.addNode(edm::PluginDescription("type", true));
@@ -1323,7 +1129,7 @@ namespace testParameterSetDescription {
edm::ParameterSet pset1;
pset1.addParameter("type", "ATestPlugin");
desc.validate(pset1);
- assert(pset1.getParameter("anInt") == 5);
+ CHECK(pset1.getParameter("anInt") == 5);
}
{
@@ -1333,8 +1139,8 @@ namespace testParameterSetDescription {
edm::ParameterSet pset1;
desc.validate(pset1);
- assert(pset1.getParameter("anInt") == 5);
- assert(pset1.getParameter("type") == "ATestPlugin");
+ CHECK(pset1.getParameter("anInt") == 5);
+ CHECK(pset1.getParameter("type") == "ATestPlugin");
}
{
@@ -1347,11 +1153,25 @@ namespace testParameterSetDescription {
pset1.addParameter("anInt", 3);
pset1.addParameter("NotRight", 3);
- try {
- desc.validate(pset1);
- assert(false);
- } catch (edm::Exception const& iException) {
- }
+ REQUIRE_THROWS_AS(desc.validate(pset1), edm::Exception);
+ }
+
+ SECTION("wildcard") {
+ //embedded with wildcard
+ edm::ParameterSetDescription desc;
+ desc.addNode(edm::PluginDescription("type", true));
+ edm::ParameterWildcard w("*", edm::RequireExactlyOne, true, desc);
+
+ edm::ParameterSetDescription top;
+ top.addNode(w);
+
+ edm::ParameterSet pset1;
+ pset1.addParameter("type", "ATestPlugin");
+
+ edm::ParameterSet psetTop;
+ psetTop.addParameter("foo", pset1);
+
+ top.validate(psetTop);
}
{
@@ -1362,11 +1182,7 @@ namespace testParameterSetDescription {
edm::ParameterSet pset1;
pset1.addParameter("anInt", 3);
- try {
- desc.validate(pset1);
- assert(false);
- } catch (edm::Exception const& iException) {
- }
+ REQUIRE_THROWS_AS(desc.validate(pset1), edm::Exception);
}
{
@@ -1377,419 +1193,369 @@ namespace testParameterSetDescription {
edm::ParameterSet pset1;
pset1.addParameter("type", "ZTestPlugin");
- try {
- desc.validate(pset1);
- assert(false);
- } catch (cms::Exception const& iException) {
- //std::cout <("testname", std::string("testvalue"));
- {
- edm::ParameterSetDescription psetDesc;
- assert(!psetDesc.anythingAllowed());
- assert(!psetDesc.isUnknown());
- assert(psetDesc.begin() == psetDesc.end());
+ // Expect this to throw, parameter not in description
+ REQUIRE_THROWS_AS(psetDesc.validate(params), edm::Exception);
- edm::ParameterSet params;
- psetDesc.validate(params);
+ psetDesc.setAllowAnything();
+ CHECK(psetDesc.anythingAllowed());
- params.addParameter("testname", std::string("testvalue"));
+ psetDesc.validate(params);
- // Expect this to throw, parameter not in description
- try {
+ psetDesc.add("testInt", 11);
psetDesc.validate(params);
- assert(0);
- } catch (edm::Exception const&) {
- // OK
+ CHECK(params.exists("testInt"));
}
- psetDesc.setAllowAnything();
- assert(psetDesc.anythingAllowed());
+ {
+ edm::ParameterSetDescription psetDesc;
- psetDesc.validate(params);
+ edm::ParameterSet params;
+ params.addParameter("testname", std::string("testvalue"));
+ psetDesc.setUnknown();
+ CHECK(psetDesc.isUnknown());
- psetDesc.add("testInt", 11);
- psetDesc.validate(params);
- assert(params.exists("testInt"));
- }
+ psetDesc.validate(params);
+ }
+
+ {
+ // Test this type separately because I do not know how to
+ // add an entry into a ParameterSet without FileInPath pointing
+ // at a real file.
+ edm::ParameterSetDescription psetDesc;
+ edm::ParameterDescriptionBase* par = psetDesc.add("fileInPath", edm::FileInPath());
+ CHECK(par->type() == edm::k_FileInPath);
+ CHECK(edm::parameterTypeEnumToString(par->type()) == std::string("FileInPath"));
+ }
- {
edm::ParameterSetDescription psetDesc;
+ edm::ParameterSet pset;
- edm::ParameterSet params;
- params.addParameter("testname", std::string("testvalue"));
- psetDesc.setUnknown();
- assert(psetDesc.isUnknown());
+ psetDesc.reserve(2);
+
+ int a = 1;
+ edm::ParameterDescriptionBase* par = psetDesc.add(std::string("ivalue"), a);
+ CHECK(par->exists(pset) == false);
+ CHECK(par->partiallyExists(pset) == false);
+ CHECK(par->howManyXORSubNodesExist(pset) == 0);
+ pset.addParameter("ivalue", a);
+ CHECK(par != 0);
+ CHECK(par->label() == std::string("ivalue"));
+ CHECK(par->type() == edm::k_int32);
+ CHECK(par->isTracked() == true);
+ CHECK(edm::parameterTypeEnumToString(par->type()) == std::string("int32"));
+ CHECK(par->exists(pset) == true);
+ CHECK(par->partiallyExists(pset) == true);
+ CHECK(par->howManyXORSubNodesExist(pset) == 1);
+
+ edm::ParameterSet psetWrongTrackiness;
+ psetWrongTrackiness.addUntrackedParameter("ivalue", a);
+ REQUIRE_THROWS_AS(psetDesc.validate(psetWrongTrackiness), edm::Exception);
+
+ edm::ParameterSet psetWrongType;
+ psetWrongType.addUntrackedParameter("ivalue", 1U);
+ REQUIRE_THROWS_AS(psetDesc.validate(psetWrongType), edm::Exception);
+
+ edm::ParameterSetDescription::const_iterator parIter = psetDesc.begin();
+ CHECK(parIter->node().operator->() == par);
+
+ unsigned b = 2;
+ par = psetDesc.add("uvalue", b);
+ pset.addParameter("uvalue", b);
+ CHECK(par != 0);
+ CHECK(par->label() == std::string("uvalue"));
+ CHECK(par->type() == edm::k_uint32);
+ CHECK(par->isTracked() == true);
+ CHECK(edm::parameterTypeEnumToString(par->type()) == std::string("uint32"));
+
+ parIter = psetDesc.begin();
+ ++parIter;
+ CHECK(parIter->node().operator->() == par);
+
+ long long c = 3;
+ par = psetDesc.addUntracked(std::string("i64value"), c);
+ pset.addUntrackedParameter("i64value", c);
+ CHECK(par != 0);
+ CHECK(par->label() == std::string("i64value"));
+ CHECK(par->type() == edm::k_int64);
+ CHECK(par->isTracked() == false);
+ CHECK(edm::parameterTypeEnumToString(par->type()) == std::string("int64"));
+
+ unsigned long long d = 4;
+ par = psetDesc.addUntracked("u64value", d);
+ pset.addUntrackedParameter("u64value", d);
+ CHECK(par != 0);
+ CHECK(par->label() == std::string("u64value"));
+ CHECK(par->type() == edm::k_uint64);
+ CHECK(par->isTracked() == false);
+ CHECK(edm::parameterTypeEnumToString(par->type()) == std::string("uint64"));
+
+ double e = 5;
+ par = psetDesc.addOptional(std::string("dvalue"), e);
+ pset.addParameter("dvalue", e);
+ CHECK(par != 0);
+ CHECK(par->label() == std::string("dvalue"));
+ CHECK(par->type() == edm::k_double);
+ CHECK(par->isTracked() == true);
+ CHECK(edm::parameterTypeEnumToString(par->type()) == std::string("double"));
+
+ bool f = true;
+ par = psetDesc.addOptional("bvalue", f);
+ pset.addParameter("bvalue", f);
+ CHECK(par != 0);
+ CHECK(par->label() == std::string("bvalue"));
+ CHECK(par->type() == edm::k_bool);
+ CHECK(par->isTracked() == true);
+ CHECK(edm::parameterTypeEnumToString(par->type()) == std::string("bool"));
+
+ std::string g;
+ par = psetDesc.addOptionalUntracked(std::string("svalue"), g);
+ pset.addUntrackedParameter("svalue", g);
+ CHECK(par != 0);
+ CHECK(par->label() == std::string("svalue"));
+ CHECK(par->type() == edm::k_stringRaw);
+ CHECK(par->isTracked() == false);
+ CHECK(edm::parameterTypeEnumToString(par->type()) == std::string("string"));
+
+ edm::EventID h;
+ par = psetDesc.addOptionalUntracked("evalue", h);
+ pset.addUntrackedParameter("evalue", h);
+ CHECK(par != 0);
+ CHECK(par->label() == std::string("evalue"));
+ CHECK(par->type() == edm::k_EventID);
+ CHECK(par->isTracked() == false);
+ CHECK(edm::parameterTypeEnumToString(par->type()) == std::string("EventID"));
+
+ edm::LuminosityBlockID i;
+ par = psetDesc.add("lvalue", i);
+ pset.addParameter("lvalue", i);
+ CHECK(par->type() == edm::k_LuminosityBlockID);
+ CHECK(edm::parameterTypeEnumToString(par->type()) == std::string("LuminosityBlockID"));
+
+ edm::InputTag j;
+ par = psetDesc.add("input", j);
+ pset.addParameter("input", j);
+ CHECK(par->type() == edm::k_InputTag);
+ CHECK(edm::parameterTypeEnumToString(par->type()) == std::string("InputTag"));
+
+ edm::ESInputTag k;
+ par = psetDesc.add("esinput", k);
+ pset.addParameter