diff options
Diffstat (limited to 'libc/test/src/stdlib/rand_test.cpp')
| -rw-r--r-- | libc/test/src/stdlib/rand_test.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libc/test/src/stdlib/rand_test.cpp b/libc/test/src/stdlib/rand_test.cpp index 4bebbe37ffbe..6f25708e5390 100644 --- a/libc/test/src/stdlib/rand_test.cpp +++ b/libc/test/src/stdlib/rand_test.cpp @@ -17,7 +17,7 @@ TEST(LlvmLibcRandTest, UnsetSeed) { static int vals[1000]; for (size_t i = 0; i < 1000; ++i) { - int val = __llvm_libc::rand(); + int val = LIBC_NAMESPACE::rand(); ASSERT_GE(val, 0); ASSERT_LE(val, RAND_MAX); vals[i] = val; @@ -26,27 +26,27 @@ TEST(LlvmLibcRandTest, UnsetSeed) { // The C standard specifies that if 'srand' is never called it should behave // as if 'srand' was called with a value of 1. If we seed the value with 1 we // should get the same sequence as the unseeded version. - __llvm_libc::srand(1); + LIBC_NAMESPACE::srand(1); for (size_t i = 0; i < 1000; ++i) - ASSERT_EQ(__llvm_libc::rand(), vals[i]); + ASSERT_EQ(LIBC_NAMESPACE::rand(), vals[i]); } TEST(LlvmLibcRandTest, SetSeed) { const unsigned int SEED = 12344321; - __llvm_libc::srand(SEED); + LIBC_NAMESPACE::srand(SEED); const size_t NUM_RESULTS = 10; int results[NUM_RESULTS]; for (size_t i = 0; i < NUM_RESULTS; ++i) { - results[i] = __llvm_libc::rand(); + results[i] = LIBC_NAMESPACE::rand(); ASSERT_GE(results[i], 0); ASSERT_LE(results[i], RAND_MAX); } // If the seed is set to the same value, it should give the same sequence. - __llvm_libc::srand(SEED); + LIBC_NAMESPACE::srand(SEED); for (size_t i = 0; i < NUM_RESULTS; ++i) { - int val = __llvm_libc::rand(); + int val = LIBC_NAMESPACE::rand(); EXPECT_EQ(results[i], val); } } |
