2014-03-13 15:33:44 +01:00
|
|
|
#include <platform.h>
|
|
|
|
#include <CuTest.h>
|
|
|
|
#include <stream.h>
|
|
|
|
#include <memstream.h>
|
|
|
|
#include "export.h"
|
|
|
|
#include "bind_eressea.h"
|
|
|
|
|
|
|
|
static void test_export(CuTest * tc) {
|
|
|
|
char buf[1024];
|
|
|
|
stream out = { 0 };
|
|
|
|
int err;
|
|
|
|
|
|
|
|
mstream_init(&out);
|
|
|
|
err = export_json(&out, EXPORT_REGIONS);
|
|
|
|
CuAssertIntEquals(tc, 0, err);
|
|
|
|
out.api->rewind(out.handle);
|
2014-03-14 07:59:26 +01:00
|
|
|
out.api->read(out.handle, buf, sizeof(buf));
|
|
|
|
CuAssertStrEquals(tc, "{\n}\n", buf);
|
2014-03-13 15:33:44 +01:00
|
|
|
mstream_done(&out);
|
|
|
|
}
|
|
|
|
|
|
|
|
CuSuite *get_bindings_suite(void) {
|
|
|
|
CuSuite *suite = CuSuiteNew();
|
|
|
|
SUITE_ADD_TEST(suite, test_export);
|
|
|
|
return suite;
|
|
|
|
}
|