X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fdata%2Fdatasheet-test.c;h=87ac1b9a1644e582e73d0f985cc25dbe58843ad1;hb=dc23d73ba6a44d3b962c3cafa3b797af14b9db4a;hp=db21ff33fe658e132fa8769f15a31ab2ca887fa0;hpb=14f4522a17db23e67a6fa17876633cc6260cb42b;p=pspp diff --git a/tests/data/datasheet-test.c b/tests/data/datasheet-test.c index db21ff33fe..87ac1b9a16 100644 --- a/tests/data/datasheet-test.c +++ b/tests/data/datasheet-test.c @@ -42,7 +42,6 @@ #include "error.h" #include "minmax.h" #include "progname.h" -#include "xalloc.h" /* lazy_casereader callback function to instantiate a casereader from the datasheet. */ @@ -163,7 +162,7 @@ check_datasheet_casereader (struct mc *mc, struct casereader *reader, "'%.*s' != '%.*s'", row, col, n_rows, n_columns, width, case_str_idx (c, col), - width, value_str (&array[row][col], width)); + width, array[row][col].s); } } @@ -225,8 +224,8 @@ check_datasheet (struct mc *mc, struct datasheet *ds, mc_error (mc, "element %zu,%zu (of %zu,%zu) differs: " "'%.*s' != '%.*s'", row, col, n_rows, n_columns, - width, value_str (&v, width), - width, value_str (av, width)); + width, v.s, + width, v.s); difference = true; } value_destroy (&v, width); @@ -249,7 +248,7 @@ check_datasheet (struct mc *mc, struct datasheet *ds, if (width == 0) ds_put_format (&s, " %g", v->f); else - ds_put_format (&s, " '%.*s'", width, value_str (v, width)); + ds_put_format (&s, " '%.*s'", width, v->s); } mc_error (mc, "%s", ds_cstr (&s)); } @@ -270,8 +269,7 @@ check_datasheet (struct mc *mc, struct datasheet *ds, if (width == 0) ds_put_format (&s, " %g", v.f); else - ds_put_format (&s, " '%.*s'", - width, value_str (&v, width)); + ds_put_format (&s, " '%.*s'", width, v.s); } mc_error (mc, "%s", ds_cstr (&s)); } @@ -407,12 +405,11 @@ value_from_param (union value *value, int width, unsigned int idx) else { unsigned int hash = hash_int (idx, 0); - uint8_t *string = value_str_rw (value, width); int offset; assert (width < 32); for (offset = 0; offset < width; offset++) - string[offset] = "ABCDEFGHIJ"[(hash >> offset) % 10]; + value->s[offset] = "ABCDEFGHIJ"[(hash >> offset) % 10]; } } @@ -895,7 +892,7 @@ main (int argc, char *argv[]) params.n_widths = 3; params.next_value = 1; - /* Parse comand line. */ + /* Parse command line. */ parser = argv_parser_create (); options = mc_options_create (); mc_options_register_argv_parser (options, parser);