| 4477 | : VerifyApplication::Test (name, isa, VerifyApplication::TEST_SHOULD_PASS) {} |
| 4478 | |
| 4479 | VerifyApplication::TestReturnValue run (VerifyApplication* state, bool silent) |
| 4480 | { |
| 4481 | std::string cfg = state->rtcore + ",isa=" + stringOfISA(isa); |
| 4482 | RTCDeviceRef device = rtcNewDevice(cfg.c_str()); |
| 4483 | errorHandler (nullptr, rtcGetDeviceError(device)); |
| 4484 | AssertNoError(device); |
| 4485 | RTCGeometry geom0 = rtcNewGeometry (device, RTC_GEOMETRY_TYPE_TRIANGLE); |
| 4486 | AssertNoError(device); |
| 4487 | using embree::Geometry; |
| 4488 | auto geometry = (Geometry *) geom0; |
| 4489 | |
| 4490 | // test construction |
| 4491 | if (geometry->state != (unsigned)Geometry::State::MODIFIED) { |
| 4492 | return VerifyApplication::FAILED; |
| 4493 | } |
| 4494 | |
| 4495 | //test update |
| 4496 | geometry->state = (unsigned)Geometry::State::COMMITTED; |
| 4497 | geometry->update(); |
| 4498 | if (geometry->state != (unsigned)Geometry::State::MODIFIED) { |
| 4499 | return VerifyApplication::FAILED; |
| 4500 | } |
| 4501 | |
| 4502 | //test commit |
| 4503 | geometry->state = (unsigned)Geometry::State::MODIFIED; |
| 4504 | geometry->commit(); |
| 4505 | if (geometry->state != (unsigned)Geometry::State::COMMITTED) { |
| 4506 | return VerifyApplication::FAILED; |
| 4507 | } |
| 4508 | |
| 4509 | // test disable |
| 4510 | geometry->enabled = false; |
| 4511 | geometry->disable (); |
| 4512 | if (geometry->isEnabled ()) { |
| 4513 | return VerifyApplication::FAILED; |
| 4514 | } |
| 4515 | |
| 4516 | geometry->enabled = true; |
| 4517 | geometry->disable (); |
| 4518 | if (geometry->isEnabled ()) { |
| 4519 | return VerifyApplication::FAILED; |
| 4520 | } |
| 4521 | |
| 4522 | // test enable |
| 4523 | geometry->enabled = true; |
| 4524 | geometry->enable (); |
| 4525 | if (!geometry->isEnabled ()) { |
| 4526 | return VerifyApplication::FAILED; |
| 4527 | } |
| 4528 | |
| 4529 | geometry->enabled = false; |
| 4530 | geometry->enable (); |
| 4531 | if (!geometry->isEnabled ()) { |
| 4532 | return VerifyApplication::FAILED; |
| 4533 | } |
| 4534 | |
| 4535 | rtcReleaseGeometry(geom0); |
| 4536 | AssertNoError(device); |
nothing calls this directly
no test coverage detected