X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=tests%2Foutput%2Frender-test.c;h=5f4c1da00bc5313d98558e9bfa702981f1929e3b;hb=960d7a3b2d6748d78537572df211a47eb0709ed5;hp=91fd76c4150ff0a778a0e0010770bd3700189aac;hpb=fe8dc2171009e90d2335f159d05f7e6660e24780;p=pspp diff --git a/tests/output/render-test.c b/tests/output/render-test.c index 91fd76c415..5f4c1da00b 100644 --- a/tests/output/render-test.c +++ b/tests/output/render-test.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. + Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -122,7 +122,10 @@ configure_drivers (int width, int length) string_map_destroy (&tmp); if (draw_mode) + { + string_map_destroy (&options); return; + } /* Render to render.txt. */ string_map_replace (&options, "output-file", "render.txt"); @@ -358,6 +361,7 @@ draw (FILE *stream) while (fgets (buffer, sizeof buffer, stream)) { char text[sizeof buffer]; + int length; int emph; int x, y; @@ -365,9 +369,11 @@ draw (FILE *stream) if (strchr ("#\r\n", buffer[0])) continue; - if (sscanf (buffer, "%d %d %d %[^\n]", &x, &y, &emph, text) != 4) + if (sscanf (buffer, "%d %d %d %[^\n]", &x, &y, &emph, text) == 4) + ascii_test_write (ascii_driver, text, x, y, emph ? TAB_EMPH : 0); + else if (sscanf (buffer, "set-length %d %d", &y, &length) == 2) + ascii_test_set_length (ascii_driver, y, length); + else error (1, 0, "line %d has invalid format", line); - - ascii_test_write (ascii_driver, text, x, y, emph ? TAB_EMPH : 0); } }