Skip to content

Commit 6a9b2f6

Browse files
committed
LLVMCodeBuilder: Add random test with NaN
1 parent af642a4 commit 6a9b2f6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/dev/llvm/llvmcodebuilder_test.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,16 @@ TEST_F(LLVMCodeBuilderTest, Random)
698698

699699
const double inf = std::numeric_limits<double>::infinity();
700700
const double nan = std::numeric_limits<double>::quiet_NaN();
701+
702+
EXPECT_CALL(m_rng, randint(0, 5)).Times(3).WillRepeatedly(Return(5));
703+
runOpTest(OpType::Random, nan, 5);
704+
705+
EXPECT_CALL(m_rng, randint(5, 0)).Times(3).WillRepeatedly(Return(3));
706+
runOpTest(OpType::Random, 5, nan);
707+
708+
EXPECT_CALL(m_rng, randint(0, 0)).Times(3).WillRepeatedly(Return(0));
709+
runOpTest(OpType::Random, nan, nan);
710+
701711
EXPECT_CALL(m_rng, randint).WillRepeatedly(Return(0));
702712
EXPECT_CALL(m_rng, randintDouble).WillRepeatedly(Return(0));
703713

0 commit comments

Comments
 (0)