MCPcopy Create free account
hub / github.com/couchbase/fleece / stackEm

Function stackEm

Tests/SupportTests.cc:31–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29
30template <class T>
31static void stackEm(size_t n, bool expectedOnHeap) {
32 cerr << "TempArray[" << n << "] -- " << n*sizeof(T) << " bytes, on "
33 << (expectedOnHeap ? "heap" : "stack") << "\n";
34 int64_t before = -1;
35 TempArray(myArray, T, n);
36 int64_t after = -1;
37
38 CHECK((sizeof(myArray[0]) == sizeof(T)));
39 CHECK(myArray._onHeap == expectedOnHeap);
40 for (size_t i = 0; i < n; i++)
41 myArray[i] = 0;
42 REQUIRE(before == -1);
43 REQUIRE(after == -1);
44}
45
46
47TEST_CASE("TempArray") {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected