5 #include "../src/string_util.h"
6 #include "../src/internal_macros.h"
7 #include "gtest/gtest.h"
10 TEST(StringUtilTest, stoul) {
26 #if ULONG_MAX == 0xFFFFFFFFul
29 EXPECT_EQ(0xFFFFFFFFul, benchmark::stoul(
"4294967295", &
pos));
32 #elif ULONG_MAX == 0xFFFFFFFFFFFFFFFFul
35 EXPECT_EQ(0xFFFFFFFFFFFFFFFFul, benchmark::stoul(
"18446744073709551615", &
pos));
64 #ifndef BENCHMARK_HAS_NO_EXCEPTIONS
66 ASSERT_THROW(benchmark::stoul(
"this is a test"), std::invalid_argument);
71 TEST(StringUtilTest, stoi) {
112 #ifndef BENCHMARK_HAS_NO_EXCEPTIONS
114 ASSERT_THROW(benchmark::stoi(
"this is a test"), std::invalid_argument);
119 TEST(StringUtilTest, stod) {
146 #ifndef BENCHMARK_HAS_NO_EXCEPTIONS
148 ASSERT_THROW(benchmark::stod(
"this is a test"), std::invalid_argument);
156 std::vector<std::string>({
"hello"}));
158 std::vector<std::string>({
"hello",
"there",
"is",
"more"}));