manifest_test: add method to generate valid FFA manifest
With upcoming unit tests related to the FFA manifest it is required to
generate a valid FFA manifest before doing the actual test.
To avoid repetitive use of multiple lines of code, introduce a method
"Ffa_valid()" to generate a valid FFA manifest.
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I6821f9911f44457a3bfb7957abe6d8e185ad7bc9
diff --git a/src/manifest_test.cc b/src/manifest_test.cc
index 2b8be8b..5ac6a31 100644
--- a/src/manifest_test.cc
+++ b/src/manifest_test.cc
@@ -212,6 +212,22 @@
return *this;
}
+ ManifestDtBuilder &FfaValidManifest()
+ {
+ Compatible({"arm,ffa-manifest-1.0"});
+ Property("ffa-version", "<0x10000>");
+ Property("uuid",
+ "<0xb4b5671e 0x4a904fe1 0xb81ffb13 0xdae1dacb>");
+ Property("execution-ctx-count", "<1>");
+ Property("exception-level", "<2>");
+ Property("execution-state", "<0>");
+ Property("load-address", "<0x7000000>");
+ Property("entrypoint-offset", "<0x00001000>");
+ Property("xlat-granule", "<0>");
+ Property("messaging-method", "<1>");
+ return *this;
+ }
+
private:
ManifestDtBuilder &StringProperty(const std::string_view &name,
const std::string_view &value)
@@ -802,16 +818,7 @@
/* clang-format off */
std::vector<char> dtb = ManifestDtBuilder()
- .Compatible({ "arm,ffa-manifest-1.0" })
- .Property("ffa-version", "<0x10000>")
- .Property("uuid", "<0xb4b5671e 0x4a904fe1 0xb81ffb13 0xdae1dacb>")
- .Property("execution-ctx-count", "<1>")
- .Property("exception-level", "<2>")
- .Property("execution-state", "<0>")
- .Property("load-address", "<0x7000000>")
- .Property("entrypoint-offset", "<0x00001000>")
- .Property("xlat-granule", "<0>")
- .Property("messaging-method", "<1>")
+ .FfaValidManifest()
.Build();
/* clang-format on */