Validator: fix path handling and tests Makefile
This commit is contained in:

committed by
mdavidsaver

parent
452f2379a1
commit
e0d422ffd9
@ -11,7 +11,6 @@
|
||||
|
||||
#include <pv/pvIntrospect.h>
|
||||
|
||||
|
||||
namespace epics { namespace nt {
|
||||
|
||||
/**
|
||||
@ -222,16 +221,18 @@ private:
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::string fieldPath(path.empty() ? name : path + "." + name);
|
||||
|
||||
if (!field) {
|
||||
if (!optional) {
|
||||
result = Fail;
|
||||
errors.push_back(Error(path + "." + name, Error::Type::MissingField));
|
||||
errors.push_back(Error(fieldPath, Error::Type::MissingField));
|
||||
}
|
||||
} else if (!dynamic_cast<T const *>(field.get())) {
|
||||
result = Fail;
|
||||
errors.push_back(Error(path + "." + name, Error::Type::IncorrectType));
|
||||
errors.push_back(Error(fieldPath, Error::Type::IncorrectType));
|
||||
} else if (check) {
|
||||
Result r(field, path + "." + name);
|
||||
Result r(field, fieldPath);
|
||||
*this |= check(r);
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ ntutilsTest_SRCS = ntutilsTest.cpp
|
||||
TESTS += ntutilsTest
|
||||
|
||||
TESTPROD_HOST += validatorTest
|
||||
ntutilsTest_SRCS = validatorTest.cpp
|
||||
validatorTest_SRCS = validatorTest.cpp
|
||||
TESTS += validatorTest
|
||||
|
||||
TESTSCRIPTS_HOST += $(TESTS:%=%.t)
|
||||
|
Reference in New Issue
Block a user