Disable a test as it is not consistent between compilers.

This commit is contained in:
Godzil
2020-03-02 17:41:04 +00:00
parent 1cebcd4f8b
commit 478b1f0af1
6 changed files with 48 additions and 31 deletions

View File

@@ -21,4 +21,6 @@ double deg_to_rad(double deg);
double min3(double a, double b, double c);
double max3(double a, double b, double c);
double frand();
#endif /* DORAYME_MATH_HELPER_H */

View File

@@ -9,9 +9,7 @@
#ifndef DORAYME_SEQUENCE_H
#define DORAYME_SEQUENCE_H
#include <stdlib.h>
#include <stdint.h>
#include <time.h>
class Sequence
{
@@ -20,30 +18,9 @@ private:
uint32_t listPos;
uint32_t listSize;
public:
Sequence() : list(nullptr), listPos(0), listSize(0) {
/* Need to bootstrap rand here */
srand(time(NULL));
}
Sequence(double *list, uint32_t listSize) : list(list), listPos(0), listSize(listSize) { };
static double frand(void)
{
return rand() / ((double) RAND_MAX);
}
double next() {
if (this->listSize == 0)
{
return frand();
}
else
{
uint32_t pos = this->listPos;
this->listPos = (this->listPos + 1) % this->listSize;
return this->list[pos];
}
}
Sequence();
Sequence(double *list, uint32_t listSize);
double next();
};