File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ sfTime sfSeconds(float amount)
6363// //////////////////////////////////////////////////////////
6464sfTime sfMilliseconds (int32_t amount)
6565{
66- return {static_cast < int64_t >( amount * 1000 ) };
66+ return {int64_t { amount} * 1000 };
6767}
6868
6969
Original file line number Diff line number Diff line change @@ -28,4 +28,7 @@ TEST_CASE("[System] sfTime")
2828 CHECK (sfSeconds (10 ).microseconds == 10'000'000 );
2929 CHECK (sfMilliseconds (10 ).microseconds == 10'000 );
3030 CHECK (sfMicroseconds (10 ).microseconds == 10 );
31+
32+ CHECK (sfMilliseconds (std::numeric_limits<int32_t >::max ()).microseconds == 2'147'483'647'000 );
33+ CHECK (sfMicroseconds (std::numeric_limits<int64_t >::max ()).microseconds == std::numeric_limits<int64_t >::max ());
3134}
You can’t perform that action at this time.
0 commit comments