projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f42ff4e
)
pivot-table-test
author
Ben Pfaff
<blp@cs.stanford.edu>
Thu, 31 Dec 2020 03:18:23 +0000
(19:18 -0800)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Thu, 31 Dec 2020 03:58:11 +0000
(19:58 -0800)
tests/output/pivot-table-test.c
patch
|
blob
|
history
diff --git
a/tests/output/pivot-table-test.c
b/tests/output/pivot-table-test.c
index 7890470d5fe548fe01da5e8fc5283551335da3b8..6959c909ae1dfa5b3c50e33a5acdc7abc0a3612e 100644
(file)
--- 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, "-");
string_map_insert (&options, "box", box);
register_driver (&options, "-");
- /* Render to <base>.txt. */
- register_driver (&options, "%s.txt", output_base);
#ifdef HAVE_CAIRO
/* Render to <base>.pdf. */
#ifdef HAVE_CAIRO
/* Render to <base>.pdf. */
@@
-150,11
+148,10
@@
configure_drivers (int width, int length, int min_break)
register_driver (&options, "%s.pdf", output_base);
#endif
register_driver (&options, "%s.pdf", output_base);
#endif
- /* Render to <base>.csv. */
+ register_driver (&options, "%s.txt", output_base);
register_driver (&options, "%s.csv", output_base);
register_driver (&options, "%s.csv", output_base);
-
- /* Render to <base>.odt. */
register_driver (&options, "%s.odt", output_base);
register_driver (&options, "%s.odt", output_base);
+ register_driver (&options, "%s.spv", output_base);
string_map_destroy (&options);
}
string_map_destroy (&options);
}
@@
-575,6
+572,19
@@
read_stroke (struct lexer *lexer)
exit (1);
}
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)
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))
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);
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;
if (!lex_force_match (lexer, T_ENDCMD))
exit (1);
return pt;