Merge pull request #51 from badgerman/master

fix json test (null-terminate read)
This commit is contained in:
Enno Rehling 2014-11-04 08:02:17 +01:00
commit 6f0773a15f
1 changed files with 3 additions and 1 deletions

View File

@ -35,12 +35,14 @@ static void test_export_no_regions(CuTest * tc) {
char buf[1024];
stream out = { 0 };
int err;
size_t len;
mstream_init(&out);
err = json_export(&out, EXPORT_REGIONS);
CuAssertIntEquals(tc, 0, err);
out.api->rewind(out.handle);
out.api->read(out.handle, buf, sizeof(buf));
len = out.api->read(out.handle, buf, sizeof(buf));
buf[len] = '\0';
CuAssertStrEquals(tc, "{}", strip(buf));
mstream_done(&out);
}