X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fdata%2Fdatasheet-test.c;h=56c8d26e44dbb74c02eb6838ffc0598b12b0717b;hb=67b337574982476bfe821f78312a4588f55401b3;hp=5eeb355346cf98fb82ee227d5925cf3a2f420a71;hpb=6171d2d41a551af903fd444e10f77bb77b563359;p=pspp-builds.git diff --git a/tests/data/datasheet-test.c b/tests/data/datasheet-test.c index 5eeb3553..56c8d26e 100644 --- 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++) { + int width = caseproto_get_width (proto, col); union value v; - value_init (&v, 0); + value_init (&v, width); 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)); }