mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 11:39:49 -06:00
Add Range checks to unit tests
This commit is contained in:
@@ -55,7 +55,6 @@ struct Verifier {
|
||||
virtual std::string documentation() const = 0;
|
||||
};
|
||||
|
||||
|
||||
struct DocumentationEntry {
|
||||
DocumentationEntry(std::string key, Verifier* t, Optional optional = Optional::No,
|
||||
std::string doc = "");
|
||||
|
||||
@@ -78,6 +78,13 @@ TEST_F(DocumentationTest, Constructor) {
|
||||
doc.emplace_back("NotInListInt", new IntNotInListVerifier({ 0, 1 }));
|
||||
doc.emplace_back("NotInListString", new StringNotInListVerifier({ "", "a" }));
|
||||
|
||||
// Range Verifiers
|
||||
doc.emplace_back("InListDouble", new DoubleInRangeVerifier({ 0.0, 1.0 }));
|
||||
doc.emplace_back("InListInt", new IntInRangeVerifier({ 0, 1 }));
|
||||
|
||||
doc.emplace_back("NotInListDouble", new DoubleNotInRangeVerifier({ 0.0, 1.0 }));
|
||||
doc.emplace_back("NotInListInt", new IntNotInRangeVerifier({ 0, 1 }));
|
||||
|
||||
// Misc Verifiers
|
||||
doc.emplace_back("AnnotationBool", new BoolAnnotationVerifier("Bool"));
|
||||
doc.emplace_back("AnnotationDouble", new DoubleAnnotationVerifier("Double"));
|
||||
@@ -131,6 +138,13 @@ TEST_F(DocumentationTest, InitializerConstructor) {
|
||||
{"NotInListInt", new IntNotInListVerifier({ 0, 1 })},
|
||||
{"NotInListString", new StringNotInListVerifier({ "", "a" })},
|
||||
|
||||
// Range Verifiers
|
||||
{"InRangeDouble", new DoubleInRangeVerifier{{0.0, 1.0}},
|
||||
{"InRangeInt", new IntInRangeVerifier{{0, 1}},
|
||||
|
||||
{"InRangeDouble", new DoubleNotInRangeVerifier{{ 0.0, 1.0 }},
|
||||
{"InRangeInt", new IntNotInRangeVerifier{{ 0, 1 }},
|
||||
|
||||
// Misc Verifiers
|
||||
{"AnnotationBool", new BoolAnnotationVerifier("Bool")},
|
||||
{"AnnotationDouble", new DoubleAnnotationVerifier("Double")},
|
||||
|
||||
Reference in New Issue
Block a user