summaryrefslogtreecommitdiff
path: root/tests/common
diff options
context:
space:
mode:
authorKshitij Sisodia <kshitij.sisodia@arm.com>2022-04-08 09:54:53 +0100
committerKshitij Sisodia <kshitij.sisodia@arm.com>2022-04-08 12:30:28 +0100
commit4cc4021d356c174f780be2b7ef96910e36c8dd7b (patch)
treec2a790b914577873a368982a07a9491f6743443e /tests/common
parent11b75cc7dc140119dee490f425e25a004122703b (diff)
downloadml-embedded-evaluation-kit-4cc4021d356c174f780be2b7ef96910e36c8dd7b.tar.gz
MLECO-3070: Further HAL cleanup.
Cleaning up HAL sources by removing unnecessary redirections with function pointers. The "platform packages" under HAL are now streamlined enough to not need any major HAL wrapping (as was the case before). This allows us to have a very thin HAL layer that sits on top of the platform and compnent packs. Also helps in getting rid of "hal platform" pointer being passed around in the code to use any HAL functionality. Change-Id: I04b2057f972aad7a5cfb4a396bcdf147c9f9ef1c Signed-off-by: Kshitij Sisodia <kshitij.sisodia@arm.com>
Diffstat (limited to 'tests/common')
-rw-r--r--tests/common/ProfilerTests.cc22
1 files changed, 8 insertions, 14 deletions
diff --git a/tests/common/ProfilerTests.cc b/tests/common/ProfilerTests.cc
index 889e2f2..91ac973 100644
--- a/tests/common/ProfilerTests.cc
+++ b/tests/common/ProfilerTests.cc
@@ -25,22 +25,16 @@
TEST_CASE("Common: Test Profiler")
{
- hal_platform platform;
- platform_timer timer {};
+ hal_platform_init();
- /* Initialise the HAL and platform. */
- hal_init(&platform, &timer);
- hal_platform_init(&platform);
-
- /* An invalid profiler shouldn't be of much use */
- SECTION("Test invalid profiler") {
- arm::app::Profiler profilerInvalid{nullptr, "test_invalid"};
- REQUIRE(false == profilerInvalid.StartProfiling());
- REQUIRE(false == profilerInvalid.StopProfiling());
+ SECTION("Test default construction") {
+ arm::app::Profiler profiler{};
+ REQUIRE(true == profiler.StartProfiling());
+ REQUIRE(true == profiler.StopProfiling());
}
SECTION("Test valid profiler") {
- arm::app::Profiler profilerValid{&platform, "test_valid"};
+ arm::app::Profiler profilerValid{"test_valid"};
REQUIRE(true == profilerValid.StartProfiling());
REQUIRE(true == profilerValid.StopProfiling());
std::vector<arm::app::ProfileResult> results;
@@ -57,7 +51,7 @@ TEST_CASE("Common: Test Profiler")
}
SECTION("Test multiple profilers") {
- arm::app::Profiler profilerValid{&platform, "one"};
+ arm::app::Profiler profilerValid{"one"};
REQUIRE(true == profilerValid.StartProfiling());
REQUIRE(true == profilerValid.StopProfiling());
@@ -78,7 +72,7 @@ TEST_CASE("Common: Test Profiler")
#if defined (CPU_PROFILE_ENABLED)
SECTION("Test CPU profiler") {
- arm::app::Profiler profilerCPU{&platform, "test cpu"};
+ arm::app::Profiler profilerCPU{"test cpu"};
std::vector<arm::app::ProfileResult> results;
profilerCPU.StartProfiling();
profilerCPU.StopProfiling();