mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-04 10:18:31 +00:00
Rename rand64() to _rand64()
This commit is contained in:
parent
c424352a0a
commit
7ae556463a
52 changed files with 141 additions and 139 deletions
|
@ -101,10 +101,10 @@
|
|||
#include "libc/intrin/pxor.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/log/check.h"
|
||||
#include "libc/mem/gc.internal.h"
|
||||
#include "libc/nexgen32e/kcpuids.h"
|
||||
#include "libc/stdio/lcg.internal.h"
|
||||
#include "libc/stdio/rand.h"
|
||||
#include "libc/mem/gc.internal.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/testlib/ezbench.h"
|
||||
|
@ -2105,8 +2105,8 @@ TEST(pdep, fuzz) {
|
|||
int i;
|
||||
uint64_t x, y;
|
||||
for (i = 0; i < 1000; ++i) {
|
||||
x = rand64();
|
||||
y = rand64();
|
||||
x = _rand64();
|
||||
y = _rand64();
|
||||
ASSERT_EQ(pdep(x, y), (pdep)(x, y));
|
||||
}
|
||||
}
|
||||
|
@ -2115,8 +2115,8 @@ TEST(pext, fuzz) {
|
|||
int i;
|
||||
uint64_t x, y;
|
||||
for (i = 0; i < 1000; ++i) {
|
||||
x = rand64();
|
||||
y = rand64();
|
||||
x = _rand64();
|
||||
y = _rand64();
|
||||
ASSERT_EQ(pext(x, y), (pext)(x, y));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/mem/gc.internal.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/stdio/rand.h"
|
||||
#include "libc/mem/gc.internal.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/testlib/ezbench.h"
|
||||
|
@ -65,7 +65,7 @@ TEST(memcmp, fuzz) {
|
|||
int i, o, n, g;
|
||||
char a[256], b[256];
|
||||
for (i = 0; i < 100000; ++i) {
|
||||
rngset(a, sizeof(a), rand64, -1);
|
||||
rngset(a, sizeof(a), _rand64, -1);
|
||||
memcpy(b, a, sizeof(a));
|
||||
if (rand() & 1) {
|
||||
a[rand() % sizeof(a)] += rand();
|
||||
|
|
|
@ -44,7 +44,7 @@ void OnChld(int sig) {
|
|||
}
|
||||
|
||||
dontinline void Generate(int i) {
|
||||
A[i] = rand64();
|
||||
A[i] = _rand64();
|
||||
}
|
||||
|
||||
int Thrasher(void *arg, int tid) {
|
||||
|
@ -56,11 +56,11 @@ int Thrasher(void *arg, int tid) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
TEST(rand64, testLcg_doesntProduceIdenticalValues) {
|
||||
TEST(_rand64, testLcg_doesntProduceIdenticalValues) {
|
||||
int i, j;
|
||||
bzero(A, sizeof(A));
|
||||
for (i = 0; i < ARRAYLEN(A); ++i) {
|
||||
A[i] = rand64();
|
||||
A[i] = _rand64();
|
||||
}
|
||||
for (i = 0; i < ARRAYLEN(A); ++i) {
|
||||
EXPECT_NE(0, A[i], "i=%d", i);
|
||||
|
@ -71,7 +71,7 @@ TEST(rand64, testLcg_doesntProduceIdenticalValues) {
|
|||
}
|
||||
}
|
||||
|
||||
TEST(rand64, testThreadSafety_doesntProduceIdenticalValues) {
|
||||
TEST(_rand64, testThreadSafety_doesntProduceIdenticalValues) {
|
||||
int i, j, rc, ws;
|
||||
sigset_t ss, oldss;
|
||||
struct sigaction oldsa;
|
||||
|
|
|
@ -114,7 +114,7 @@ TEST(strlen, fuzz) {
|
|||
char *b;
|
||||
size_t n, n1, n2;
|
||||
for (n = 2; n < 1026; ++n) {
|
||||
b = rngset(calloc(1, n), n - 1, rand64, -1);
|
||||
b = rngset(calloc(1, n), n - 1, _rand64, -1);
|
||||
n1 = strlen(b);
|
||||
n2 = strlen_pure(b);
|
||||
ASSERT_EQ(n1, n2, "%#.*s", n, b);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue