mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 12:27:14 +02:00
tests add to namespace sls (#466)
* tests add to namespace sls * fixed for tests * finish up namespace sls for tests
This commit is contained in:
@ -6,9 +6,11 @@
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
|
||||
namespace sls {
|
||||
|
||||
TEST_CASE("Time 1s restart then time 2s", "[.timer]") {
|
||||
auto sleep_duration = std::chrono::seconds(1);
|
||||
auto t = sls::Timer();
|
||||
auto t = Timer();
|
||||
std::this_thread::sleep_for(sleep_duration);
|
||||
REQUIRE(t.elapsed_s() == Approx(1).epsilon(0.01));
|
||||
|
||||
@ -19,7 +21,9 @@ TEST_CASE("Time 1s restart then time 2s", "[.timer]") {
|
||||
|
||||
TEST_CASE("Return ms", "[.timer]") {
|
||||
auto sleep_duration = std::chrono::milliseconds(1300);
|
||||
auto t = sls::Timer();
|
||||
auto t = Timer();
|
||||
std::this_thread::sleep_for(sleep_duration);
|
||||
REQUIRE(t.elapsed_ms() == Approx(1300).epsilon(0.5));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
Reference in New Issue
Block a user