mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
missing include for rand() in self-tests
This commit is contained in:
parent
bb79b63c93
commit
0e36f8e2d7
1 changed files with 4 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include "reallocpool_test.h"
|
#include "reallocpool_test.h"
|
||||||
#include "pbd/reallocpool.h"
|
#include "pbd/reallocpool.h"
|
||||||
|
|
||||||
|
|
@ -13,15 +14,15 @@ ReallocPoolTest::ReallocPoolTest ()
|
||||||
void
|
void
|
||||||
ReallocPoolTest::testBasic ()
|
ReallocPoolTest::testBasic ()
|
||||||
{
|
{
|
||||||
srand (0);
|
::srand (0);
|
||||||
PBD::ReallocPool *m = new PBD::ReallocPool("TestPool", 256 * 1024);
|
PBD::ReallocPool *m = new PBD::ReallocPool("TestPool", 256 * 1024);
|
||||||
|
|
||||||
for (int l = 0; l < 2 * 1024 * 1024; ++l) {
|
for (int l = 0; l < 2 * 1024 * 1024; ++l) {
|
||||||
void *x[32];
|
void *x[32];
|
||||||
size_t s[32];
|
size_t s[32];
|
||||||
int cnt = rand() % 32;
|
int cnt = ::rand() % 32;
|
||||||
for (int i = 0; i < cnt; ++i) {
|
for (int i = 0; i < cnt; ++i) {
|
||||||
s[i] = rand() % 1024;
|
s[i] = ::rand() % 1024;
|
||||||
x[i] = m->malloc (s[i]);
|
x[i] = m->malloc (s[i]);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < cnt; ++i) {
|
for (int i = 0; i < cnt; ++i) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue