Skip to content

Commit

Permalink
Clang: Fix implicit-const-int-float-conversion warnigns in test suite…
Browse files Browse the repository at this point in the history
… for uint64_max
  • Loading branch information
ptheywood committed Jan 8, 2024
1 parent d99e721 commit 4e9b430
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_cases/runtime/random/test_host_random.cu
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ FLAMEGPU_STEP_FUNCTION(step_uniform_int_range) {
FLAMEGPU_STEP_FUNCTION(step_uniform_ulonglong_range) {
for (auto &i : unsigned_longlong_out)
ASSERT_NO_THROW(i = FLAMEGPU->random.uniform<uint64_t>(
static_cast<uint64_t>(UINT64_MAX * 0.25),
static_cast<uint64_t>(UINT64_MAX * 0.75)));
static_cast<uint64_t>(static_cast<double>(UINT64_MAX) * 0.25),
static_cast<uint64_t>(static_cast<double>(UINT64_MAX) * 0.75)));
}
FLAMEGPU_STEP_FUNCTION(step_uniform_longlong_range) {
for (auto &i : longlong_out)
Expand Down Expand Up @@ -1048,8 +1048,8 @@ TEST_F(HostRandomTest, UniformULongLongRange) {
ms->model.addStepFunction(step_uniform_ulonglong_range);
ms->run();
for (auto &i : unsigned_longlong_out) {
EXPECT_GE(i, static_cast<uint64_t>(UINT64_MAX*0.25));
EXPECT_LE(i, static_cast<uint64_t>(UINT64_MAX*0.75));
EXPECT_GE(i, static_cast<uint64_t>(static_cast<double>(UINT64_MAX)*0.25));
EXPECT_LE(i, static_cast<uint64_t>(static_cast<double>(UINT64_MAX)*0.75));
}
}
TEST_F(HostRandomTest, UniformLongLongRange) {
Expand Down

0 comments on commit 4e9b430

Please sign in to comment.