diff options
author | Manish Pandey <manish.pandey2@arm.com> | 2020-08-18 00:04:43 +0100 |
---|---|---|
committer | Manish Pandey <manish.pandey2@arm.com> | 2020-08-18 14:32:26 +0100 |
commit | cb8fbb2dcd49a9c9db4d3a53d9966b93235f1ac1 (patch) | |
tree | 1b732c526eea3d7f46dca4cc972f19830c675878 | |
parent | fcfa881509bb2da5ca89317f3e05655a8b157f7d (diff) | |
download | hafnium-cb8fbb2dcd49a9c9db4d3a53d9966b93235f1ac1.tar.gz |
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
-rw-r--r-- | src/manifest_test.cc | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/manifest_test.cc b/src/manifest_test.cc index 2b8be8bd4..5ac6a31a2 100644 --- a/src/manifest_test.cc +++ b/src/manifest_test.cc @@ -212,6 +212,22 @@ class ManifestDtBuilder 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 @@ TEST(manifest, ffa_valid) /* 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 */ |