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

Function test_calloc

test/core/test_emmalloc.c:76–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76void test_calloc() {
77 stage("calloc");
78 emmalloc_blank_slate_from_orbit();
79 char* ptr = (char*)malloc(10);
80 ptr[0] = 77;
81 free(ptr);
82 char* cptr = (char*)calloc(10, 1);
83 assert(cptr == ptr);
84 assert(ptr[0] == 0);
85}
86
87void test_realloc() {
88 stage("realloc0");

Callers 1

mainFunction · 0.85

Calls 6

stageFunction · 0.85
mallocFunction · 0.70
freeFunction · 0.70
callocFunction · 0.50
assertFunction · 0.50

Tested by

no test coverage detected