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

Function sanitizationTest

apps/oidnTest.cpp:1288–1311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1286// -------------------------------------------------------------------------------------------------
1287
1288void sanitizationTest(DeviceRef& device, bool hdr, float value)
1289{
1290 const int W = 191;
1291 const int H = 347;
1292
1293 FilterRef filter = device.newFilter("RT");
1294 REQUIRE(bool(filter));
1295
1296 auto input = makeConstImage(device, W, H, 3, DataType::Float32, value);
1297 auto output = makeConstImage(device, W, H, 3, DataType::Float32, -1000.f);
1298 setFilterImage(filter, "color", input);
1299 setFilterImage(filter, "albedo", input);
1300 setFilterImage(filter, "normal", input);
1301 setFilterImage(filter, "output", output);
1302 filter.set("hdr", hdr);
1303
1304 filter.commit();
1305 REQUIRE(device.getError() == Error::None);
1306
1307 filter.execute();
1308 REQUIRE(device.getError() == Error::None);
1309
1310 REQUIRE(isBetween(output, 0.f, hdr ? std::numeric_limits<float>::max() : 1.f));
1311}
1312
1313TEST_CASE("image sanitization", "[sanitization]")
1314{

Callers 1

oidnTest.cppFile · 0.85

Calls 9

makeConstImageFunction · 0.85
setFilterImageFunction · 0.85
isBetweenFunction · 0.85
maxFunction · 0.50
newFilterMethod · 0.45
setMethod · 0.45
commitMethod · 0.45
getErrorMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected