X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Foutput%2Fpivot-table-test.c;h=754db1eb8e8ef09304aa4e4b2a9908baf8d21f09;hb=064e63444113026f99a518bf1ec77da5eb6b036b;hp=9e91bfe3bf4e3c8e19f0f8b4b3e373005e51fd06;hpb=b0d11e19181e8b40639947e90724fac7926aee99;p=pspp
diff --git a/tests/output/pivot-table-test.c b/tests/output/pivot-table-test.c
index 9e91bfe3bf..754db1eb8e 100644
--- a/tests/output/pivot-table-test.c
+++ b/tests/output/pivot-table-test.c
@@ -53,7 +53,7 @@ static const char *output_base = "render";
static const char *parse_options (int argc, char **argv);
static void usage (void) NO_RETURN;
static void read_table (struct lexer *);
-static void output_msg (const struct msg *, void *);
+static void output_msg (const struct msg *, struct lexer *);
int
main (int argc, char **argv)
@@ -74,7 +74,7 @@ main (int argc, char **argv)
exit (1);
struct lexer *lexer = lex_create ();
- msg_set_handler (output_msg, lexer);
+ lex_set_message_handler (lexer, output_msg);
lex_include (lexer, reader);
lex_get (lexer);
@@ -137,12 +137,18 @@ configure_drivers (int width, int length UNUSED, int min_break)
string_map_insert (&options, "trim", "true");
register_driver (&options, "%s.pdf", output_base);
+ /* Render to -paged.pdf. */
+ register_driver (&options, "%s-paged.pdf", output_base);
+
+ /* Render to .txt. */
string_map_insert (&options, "box", "unicode");
register_driver (&options, "%s.txt", output_base);
+ /* Render to -ascii.txt. */
string_map_insert (&options, "box", "ascii");
register_driver (&options, "%s-ascii.txt", output_base);
+ /* Render additional versions. */
register_driver (&options, "%s.csv", output_base);
register_driver (&options, "%s.odt", output_base);
register_driver (&options, "%s.spv", output_base);
@@ -586,8 +592,8 @@ read_value_option (struct lexer *lexer, const struct pivot_table *pt,
if (ok)
{
- if (!fmt_check_output (&fmt)
- || !fmt_check_type_compat (&fmt, VAL_NUMERIC))
+ if (!fmt_check_output (fmt)
+ || !fmt_check_type_compat (fmt, VAL_NUMERIC))
exit (1);
value->numeric.format = fmt;
@@ -661,7 +667,7 @@ read_value_option (struct lexer *lexer, const struct pivot_table *pt,
return;
}
- lex_error (lexer, "Expecting valid value option");
+ lex_error (lexer, "Syntax error expecting valid value option.");
exit (1);
}
@@ -826,7 +832,7 @@ read_stroke (struct lexer *lexer)
if (lex_match_id (lexer, table_stroke_to_string (stroke)))
return stroke;
- lex_error (lexer, "expecting stroke");
+ lex_error (lexer, "Syntax error expecting stroke.");
exit (1);
}
@@ -1230,9 +1236,8 @@ read_table (struct lexer *lexer)
}
static void
-output_msg (const struct msg *m_, void *lexer_)
+output_msg (const struct msg *m_, struct lexer *lexer)
{
- struct lexer *lexer = lexer_;
struct msg m = {
.category = m_->category,
.severity = m_->severity,