X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Foutput%2Fpivot-table-test.c;fp=tests%2Foutput%2Fpivot-table-test.c;h=6959c909ae1dfa5b3c50e33a5acdc7abc0a3612e;hb=66a7bca5ec762890fbb9d590c783ae57d3852596;hp=7890470d5fe548fe01da5e8fc5283551335da3b8;hpb=f42ff4eab4c37423a9b780e91416f51297b01e31;p=pspp diff --git a/tests/output/pivot-table-test.c b/tests/output/pivot-table-test.c index 7890470d5f..6959c909ae 100644 --- a/tests/output/pivot-table-test.c +++ b/tests/output/pivot-table-test.c @@ -129,8 +129,6 @@ configure_drivers (int width, int length, int min_break) string_map_insert (&options, "box", box); register_driver (&options, "-"); - /* Render to .txt. */ - register_driver (&options, "%s.txt", output_base); #ifdef HAVE_CAIRO /* Render to .pdf. */ @@ -150,11 +148,10 @@ configure_drivers (int width, int length, int min_break) register_driver (&options, "%s.pdf", output_base); #endif - /* Render to .csv. */ + register_driver (&options, "%s.txt", output_base); register_driver (&options, "%s.csv", output_base); - - /* Render to .odt. */ register_driver (&options, "%s.odt", output_base); + register_driver (&options, "%s.spv", output_base); string_map_destroy (&options); } @@ -575,6 +572,19 @@ read_stroke (struct lexer *lexer) exit (1); } +static struct cell_color +read_color (struct lexer *lexer) +{ + struct cell_color color; + if (!parse_color__ (lex_tokcstr (lexer), &color)) + { + msg (SE, "%s: unknown color", lex_tokcstr (lexer)); + exit (1); + } + lex_get (lexer); + return color; +} + static bool parse_value_setting (struct lexer *lexer, const char *name, struct pivot_value **valuep) @@ -631,14 +641,7 @@ read_border (struct lexer *lexer, struct pivot_table *pt) struct table_border_style style = TABLE_BORDER_STYLE_INITIALIZER; style.stroke = read_stroke (lexer); if (lex_is_string (lexer)) - { - if (!parse_color__ (lex_tokcstr (lexer), &style.color)) - { - msg (SE, "%s: unknown color", lex_tokcstr (lexer)); - exit (1); - } - lex_get (lexer); - } + style.color = read_color (lexer); if (!lex_force_match (lexer, T_RPAREN)) exit (1); @@ -726,6 +729,23 @@ read_table (struct lexer *lexer) } } + size_t *dindexes = xcalloc (pt->n_dimensions, sizeof *dindexes); + for (size_t i = 0; ; i++) + { + pivot_table_put (pt, dindexes, pt->n_dimensions, + pivot_value_new_integer (i)); + + for (size_t j = 0; j < pt->n_dimensions; j++) + { + if (++dindexes[j] < pt->dimensions[j]->n_leaves) + goto next; + dindexes[j] = 0; + } + break; + next:; + } + free (dindexes); + if (!lex_force_match (lexer, T_ENDCMD)) exit (1); return pt;