projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6171d2d
)
datasheet-test: Fix printing of string values in error messages.
author
Ben Pfaff
<blp@gnu.org>
Sat, 30 May 2009 04:43:33 +0000
(21:43 -0700)
committer
Ben Pfaff
<blp@gnu.org>
Sun, 7 Jun 2009 04:11:17 +0000
(21:11 -0700)
tests/data/datasheet-test.c
patch
|
blob
|
history
diff --git
a/tests/data/datasheet-test.c
b/tests/data/datasheet-test.c
index 5eeb355346cf98fb82ee227d5925cf3a2f420a71..56c8d26e44dbb74c02eb6838ffc0598b12b0717b 100644
(file)
--- a/
tests/data/datasheet-test.c
+++ b/
tests/data/datasheet-test.c
@@
-258,11
+258,16
@@
check_datasheet (struct mc *mc, struct datasheet *ds,
ds_put_format (&s, "row %zu:", row);
for (col = 0; col < n_columns; col++)
{
ds_put_format (&s, "row %zu:", row);
for (col = 0; col < n_columns; col++)
{
+ int width = caseproto_get_width (proto, col);
union value v;
union value v;
- value_init (&v,
0
);
+ value_init (&v,
width
);
if (!datasheet_get_value (ds, row, col, &v))
NOT_REACHED ();
if (!datasheet_get_value (ds, row, col, &v))
NOT_REACHED ();
- ds_put_format (&s, " %g", v.f);
+ if (width == 0)
+ ds_put_format (&s, " %g", v.f);
+ else
+ ds_put_format (&s, " '%.*s'",
+ width, value_str (&v, width));
}
mc_error (mc, "%s", ds_cstr (&s));
}
}
mc_error (mc, "%s", ds_cstr (&s));
}