Skip to content

Commit 942c117

Browse files
committed
tests for string convertion
1 parent c783ac5 commit 942c117

File tree

4 files changed

+324
-115
lines changed

4 files changed

+324
-115
lines changed

fixed_lib/include/fixedmath/fixed_string.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ namespace func
147147
// .001 = 65.536 * 65536
148148
// etc.
149149
fixed_internal fraction{0};
150-
constexpr fixed_internal power[5]{429496730, 42949673, 4294967, 429497, 42950}; // 10^-1 * 2^16 (rounded down)
150+
static constexpr fixed_internal power[5]{429496730, 42949673, 4294967, 429497, 42950}; // 10^-1 * 2^16 (rounded down)
151151
uint8_t i{0};
152152

153153
while(pos < str.size() and detail::isdigit(str[pos]))
@@ -199,7 +199,7 @@ namespace func
199199
std::string result;
200200

201201
// Handle negative numbers
202-
bool negative{value.v < 0};
202+
bool const negative{value.v < 0};
203203
fixed_internal abs_value{negative ? -value.v : value.v};
204204

205205
// Extract integer part (high 48 bits)

unit_tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,5 @@ add_fixedmath_ut( misc_functions_ut )
6363
add_fixedmath_ut( sin_cos_ut )
6464
add_fixedmath_ut( tan_ut )
6565
add_fixedmath_ut( atan_ut )
66-
add_fixedmath_ut( fixed_string_unittest )
66+
add_fixedmath_ut( string_convertion_ut )
6767

unit_tests/fixed_string_unittest.cc

Lines changed: 0 additions & 112 deletions
This file was deleted.

0 commit comments

Comments
 (0)