MCPcopy Create free account
hub / github.com/RenderKit/oidn / progressTest

Function progressTest

apps/oidnTest.cpp:1359–1388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1357}
1358
1359double progressTest(DeviceRef& device, FilterRef& filter, double nMax = 1000)
1360{
1361 Progress progress(nMax);
1362 filter.setProgressMonitorFunction(progressCallback, &progress);
1363
1364 filter.commit();
1365 REQUIRE(device.getError() == Error::None);
1366
1367 Timer timer;
1368 progress.running = true;
1369 filter.execute();
1370 progress.running = false;
1371 const double time = timer.query();
1372
1373 if (nMax <= 1)
1374 {
1375 // Execution should be cancelled but it's not guaranteed
1376 Error error = device.getError();
1377 REQUIRE((error == Error::None || error == Error::Cancelled));
1378 REQUIRE((progress.n >= nMax && progress.n <= 1));
1379 }
1380 else
1381 {
1382 // Execution should be finished
1383 REQUIRE(device.getError() == Error::None);
1384 REQUIRE(progress.n == 1); // progress must be 100% at the end
1385 }
1386
1387 return time;
1388}
1389
1390TEST_CASE("progress monitor", "[progress]")
1391{

Callers 1

oidnTest.cppFile · 0.85

Calls 4

commitMethod · 0.45
getErrorMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected