MCPcopy Create free account
hub / github.com/apache/qpid-proton / permute

Function permute

c/tests/refcount_test.cpp:256–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256static void permute(int n, int *indexes, void **objects) {
257 int j;
258 if (n == 1) {
259 test_decref_order(indexes, objects);
260 } else {
261 for (int i = 1; i <= n; i++) {
262 permute(n - 1, indexes, objects);
263 if ((n % 2) == 1) {
264 j = 1;
265 } else {
266 j = i;
267 }
268 swap(indexes, j - 1, n - 1);
269 }
270 }
271}
272
273TEST_CASE("test_decref_permutations") {
274 void *objects[4];

Callers 1

refcount_test.cppFile · 0.85

Calls 2

test_decref_orderFunction · 0.85
swapFunction · 0.70

Tested by

no test coverage detected