Extended volume unit test. This is mainly to test whether I can commit to the new Git repo on BitBucket.

This commit is contained in:
Daviw Williams 2012-12-03 16:21:18 +01:00
parent f4917e5001
commit 57b78e148b

View File

@ -47,25 +47,38 @@ int32_t complexVolumeTest(void)
} }
} }
return testVolume.getVoxelAt(10,20,30); int32_t sum = 0;
for(int z = testVolume.getEnclosingRegion().getLowerZ(); z <= testVolume.getEnclosingRegion().getUpperZ(); z++)
{
for(int y = testVolume.getEnclosingRegion().getLowerY(); y <= testVolume.getEnclosingRegion().getUpperY(); y++)
{
for(int x = testVolume.getEnclosingRegion().getLowerX(); x <= testVolume.getEnclosingRegion().getUpperX(); x++)
{
sum += testVolume.getVoxelAt(x, y, z);
}
}
}
return sum;
} }
void TestVolume::testLargeVolume() void TestVolume::testLargeVolume()
{ {
int32_t result = complexVolumeTest< LargeVolume<int32_t> >(); int32_t result = complexVolumeTest< LargeVolume<int32_t> >();
QCOMPARE(result, static_cast<int32_t>(60)); QCOMPARE(result, static_cast<int32_t>(24772608));
} }
void TestVolume::testRawVolume() void TestVolume::testRawVolume()
{ {
int32_t result = complexVolumeTest< RawVolume<int32_t> >(); int32_t result = complexVolumeTest< RawVolume<int32_t> >();
QCOMPARE(result, static_cast<int32_t>(60)); QCOMPARE(result, static_cast<int32_t>(24772608));
} }
void TestVolume::testSimpleVolume() void TestVolume::testSimpleVolume()
{ {
int32_t result = complexVolumeTest< SimpleVolume<int32_t> >(); int32_t result = complexVolumeTest< SimpleVolume<int32_t> >();
QCOMPARE(result, static_cast<int32_t>(60)); QCOMPARE(result, static_cast<int32_t>(24772608));
} }
QTEST_MAIN(TestVolume) QTEST_MAIN(TestVolume)