Skip to content

Commit

Permalink
LLVMCodeBuilder: Add random test with NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
adazem009 committed Dec 28, 2024
1 parent af642a4 commit 6a9b2f6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/dev/llvm/llvmcodebuilder_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,16 @@ TEST_F(LLVMCodeBuilderTest, Random)

const double inf = std::numeric_limits<double>::infinity();
const double nan = std::numeric_limits<double>::quiet_NaN();

EXPECT_CALL(m_rng, randint(0, 5)).Times(3).WillRepeatedly(Return(5));
runOpTest(OpType::Random, nan, 5);

EXPECT_CALL(m_rng, randint(5, 0)).Times(3).WillRepeatedly(Return(3));
runOpTest(OpType::Random, 5, nan);

EXPECT_CALL(m_rng, randint(0, 0)).Times(3).WillRepeatedly(Return(0));
runOpTest(OpType::Random, nan, nan);

EXPECT_CALL(m_rng, randint).WillRepeatedly(Return(0));
EXPECT_CALL(m_rng, randintDouble).WillRepeatedly(Return(0));

Expand Down

0 comments on commit 6a9b2f6

Please sign in to comment.