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

Function checkAsserts

test/core/test_getValue_setValue.cpp:41–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39 setValue($1, min, 'i8');
40#ifdef ASSERTIONS_2
41 function checkAsserts(f, expected) {
42 try {
43 f();
44 } catch(e) {
45 assert(e.message.includes(expected), "expected assertion to include:" + expected);
46 return;
47 }
48 assert(false, "expected assertion");
49 }
50 checkAsserts(() => setValue($1, max + 1, 'i8'), "value (256) too large to write as 8-bit value");
51 checkAsserts(() => setValue($1, min - 1, 'i8'), "value (-129) too small to write as 8-bit value");
52#else

Callers 1

mainFunction · 0.85

Calls 2

fFunction · 0.70
assertFunction · 0.50

Tested by

no test coverage detected