summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@theqtcompany.com>2015-08-14 10:46:31 +0200
committerAndy Nichols <andy.nichols@theqtcompany.com>2015-08-17 15:06:19 +0000
commit2ec0946ce68d3dc884b90c2291780c4ee12fc91e (patch)
treecf396f86ed45c5099af7246653c456d5211ad09e /tests
parent2c4f13290cb9f96184d386c8a3a525569359f553 (diff)
Fix build errors on OS X 10.8
error: no member named 'srand' in namespace 'std' when <cstdlib> is not included. Using int instead of bool in tst_raycasting Change-Id: I03bc669a2a3683376523a25e854e485c6ba0e0c5 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/render/raycasting/tst_raycasting.cpp18
-rw-r--r--tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp1
2 files changed, 10 insertions, 9 deletions
diff --git a/tests/auto/render/raycasting/tst_raycasting.cpp b/tests/auto/render/raycasting/tst_raycasting.cpp
index 6b0a9d80a..a41f6c9a1 100644
--- a/tests/auto/render/raycasting/tst_raycasting.cpp
+++ b/tests/auto/render/raycasting/tst_raycasting.cpp
@@ -72,7 +72,7 @@ void tst_RayCasting::shouldIntersect_data()
{
QTest::addColumn<QRay3D>("ray");
QTest::addColumn<Sphere>("sphere");
- QTest::addColumn<int>("shouldIntersect");
+ QTest::addColumn<bool>("shouldIntersect");
QRay3D ray(QVector3D(1, 1, 1), QVector3D(0, 0, 1));
@@ -84,20 +84,20 @@ void tst_RayCasting::shouldIntersect_data()
Sphere sphere6(QVector3D(2, 2, 13), 1);
Sphere sphere7(QVector3D(2, 2, 15), 5);
- QTest::newRow("Ray starts inside sphere") << ray << sphere1 << 1;
- QTest::newRow("Ray starts inside sphere") << ray << sphere2 << 1;
- QTest::newRow("Ray intersects sphere tangentially") << ray << sphere3 << 1;
- QTest::newRow("No intersection") << ray << sphere4 << 0;
- QTest::newRow("Ray intersect sphere") << ray << sphere5 << 1;
- QTest::newRow("No intersection") << ray << sphere6 << 0;
- QTest::newRow("Ray intersect sphere") << ray << sphere7 << 1;
+ QTest::newRow("Ray starts inside sphere") << ray << sphere1 << true;
+ QTest::newRow("Ray starts inside sphere") << ray << sphere2 << true;
+ QTest::newRow("Ray intersects sphere tangentially") << ray << sphere3 << true;
+ QTest::newRow("No intersection") << ray << sphere4 << false;
+ QTest::newRow("Ray intersect sphere") << ray << sphere5 << true;
+ QTest::newRow("No intersection") << ray << sphere6 << false;
+ QTest::newRow("Ray intersect sphere") << ray << sphere7 << true;
}
void tst_RayCasting::shouldIntersect()
{
QFETCH(QRay3D, ray);
QFETCH(Sphere, sphere);
- QFETCH(int, shouldIntersect);
+ QFETCH(bool, shouldIntersect);
QVector3D intersectionPoint;
diff --git a/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp b/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp
index b7f34152c..d14adc486 100644
--- a/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp
+++ b/tests/benchmarks/core/qresourcesmanager/qresourcesmanager/tst_bench_qresourcesmanager.cpp
@@ -39,6 +39,7 @@
#include <Qt3DCore/qhandle.h>
#include <Qt3DCore/private/qresourcemanager_p.h>
#include <ctime>
+#include <cstdlib>
class tst_QResourceManager : public QObject
{