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-8859.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'test/cscodec-8859.c') diff --git a/test/cscodec-8859.c b/test/cscodec-8859.c index 6378cd4..75ce20e 100644 --- a/test/cscodec-8859.c +++ b/test/cscodec-8859.c @@ -40,6 +40,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) { @@ -51,7 +52,7 @@ 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.buflen = parse_filesize(argv[2]); if (ctx.buflen == 0) @@ -178,9 +179,9 @@ bool handle_line(const char *data, size_t datalen, void *pw) memcpy(enc_name, enc, end - enc); enc_name[end - enc] = 0; - ctx->codec = parserutils_charset_codec_create(enc_name, - myrealloc, NULL); - assert(ctx->codec != NULL); + assert(parserutils_charset_codec_create(enc_name, + myrealloc, NULL, &ctx->codec) == + PARSERUTILS_OK); ctx->hadenc = true; } -- cgit v1.2.3