MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / runTest

Function runTest

test/core/test_reinterpreted_ptrs.cpp:29–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27const Foo *magic2 = reinterpret_cast<Foo *>(0xDEAD888F);
28
29static void runTest() {
30
31 const Foo *a = new Foo();
32 const Foo *b = a;
33
34 if (a->getBar() == 0) {
35 if (a->baz == 4712)
36 b = magic1;
37 else
38 b = magic2;
39 }
40
41 printf("%s\n",
42 (b == magic1 ? "magic1" : (b == magic2 ? "magic2" : "neither")));
43 delete a;
44};
45
46int main(int argc, char **argv) {
47 runTest();

Callers 1

mainFunction · 0.70

Calls 2

printfFunction · 0.85
getBarMethod · 0.80

Tested by

no test coverage detected