Files
cpp-project-template/third_party/benchmark/test/min_time_parse_gtest.cc
tqcq ea9d7b5f8c
All checks were successful
sm-rpc / build (Debug, aarch64-linux-gnu) (push) Successful in 1m7s
sm-rpc / build (Debug, arm-linux-gnueabihf) (push) Successful in 1m15s
sm-rpc / build (Debug, host.gcc) (push) Successful in 1m4s
sm-rpc / build (Debug, mipsel-linux-gnu) (push) Successful in 1m16s
sm-rpc / build (Release, aarch64-linux-gnu) (push) Successful in 1m34s
sm-rpc / build (Release, arm-linux-gnueabihf) (push) Successful in 1m33s
sm-rpc / build (Release, host.gcc) (push) Successful in 1m23s
sm-rpc / build (Release, mipsel-linux-gnu) (push) Successful in 1m30s
feat(third_party): add oatpp,googltest,benchmark
2025-08-19 17:19:37 +08:00

31 lines
951 B
C++

#include "../src/benchmark_runner.h"
#include "gtest/gtest.h"
namespace {
TEST(ParseMinTimeTest, InvalidInput) {
#if GTEST_HAS_DEATH_TEST
// Tests only runnable in debug mode (when BM_CHECK is enabled).
#ifndef NDEBUG
#ifndef TEST_BENCHMARK_LIBRARY_HAS_NO_ASSERTIONS
ASSERT_DEATH_IF_SUPPORTED(
{ benchmark::internal::ParseBenchMinTime("abc"); },
"Malformed seconds value passed to --benchmark_min_time: `abc`");
ASSERT_DEATH_IF_SUPPORTED(
{ benchmark::internal::ParseBenchMinTime("123ms"); },
"Malformed seconds value passed to --benchmark_min_time: `123ms`");
ASSERT_DEATH_IF_SUPPORTED(
{ benchmark::internal::ParseBenchMinTime("1z"); },
"Malformed seconds value passed to --benchmark_min_time: `1z`");
ASSERT_DEATH_IF_SUPPORTED(
{ benchmark::internal::ParseBenchMinTime("1hs"); },
"Malformed seconds value passed to --benchmark_min_time: `1hs`");
#endif
#endif
#endif
}
} // namespace