Skip to content

Commit 029a0e3

Browse files
authored
Merge pull request #1503 from AcademySoftwareFoundation/feature/fix_lite_build
Fix Unit Tests when Delayed Loading is Disabled
2 parents 2a8f8b5 + 2ebdb24 commit 029a0e3

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

openvdb/openvdb/unittest/TestCount.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ TEST_F(TestCount, testMemUsage)
239239
EXPECT_EQ(expectedMaxMem, inCoreMemUsage);
240240
EXPECT_EQ(expectedMaxMem, memUsageIfLoaded);
241241

242+
#ifdef OPENVDB_USE_DELAYED_LOADING
242243
// Write out the grid and read it in with delay-loading. Check the
243244
// expected memory usage values.]
244245

@@ -279,6 +280,7 @@ TEST_F(TestCount, testMemUsage)
279280
std::remove(filename.c_str());
280281

281282
openvdb::uninitialize();
283+
#endif
282284
}
283285

284286

openvdb/openvdb/unittest/TestPointConversion.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,7 @@ TEST_F(TestPointConversion, testPointConversion)
255255

256256
// read/write grid to a temp file
257257

258-
io::TempFile file;
259-
const std::string filename = file.filename();
260-
258+
const std::string filename = "testPointConversion.vdb";
261259
io::File fileOut(filename);
262260

263261
GridCPtrVec grids;
@@ -409,7 +407,6 @@ TEST_F(TestPointConversion, testPointConversion)
409407
EXPECT_NEAR(position.buffer()[i*2].z(), pointData[i].position.z(), /*tolerance=*/1e-6);
410408
}
411409

412-
file.close();
413410
std::remove(filename.c_str());
414411
}
415412

openvdb/openvdb/unittest/TestPointCount.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,7 @@ TEST_F(TestPointCount, testGroup)
288288

289289
// write out grid to a temp file
290290
{
291-
io::TempFile file;
292-
filename = file.filename();
291+
filename = "testPointCount1.vdb";
293292
io::File fileOut(filename);
294293
GridCPtrVec grids{grid};
295294
fileOut.write(grids);
@@ -524,8 +523,7 @@ TEST_F(TestPointCount, testOffsets)
524523

525524
// write out grid to a temp file
526525
{
527-
io::TempFile file;
528-
filename = file.filename();
526+
filename = "testPointCount1.vdb";
529527
io::File fileOut(filename);
530528
GridCPtrVec grids{grid};
531529
fileOut.write(grids);

openvdb/openvdb/unittest/TestPointRasterizeFrustum.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,7 +2153,9 @@ TEST_F(TestPointRasterizeFrustum, testStreaming)
21532153

21542154
auto leaf = points->tree().cbeginLeaf();
21552155
EXPECT_TRUE(leaf);
2156+
#ifdef OPENVDB_USE_DELAYED_LOADING
21562157
EXPECT_TRUE(leaf->buffer().isOutOfCore());
2158+
#endif
21572159

21582160
using Rasterizer = FrustumRasterizer<PointDataGrid>;
21592161
using Settings = FrustumRasterizerSettings;
@@ -2324,10 +2326,12 @@ TEST_F(TestPointRasterizeFrustum, testStreaming)
23242326
auto points2 = points->deepCopy();
23252327
points2->setTransform(transform);
23262328

2329+
#ifdef OPENVDB_USE_DELAYED_LOADING
23272330
// verify both grids are out-of-core
23282331

23292332
EXPECT_TRUE(points->tree().cbeginLeaf()->buffer().isOutOfCore());
23302333
EXPECT_TRUE(points2->tree().cbeginLeaf()->buffer().isOutOfCore());
2334+
#endif
23312335

23322336
#ifndef ONLY_RASTER_FLOAT
23332337
// memory tests

0 commit comments

Comments
 (0)