X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=svgtiny_test.c;h=be1a4eb0c5c9581342d1f96b63f5ee360a39eb2e;hb=6f7443f938b95b5a5b4b66f5e2f8f93415d888b3;hp=8d485d31a1e885c47aa6d478f06e823397425faf;hpb=2cdbd4fcb47430897d7aa896542dacb54c461cbc;p=libsvgtiny.git diff --git a/svgtiny_test.c b/svgtiny_test.c index 8d485d3..be1a4eb 100644 --- a/svgtiny_test.c +++ b/svgtiny_test.c @@ -64,8 +64,29 @@ int main(int argc, char *argv[]) /* parse */ code = svgtiny_parse(diagram, buffer, size, argv[1], 1000, 1000); - if (code != svgtiny_OK) - fprintf(stderr, "svgtiny_parse failed: %i\n", code); + if (code != svgtiny_OK) { + fprintf(stderr, "svgtiny_parse failed: "); + switch (code) { + case svgtiny_OUT_OF_MEMORY: + fprintf(stderr, "svgtiny_OUT_OF_MEMORY"); + break; + case svgtiny_LIBXML_ERROR: + fprintf(stderr, "svgtiny_LIBXML_ERROR"); + break; + case svgtiny_NOT_SVG: + fprintf(stderr, "svgtiny_NOT_SVG"); + break; + case svgtiny_SVG_ERROR: + fprintf(stderr, "svgtiny_SVG_ERROR: line %i: %s", + diagram->error_line, + diagram->error_message); + break; + default: + fprintf(stderr, "unknown svgtiny_code %i", code); + break; + } + fprintf(stderr, "\n"); + } free(buffer); @@ -80,6 +101,7 @@ int main(int argc, char *argv[]) printf("stroke none "); else printf("stroke #%.6x ", diagram->shape[i].stroke); + printf("stroke-width %i ", diagram->shape[i].stroke_width); if (diagram->shape[i].path) { printf("path '"); for (unsigned int j = 0;