diff --git a/libraries/shared/src/BitVectorHelpers.h b/libraries/shared/src/BitVectorHelpers.h index 9f5af0c380..a619fe3999 100644 --- a/libraries/shared/src/BitVectorHelpers.h +++ b/libraries/shared/src/BitVectorHelpers.h @@ -12,6 +12,8 @@ #ifndef hifi_BitVectorHelpers_h #define hifi_BitVectorHelpers_h +#include "NumericalConstants.h" + int calcBitVectorSize(int numBits) { return ((numBits - 1) >> 3) + 1; } diff --git a/tests/shared/src/BitVectorHelperTests.cpp b/tests/shared/src/BitVectorHelperTests.cpp index 070e90eec7..618a86cad1 100644 --- a/tests/shared/src/BitVectorHelperTests.cpp +++ b/tests/shared/src/BitVectorHelperTests.cpp @@ -20,8 +20,6 @@ QTEST_MAIN(BitVectorHelperTests) -const int BITS_IN_BYTE = 8; - void BitVectorHelperTests::sizeTest() { std::vector sizes = {0, 6, 7, 8, 30, 31, 32, 33, 87, 88, 89, 90, 90, 91, 92, 93}; for (auto& size : sizes) { diff --git a/tests/shared/src/FileCacheTests.cpp b/tests/shared/src/FileCacheTests.cpp index 3f1c5e1a01..b7c2103817 100644 --- a/tests/shared/src/FileCacheTests.cpp +++ b/tests/shared/src/FileCacheTests.cpp @@ -33,7 +33,7 @@ size_t FileCacheTests::getCacheDirectorySize() const { return result; } -FileCachePointer makeFileCache(QString& location) { +FileCachePointer makeFileCache(QString location) { auto result = std::make_shared(location.toStdString(), "tmp"); result->initialize(); result->setMaxSize(MAX_UNUSED_SIZE); @@ -53,7 +53,7 @@ void FileCacheTests::testUnusedFiles() { auto file = cache->writeFile(TEST_DATA.data(), FileCache::Metadata(key, TEST_DATA.size())); QVERIFY(file->_locked); inUseFiles.push_back(file); - + QThread::msleep(10); } QCOMPARE(cache->getNumCachedFiles(), (size_t)0); @@ -100,13 +100,13 @@ void FileCacheTests::testUnusedFiles() { inUseFiles.push_back(file); if (i == 94) { - // Each access touches the file, so we need to sleep here to ensure that the the last 5 files + // Each access touches the file, so we need to sleep here to ensure that the the last 5 files // have later times for cache ejection priority, otherwise the test runs too fast to reliably - // differentiate + // differentiate QThread::msleep(1000); } } - + QCOMPARE(cache->getNumCachedFiles(), (size_t)0); QCOMPARE(cache->getNumTotalFiles(), (size_t)10); inUseFiles.clear(); @@ -119,7 +119,7 @@ size_t FileCacheTests::getFreeSpace() const { return QStorageInfo(_testDir.path()).bytesFree(); } -// FIXME if something else is changing the amount of free space on the target drive concurrently with this test +// FIXME if something else is changing the amount of free space on the target drive concurrently with this test // running, then it may fail void FileCacheTests::testFreeSpacePreservation() { QCOMPARE(getCacheDirectorySize(), MAX_UNUSED_SIZE); diff --git a/tests/shared/src/GeometryUtilTests.cpp b/tests/shared/src/GeometryUtilTests.cpp index ccb3dc8a0e..eb9be4987f 100644 --- a/tests/shared/src/GeometryUtilTests.cpp +++ b/tests/shared/src/GeometryUtilTests.cpp @@ -31,20 +31,20 @@ static void testSphereVsCone(const glm::vec3 coneNormal, const glm::vec3 coneBiN glm::vec3 coneCenter = glm::vec3(0.0f, 0.0f, 0.0f); glm::vec3 sphereCenter = coneCenter + coneEdge * sphereDistance; float result = coneSphereAngle(coneCenter, u, sphereCenter, sphereRadius); - QCOMPARE(isnan(result), false); + QCOMPARE(glm::isnan(result), false); QCOMPARE(result < coneAngle, true); // push sphere outward from edge so it is tangent to the cone. glm::vec3 sphereOffset = glm::angleAxis(PI / 2.0f, w) * coneEdge; sphereCenter += sphereOffset * sphereRadius; result = coneSphereAngle(coneCenter, u, sphereCenter, sphereRadius); - QCOMPARE(isnan(result), false); + QCOMPARE(glm::isnan(result), false); QCOMPARE_WITH_ABS_ERROR(result, coneAngle, 0.001f); // push sphere outward from edge a bit further, so it is outside of the cone. sphereCenter += 0.1f * sphereOffset; result = coneSphereAngle(coneCenter, u, sphereCenter, sphereRadius); - QCOMPARE(isnan(result), false); + QCOMPARE(glm::isnan(result), false); QCOMPARE(result > coneAngle, true); } diff --git a/tests/shared/src/PathUtilsTests.cpp b/tests/shared/src/PathUtilsTests.cpp index 1c445908f7..3aec4fa5f9 100644 --- a/tests/shared/src/PathUtilsTests.cpp +++ b/tests/shared/src/PathUtilsTests.cpp @@ -16,12 +16,8 @@ QTEST_MAIN(PathUtilsTests) void PathUtilsTests::testPathUtils() { - QString result = PathUtils::qmlBasePath(); -#if DEV_BUILD - QVERIFY(result.startsWith("file:///")); -#else + QString result = PathUtils::qmlBaseUrl(); QVERIFY(result.startsWith("qrc:///")); -#endif QVERIFY(result.endsWith("/")); }