From ce7f6ee6c964c87029f04bc1731f78f448e90e78 Mon Sep 17 00:00:00 2001 From: SharafMohamed Date: Mon, 8 Jul 2024 08:09:48 -0400 Subject: [PATCH] Fixed stopwatch test --- components/core/tests/test-Stopwatch.cpp | 34 ++++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/components/core/tests/test-Stopwatch.cpp b/components/core/tests/test-Stopwatch.cpp index f2fe5dd3d..7e67288c3 100644 --- a/components/core/tests/test-Stopwatch.cpp +++ b/components/core/tests/test-Stopwatch.cpp @@ -34,23 +34,23 @@ TEST_CASE("Stopwatch", "[Stopwatch]") { REQUIRE(time_taken >= 1.0); REQUIRE(time_taken < 1.1); } -} - -SECTION("Test multiple measurements") { - // Measure some work - stopwatch.start(); - sleep(1); - stopwatch.stop(); - - // Do some other work - sleep(1); + + SECTION("Test multiple measurements") { + // Measure some work + stopwatch.start(); + sleep(1); + stopwatch.stop(); + + // Do some other work + sleep(1); - // Measure some work again - stopwatch.start(); - sleep(2); - stopwatch.stop(); + // Measure some work again + stopwatch.start(); + sleep(2); + stopwatch.stop(); - double time_taken = stopwatch.get_time_taken_in_seconds(); - REQUIRE(time_taken >= 3.0); - REQUIRE(time_taken < 3.1); + double time_taken = stopwatch.get_time_taken_in_seconds(); + REQUIRE(time_taken >= 3.0); + REQUIRE(time_taken < 3.1); + } }