Commit Diff
Diff:
7ef6ceef43f5c7b50cacd03c8026578dcac72e63
0180fcdd5a586643934eb12262e33b815b4bcfcc
Commit:
0180fcdd5a586643934eb12262e33b815b4bcfcc
Tree:
382f0b24171f80bc3711f6416f7eedddf469229d
Author:
Omar Polo <op@omarpolo.com>
Date:
Thu May 19 08:05:08 2022 UTC
Message:
fix parser test after parser_serialize changes
commit - 7ef6ceef43f5c7b50cacd03c8026578dcac72e63
commit + 0180fcdd5a586643934eb12262e33b815b4bcfcc
blob - dccf9cf766e339431a64cb72e3b617f60328af18
blob + da3aa690a1a80b49bc6f354b9123a355a96cc5a4
--- test/gmparser.c
+++ test/gmparser.c
@@ -32,11 +32,12 @@ main(void)
int
main(void)
{
+ FILE *fp;
struct tab tab;
struct hist hist;
- struct evbuffer *evb;
ssize_t r;
- char buf[BUFSIZ];
+ size_t blen;
+ char buf[BUFSIZ], *b;
memset(&tab, 0, sizeof(tab));
memset(&hist, 0, sizeof(hist));
@@ -55,15 +56,14 @@ main(void)
if (!parser_free(&tab))
err(1, "parser_free");
- if ((evb = evbuffer_new()) == NULL)
- err(1, "evbuffer_new");
+ if ((fp = open_memstream(&b, &blen)) == NULL)
+ err(1, "open_memstream");
- if (parser_serialize(&tab, evb) == -1)
+ if (parser_serialize(&tab, fp) == -1)
err(1, "parser_serialize");
- evbuffer_write(evb, 1);
+ fclose(fp);
+ write(1, b, blen);
- evbuffer_free(evb);
-
return 0;
}
Omar Polo