zig/test/standalone/mix_o_files/test.c
stratact a165cc0535 Get more of the tests passing for FreeBSD (#3197)
* Add missing <stdint.h> include for uint8_t type declaration

* Add needed FreeBSD check to link to libpthread

* Apply patch to enable more tests in the FreeBSD CI
2019-09-10 14:50:54 -04:00

22 lines
496 B
C

// This header is generated by zig from base64.zig
#include "base64.h"
#include <assert.h>
#include <string.h>
#include <stdint.h>
extern int *x_ptr;
int main(int argc, char **argv) {
const char *encoded = "YWxsIHlvdXIgYmFzZSBhcmUgYmVsb25nIHRvIHVz";
char buf[200];
size_t len = decode_base_64((uint8_t *)buf, 200, (uint8_t *)encoded, strlen(encoded));
buf[len] = 0;
assert(strcmp(buf, "all your base are belong to us") == 0);
assert(*x_ptr == 1234);
return 0;
}