MCPcopy Create free account
hub / github.com/cutdigital/mcut / UTEST_F

Function UTEST_F

tests/source/concurrentSynchronizedContexts.cpp:142–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142UTEST_F(ConcurrentSynchronizedContexts, sequentialDispatchCalls)
143{
144 for (McInt32 i = 0; i < (McInt32)utest_fixture->contexts.size(); ++i) {
145 McEvent dispatchEvent = MC_NULL_HANDLE;
146 ASSERT_EQ(mcEnqueueDispatch(
147 utest_fixture->contexts[i],
148 MC_DISPATCH_VERTEX_ARRAY_DOUBLE,
149 utest_fixture->cubeVertices.data(),
150 utest_fixture->cubeFaces.data(),
151 utest_fixture->cubeFaceSizes.data(),
152 utest_fixture->numCubeVertices,
153 utest_fixture->numCubeFaces,
154 utest_fixture->cutMeshVertices.data(),
155 utest_fixture->cutMeshFaces.data(),
156 nullptr, // cutMeshFaceSizes, // no need to give 'faceSizes' parameter since cut-mesh is a triangle mesh
157 utest_fixture->numCutMeshVertices,
158 utest_fixture->numCutMeshFaces,
159 0, NULL, &dispatchEvent),
160 MC_NO_ERROR);
161
162 ASSERT_TRUE(dispatchEvent != MC_NULL_HANDLE);
163
164 //
165 // wait until event is complete
166 //
167 ASSERT_EQ(mcWaitForEvents(1, &dispatchEvent), MC_NO_ERROR);
168
169 McSize bytes = 0;
170
171 ASSERT_EQ(mcGetEventInfo(dispatchEvent, MC_EVENT_COMMAND_EXECUTION_STATUS, 0, NULL, &bytes), MC_NO_ERROR);
172 ASSERT_EQ(bytes, sizeof(McEventCommandExecStatus));
173
174 McEventCommandExecStatus dispatchEventStatus = (McEventCommandExecStatus)MC_UNDEFINED_VALUE;
175 ASSERT_EQ(mcGetEventInfo(dispatchEvent, MC_EVENT_COMMAND_EXECUTION_STATUS, bytes, &dispatchEventStatus, NULL), MC_NO_ERROR);
176
177 ASSERT_TRUE(dispatchEventStatus & McEventCommandExecStatus::MC_COMPLETE);
178
179 ASSERT_EQ(mcReleaseEvents(1, &dispatchEvent), MC_NO_ERROR);
180 }
181}
182
183UTEST_F(ConcurrentSynchronizedContexts, parallelButUnsynchronisedDispatchCalls)
184{

Callers

nothing calls this directly

Calls 5

mcEnqueueDispatchFunction · 0.85
mcWaitForEventsFunction · 0.85
mcGetEventInfoFunction · 0.85
mcReleaseEventsFunction · 0.85
waitMethod · 0.80

Tested by

no test coverage detected