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)
63
63
// //////////////////////////////////////////////////////////
64
64
sfTime sfMilliseconds (int32_t amount)
65
65
{
66
- return {static_cast < int64_t >( amount * 1000 ) };
66
+ return {int64_t { amount} * 1000 };
67
67
}
68
68
69
69
Original file line number Diff line number Diff line change @@ -28,4 +28,7 @@ TEST_CASE("[System] sfTime")
28
28
CHECK (sfSeconds (10 ).microseconds == 10'000'000 );
29
29
CHECK (sfMilliseconds (10 ).microseconds == 10'000 );
30
30
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 ());
31
34
}
You can’t perform that action at this time.
0 commit comments