From 63da21f4f91335ab36750bcf9046cfc913d59086 Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Sun, 24 Sep 2006 07:28:24 +0000 Subject: [PATCH] add test for --> MIME type (linked URL) --- src/test_grabbag/picture/main.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/test_grabbag/picture/main.c b/src/test_grabbag/picture/main.c index 4cb3f6f5..898930ec 100644 --- a/src/test_grabbag/picture/main.c +++ b/src/test_grabbag/picture/main.c @@ -72,7 +72,7 @@ static FLAC__bool test_one_picture(const char *prefix, const PictureFile *pf, co printf("testing grabbag__picture_parse_specification(\"%s\")... ", s); if(0 == (obj = grabbag__picture_parse_specification(s, &error))) - return failed_(0); + return failed_(error); if(debug_) { printf("\nmime_type=%s\ndescription=%s\nwidth=%u\nheight=%u\ndepth=%u\ncolors=%u\ndata_length=%u\n", obj->data.picture.mime_type, @@ -151,6 +151,17 @@ static FLAC__bool do_picture(const char *prefix) return failed_("expected error, got object"); printf("OK (failed as expected: %s)\n", error); + /* invalid spec: need resolution for linked URL */ + printf("testing grabbag__picture_parse_specification(\"-->|desc||http://blah.blah.blah/z.gif\")... "); + if(0 != (obj = grabbag__picture_parse_specification("-->|desc||http://blah.blah.blah/z.gif", &error))) + return failed_("expected error, got object"); + printf("OK (failed as expected: %s)\n", error); + + printf("testing grabbag__picture_parse_specification(\"-->|desc|320x240x9|http://blah.blah.blah/z.gif\")... "); + if(0 == (obj = grabbag__picture_parse_specification("-->|desc|320x240x9|http://blah.blah.blah/z.gif", &error))) + return failed_(error); + printf("OK\n"); + /* test automatic parsing of picture files to get resolution/color info */ for(i = 0; i < sizeof(picturefiles)/sizeof(picturefiles[0]); i++) if(!test_one_picture(prefix, picturefiles+i, ""))