You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
887 B
C++
39 lines
887 B
C++
#include <cb.h>
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
|
TEST (Time, TestStart) {
|
|
using namespace cb;
|
|
|
|
const auto mehligs = "mehligs";
|
|
const auto mehl = "mehl";
|
|
|
|
time::start_measure(mehl);
|
|
|
|
EXPECT_TRUE(time::has_measurement(mehl));
|
|
EXPECT_FALSE(time::has_measurement(mehligs));
|
|
|
|
const auto measured_time_mehl = time::get_duration(mehl);
|
|
const auto measured_time_mehligs = time::get_duration(mehligs);
|
|
|
|
EXPECT_TRUE(time::has_measurement(mehl));
|
|
EXPECT_FALSE(time::has_measurement(mehligs));
|
|
|
|
EXPECT_GT(measured_time_mehl, 0);
|
|
EXPECT_EQ(measured_time_mehligs, time::NO_MEASUREMENT);
|
|
}
|
|
|
|
TEST (Time, NoTimer) {
|
|
using namespace cb;
|
|
|
|
const auto mehligs = "mehligs";
|
|
const auto measured_time_mehligs = time::get_duration(mehligs);
|
|
|
|
EXPECT_FALSE(time::has_measurement(mehligs));
|
|
EXPECT_EQ(measured_time_mehligs, time::NO_MEASUREMENT);
|
|
|
|
}
|
|
|
|
|