From e53a5011237467c73c72b338570e4a455d2d1ef6 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 8 Nov 2008 23:08:30 +0000 Subject: Return errors from constructors and destructors. svn path=/trunk/libparserutils/; revision=5652 --- test/cscodec-utf8.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/cscodec-utf8.c') diff --git a/test/cscodec-utf8.c b/test/cscodec-utf8.c index 5d0580b..85d0443 100644 --- a/test/cscodec-utf8.c +++ b/test/cscodec-utf8.c @@ -38,6 +38,7 @@ static void *myrealloc(void *ptr, size_t len, void *pw) int main(int argc, char **argv) { + parserutils_charset_codec *codec; line_ctx ctx; if (argc != 3) { @@ -49,10 +50,10 @@ int main(int argc, char **argv) PARSERUTILS_OK); assert(parserutils_charset_codec_create("NATS-SEFI-ADD", - myrealloc, NULL) == NULL); + myrealloc, NULL, &codec) == PARSERUTILS_BADENCODING); - ctx.codec = parserutils_charset_codec_create("UTF-8", myrealloc, NULL); - assert(ctx.codec != NULL); + assert(parserutils_charset_codec_create("UTF-8", myrealloc, NULL, + &ctx.codec) == PARSERUTILS_OK); ctx.buflen = parse_filesize(argv[2]); if (ctx.buflen == 0) -- cgit v1.2.3