Skip to content

Commit

Permalink
rename testname
Browse files Browse the repository at this point in the history
  • Loading branch information
willsfeng committed Mar 28, 2024
1 parent 4af8534 commit 4ba807d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions velox/functions/prestosql/tests/RandTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ TEST_F(RandTest, nonNullInt8) {
EXPECT_LT(rand(4), 4);
}

TEST_F(RandTest, zeroArgSecure) {
TEST_F(RandTest, secureRandZeroArg) {
auto result =
evaluateOnce<double>("secure_random()", makeRowVector(ROW({}), 1));
EXPECT_LT(result, 1.0);
Expand All @@ -104,7 +104,7 @@ TEST_F(RandTest, zeroArgSecure) {
EXPECT_GE(result, 0.0);
}

TEST_F(RandTest, int64ArgsSecure) {
TEST_F(RandTest, secureRandInt64) {
auto result =
secureRand<int64_t>((int64_t)-2147532562, (int64_t)4611791058295013614);
EXPECT_LT(result, 4611791058295013614);
Expand All @@ -120,7 +120,7 @@ TEST_F(RandTest, int64ArgsSecure) {
EXPECT_GE(result, std::numeric_limits<int64_t>::min());
}

TEST_F(RandTest, int32ArgsSecure) {
TEST_F(RandTest, secureRandInt32) {
auto result = secureRand<int32_t>((int32_t)8765432, (int32_t)2145613151);
EXPECT_LT(result, 2145613151);
EXPECT_GE(result, 8765432);
Expand All @@ -130,7 +130,7 @@ TEST_F(RandTest, int32ArgsSecure) {
EXPECT_GE(result, 0);
}

TEST_F(RandTest, int16ArgsSecure) {
TEST_F(RandTest, secureRandInt16) {
auto result = secureRand<int16_t>((int16_t)-100, (int16_t)23286);
EXPECT_LT(result, 23286);
EXPECT_GE(result, -100);
Expand All @@ -140,7 +140,7 @@ TEST_F(RandTest, int16ArgsSecure) {
EXPECT_GE(result, 0);
}

TEST_F(RandTest, int8ArgsSecure) {
TEST_F(RandTest, secureRandInt8) {
auto result = secureRand<int8_t>((int8_t)10, (int8_t)120);
EXPECT_LT(result, 120);
EXPECT_GE(result, 10);
Expand All @@ -150,7 +150,7 @@ TEST_F(RandTest, int8ArgsSecure) {
EXPECT_GE(result, 0);
}

TEST_F(RandTest, doubleArgsSecure) {
TEST_F(RandTest, secureRandDouble) {
auto result = secureRand<double>((double)10.5, (double)120.7895);
EXPECT_LT(result, 120.7895);
EXPECT_GE(result, 10.5);
Expand All @@ -160,7 +160,7 @@ TEST_F(RandTest, doubleArgsSecure) {
EXPECT_GE(result, 0.0);
}

TEST_F(RandTest, floatArgsSecure) {
TEST_F(RandTest, secureRandFloat) {
auto result = secureRand<float>((float)-10.5, (float)120.7);
EXPECT_LT(result, 120.7);
EXPECT_GE(result, -10.5);
Expand All @@ -170,7 +170,7 @@ TEST_F(RandTest, floatArgsSecure) {
EXPECT_GE(result, 0.0);
}

TEST_F(RandTest, invalidBoundsSecure) {
TEST_F(RandTest, secureRandInvalid) {
VELOX_ASSERT_THROW(
secureRand<int64_t>((int64_t)-5, (int64_t)-10),
"upper bound must be greater than lower bound");
Expand Down Expand Up @@ -209,7 +209,7 @@ TEST_F(RandTest, invalidBoundsSecure) {
"upper bound must be greater than lower bound");
}

TEST_F(RandTest, otherArgSecure) {
TEST_F(RandTest, secureRandSpecialValues) {
auto result = secureRand<int64_t>(0, kLongMax);
EXPECT_LT(result, kLongMax);
result = secureRand<int64_t>(kLongMin, 0);
Expand Down

0 comments on commit 4ba807d

Please sign in to comment.