mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 06:57:37 +02:00
commit
44d61e44e2
3 changed files with 34 additions and 29 deletions
|
@ -34,7 +34,7 @@ static void readWriteHelper(const std::vector<bool>& src) {
|
|||
int numBits = (int)src.size();
|
||||
int numBytes = calcBitVectorSize(numBits);
|
||||
uint8_t* bytes = new uint8_t[numBytes];
|
||||
memset(bytes, numBytes, sizeof(uint8_t));
|
||||
memset(bytes, 0, numBytes);
|
||||
int numBytesWritten = writeBitVector(bytes, numBits, [&](int i) {
|
||||
return src[i];
|
||||
});
|
||||
|
@ -53,6 +53,8 @@ static void readWriteHelper(const std::vector<bool>& src) {
|
|||
bool b = dst[i];
|
||||
QCOMPARE(a, b);
|
||||
}
|
||||
|
||||
delete[] bytes;
|
||||
}
|
||||
|
||||
void BitVectorHelperTests::readWriteTest() {
|
||||
|
|
|
@ -132,6 +132,11 @@ void FileCacheTests::testFreeSpacePreservation() {
|
|||
cache->setMinFreeSize(targetFreeSpace);
|
||||
QCOMPARE(cache->getNumCachedFiles(), (size_t)5);
|
||||
QCOMPARE(cache->getNumTotalFiles(), (size_t)5);
|
||||
qDebug() << "Free space: " << getFreeSpace();
|
||||
qDebug() << "Target : " << targetFreeSpace;
|
||||
|
||||
qInfo() << "The following test may fail if free disk space was changed by another program during the test's runtime";
|
||||
|
||||
QVERIFY(getFreeSpace() >= targetFreeSpace);
|
||||
for (int i = 0; i < 95; ++i) {
|
||||
std::string key = getFileKey(i);
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <QtCore/QQueue>
|
||||
#include <test-utils/GLMTestUtils.h>
|
||||
#include <test-utils/QTestExtensions.h>
|
||||
#include <QRandomGenerator64>
|
||||
|
||||
QTEST_MAIN(MovingPercentileTests)
|
||||
|
||||
|
@ -41,10 +42,7 @@ void MovingPercentileTests::testRunningMedian() {
|
|||
|
||||
|
||||
int64_t MovingPercentileTests::random() {
|
||||
return ((int64_t) rand() << 48) ^
|
||||
((int64_t) rand() << 32) ^
|
||||
((int64_t) rand() << 16) ^
|
||||
((int64_t) rand());
|
||||
return QRandomGenerator64::global()->generate();
|
||||
}
|
||||
|
||||
void MovingPercentileTests::testRunningMinForN (int n) {
|
||||
|
|
Loading…
Reference in a new issue