mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-13 22:25:40 +00:00
23 lines
467 B
C
23 lines
467 B
C
#include <stdio.h>
|
|
#include "../wasmer.h"
|
|
#include <assert.h>
|
|
#include <stdint.h>
|
|
|
|
int main()
|
|
{
|
|
// Read the wasm file bytes
|
|
FILE *file = fopen("assets/sum.wasm", "r");
|
|
fseek(file, 0, SEEK_END);
|
|
long len = ftell(file);
|
|
uint8_t *bytes = malloc(len);
|
|
fseek(file, 0, SEEK_SET);
|
|
fread(bytes, 1, len, file);
|
|
fclose(file);
|
|
|
|
bool result = wasmer_validate(bytes, len);
|
|
printf("Result: %d", result);
|
|
assert(result);
|
|
|
|
return 0;
|
|
}
|