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

Function bufferTest

test/module_exports/test.c:14–23  ·  view source on GitHub ↗

* This is a simple test method to verify that the contents of a buffer created in JavaScript can be * passed into a C function. */

Source from the content-addressed store, hash-verified

12 * passed into a C function.
13 */
14void bufferTest(const void* source, unsigned int sourceLen) {
15 int i = 0;
16 unsigned char* src = (unsigned char*)source;
17
18 printf("in test method: size of source buffer = %d\n", sourceLen);
19
20 for (i = 0; i < sourceLen; i++) {
21 printf("source[%d] = %d\n", i, src[i]);
22 }
23}
24

Callers 1

main.jsFile · 0.85

Calls 1

printfFunction · 0.85

Tested by

no test coverage detected