Merge pathToAbsoluteSchemaString and pathToSchemaString
These functions did almost the same thing, the only difference was that
the former inserted module prefixes everyhwere and the other didn't.
The new function takes an argument specifying whether to insert prefixes
everyhwere.
pathToSchemaString also checks whether a path is absolute or relative
and prepends a slash. This means, that it's no longer possible to
convert and absolute path to a string with no leading slash. The
StaticSchema class had to be changed accordingly, because it stored
absolute paths in strings without a leading slash (because it was
designed before absolute paths existed).
The fact that this was split into two functions helped find an error in
a later patch.
Change-Id: I6112cb5982919b51b61152f355771a52dd467c6e
diff --git a/tests/path_utils.cpp b/tests/path_utils.cpp
index eba2b34..f8dc250 100644
--- a/tests/path_utils.cpp
+++ b/tests/path_utils.cpp
@@ -28,6 +28,6 @@
path.m_nodes.push_back(dataNode_{module_{"example-schema"}, listElement_{"twoKeyList", {{"first", "a"}, {"second", "b"}}}});
expected += "example-schema:twoKeyList[first='a'][second='b']";
}
- REQUIRE(pathToDataString(path) == expected);
+ REQUIRE(pathToDataString(path, Prefixes::WhenNeeded) == expected);
}
}