diff --git a/streamingvisitors/src/tests/searchvisitor/searchvisitor_test.cpp b/streamingvisitors/src/tests/searchvisitor/searchvisitor_test.cpp index 7cf333a4beee..0c4fb4d18642 100644 --- a/streamingvisitors/src/tests/searchvisitor/searchvisitor_test.cpp +++ b/streamingvisitors/src/tests/searchvisitor/searchvisitor_test.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include LOG_SETUP("searchvisitor_test"); @@ -30,6 +31,10 @@ vespalib::string get_doc_id(int id) { return "id:test:test::" + std::to_string(id); } +vespalib::string src_cfg(vespalib::stringref prefix, vespalib::stringref suffix) { + return prefix + TEST_PATH("cfg") + suffix; +} + /** * This class reflects the document type defined in cfg/test.sd. */ @@ -160,9 +165,9 @@ class SearchVisitorTest : public testing::Test { SearchVisitorTest::SearchVisitorTest() : _componentRegister(), - _env(::config::ConfigUri("dir:cfg"), nullptr, ""), - _factory(::config::ConfigUri("dir:cfg"), nullptr, ""), - _repo(std::make_shared(readDocumenttypesConfig("cfg/documenttypes.cfg"))), + _env(::config::ConfigUri(src_cfg("dir:", "")), nullptr, ""), + _factory(::config::ConfigUri(src_cfg("dir:", "")), nullptr, ""), + _repo(std::make_shared(readDocumenttypesConfig(src_cfg("", "/documenttypes.cfg")))), _doc_type(_repo->getDocumentType("test")) { assert(_doc_type != nullptr);