| 1596 | : VerifyApplication::Test(name,isa,VerifyApplication::TEST_SHOULD_PASS), sflags(sflags) {} |
| 1597 | |
| 1598 | VerifyApplication::TestReturnValue run(VerifyApplication* state, bool silent) |
| 1599 | { |
| 1600 | std::string cfg = state->rtcore + ",isa="+stringOfISA(isa); |
| 1601 | RTCDeviceRef device = rtcNewDevice(cfg.c_str()); |
| 1602 | errorHandler(nullptr,rtcGetDeviceError(device)); |
| 1603 | VerifyScene scene(device,sflags); |
| 1604 | AssertNoError(device); |
| 1605 | |
| 1606 | int geom[128]; |
| 1607 | for (size_t i=0; i<128; i++) geom[i] = -1; |
| 1608 | |
| 1609 | for (size_t i=0; i<size_t(50*state->intensity); i++) |
| 1610 | { |
| 1611 | for (size_t j=0; j<10; j++) |
| 1612 | { |
| 1613 | int index = random_int()%128; |
| 1614 | if (geom[index] == -1) { |
| 1615 | if (random_bool()) { |
| 1616 | RTCGeometry hgeom = rtcNewGeometry(device, RTC_GEOMETRY_TYPE_TRIANGLE); |
| 1617 | rtcCommitGeometry(hgeom); |
| 1618 | unsigned int geomID = rtcAttachGeometry(scene,hgeom); |
| 1619 | rtcReleaseGeometry(hgeom); |
| 1620 | geom[geomID] = geomID; |
| 1621 | AssertNoError(device); |
| 1622 | } else { |
| 1623 | RTCGeometry hgeom = rtcNewGeometry(device, RTC_GEOMETRY_TYPE_TRIANGLE); |
| 1624 | rtcCommitGeometry(hgeom); |
| 1625 | rtcAttachGeometryByID(scene,hgeom,index); |
| 1626 | rtcReleaseGeometry(hgeom); |
| 1627 | geom[index] = index; |
| 1628 | AssertNoError(device); |
| 1629 | } |
| 1630 | } else { |
| 1631 | if (random_bool()) { |
| 1632 | rtcDetachGeometry(scene,geom[index]); |
| 1633 | AssertNoError(device); |
| 1634 | geom[index] = -1; |
| 1635 | } |
| 1636 | } |
| 1637 | } |
| 1638 | rtcCommitScene(scene); |
| 1639 | AssertNoError(device); |
| 1640 | } |
| 1641 | return VerifyApplication::PASSED; |
| 1642 | } |
| 1643 | }; |
| 1644 | |
| 1645 | struct EnableDisableGeometryTest : public VerifyApplication::Test |
nothing calls this directly
no test coverage detected