Validator: fix path handling and tests Makefile

This commit is contained in:
Bruno Martins
2019-05-28 12:50:02 -04:00
committed by mdavidsaver
parent 452f2379a1
commit e0d422ffd9
2 changed files with 6 additions and 5 deletions

View File

@ -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);
}

View File

@ -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)