Skip to content

Commit 3441905

Browse files
committed
fix tests
1 parent 404abd2 commit 3441905

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/float_to_string_test.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace tests {
88

99
void FloatToStringRoundTripTest() {
1010
// convert an array of floats to strings and back, and check they are the same
11-
constexpr std::array<float, 13> floats_to_test = {
11+
std::array<float, 13> floats_to_test = {
1212
0.0f,
1313
-0.0f,
1414
1.0f,
@@ -39,7 +39,7 @@ void FloatToStringRoundTripTest() {
3939
}
4040

4141
// doubles
42-
constexpr std::array<double, 13> doubles_to_test = {
42+
std::array<double, 13> doubles_to_test = {
4343
0.0,
4444
-0.0,
4545
1.0,
@@ -75,15 +75,15 @@ namespace {
7575
template <typename T>
7676
struct TestCase {
7777
T input;
78-
std::string_view expected_output;
78+
std::string expected_output;
7979
};
8080

8181
} // namespace
8282

8383
void FloatToStringOutputTest() {
8484
// Test that FloatToString produces expected string outputs for given inputs
8585

86-
constexpr std::array<TestCase<float>, 13> test_cases{
86+
std::array<TestCase<float>, 13> test_cases{
8787
TestCase<float>{0.0f, "0.0"},
8888
TestCase<float>{-0.0f, "-0.0"},
8989
TestCase<float>{1.0f, "1.0"},
@@ -101,11 +101,11 @@ void FloatToStringOutputTest() {
101101

102102
for (const auto& test_case : test_cases) {
103103
std::string output = NumToString(test_case.input);
104-
TEST_EQ(output, std::string{test_case.expected_output});
104+
TEST_EQ(output, test_case.expected_output);
105105
}
106106

107107
// doubles
108-
constexpr std::array<TestCase<double>, 13> double_test_cases = {
108+
std::array<TestCase<double>, 10> double_test_cases = {
109109
TestCase<double>{0.0, "0.0"},
110110
TestCase<double>{-0.0, "-0.0"},
111111
TestCase<double>{1.0, "1.0"},
@@ -123,7 +123,7 @@ void FloatToStringOutputTest() {
123123

124124
for (const auto& test_case : double_test_cases) {
125125
std::string output = NumToString(test_case.input);
126-
TEST_EQ(output, std::string{test_case.expected_output});
126+
TEST_EQ(output, test_case.expected_output);
127127
}
128128
}
129129

0 commit comments

Comments
 (0)