From 00175c601a93d7adba981851860fdf9d72ec9119 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 24 Nov 2012 15:51:33 -0800 Subject: [PATCH] data-parser: Use data-file error types for data-file errors. The SW error type that these calls to msg() used before this command include the name of the executing command in the error message. This can be confusing because the executing command may not have any connection to the command that said to read the data file. This commit changes these error types to DW, which is intended for errors in a data file (and omits the command name). Bug #26517. --- src/language/data-io/data-parser.c | 14 +++++++------- tests/language/data-io/data-list.at | 2 +- tests/language/stats/crosstabs.at | 4 ++-- tests/language/stats/rank.at | 14 +++++++------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/language/data-io/data-parser.c b/src/language/data-io/data-parser.c index 3485f7af1b..958326e48d 100644 --- a/src/language/data-io/data-parser.c +++ b/src/language/data-io/data-parser.c @@ -455,7 +455,7 @@ cut_field (const struct data_parser *parser, struct dfm_reader *reader, /* Quoted field. */ int quote = ss_get_byte (&p); if (!ss_get_until (&p, quote, field)) - msg (SW, _("Quoted string extends beyond end of line.")); + msg (DW, _("Quoted string extends beyond end of line.")); if (parser->quote_escape && ss_first (p) == quote) { ds_assign_substring (tmp, *field); @@ -464,7 +464,7 @@ cut_field (const struct data_parser *parser, struct dfm_reader *reader, struct substring ss; ds_put_byte (tmp, quote); if (!ss_get_until (&p, quote, &ss)) - msg (SW, _("Quoted string extends beyond end of line.")); + msg (DW, _("Quoted string extends beyond end of line.")); ds_put_substring (tmp, ss); } *field = ds_ss (tmp); @@ -483,7 +483,7 @@ cut_field (const struct data_parser *parser, struct dfm_reader *reader, n_seps++; } if (!n_seps) - msg (SW, _("Missing delimiter following quoted string.")); + msg (DW, _("Missing delimiter following quoted string.")); } } else @@ -550,7 +550,7 @@ parse_fixed (const struct data_parser *parser, struct dfm_reader *reader, if (dfm_eof (reader)) { - msg (SW, _("Partial case of %d of %d records discarded."), + msg (DW, _("Partial case of %d of %d records discarded."), row - 1, parser->records_per_case); return false; } @@ -607,7 +607,7 @@ parse_delimited_span (const struct data_parser *parser, if (dfm_eof (reader)) { if (f > parser->fields) - msg (SW, _("Partial case discarded. The first variable " + msg (DW, _("Partial case discarded. The first variable " "missing was %s."), f->name); ds_destroy (&tmp); return false; @@ -649,7 +649,7 @@ parse_delimited_no_span (const struct data_parser *parser, if (!cut_field (parser, reader, &first_column, &last_column, &tmp, &s)) { if (f < end - 1 && settings_get_undefined ()) - msg (SW, _("Missing value(s) for all variables from %s onward. " + msg (DW, _("Missing value(s) for all variables from %s onward. " "These will be filled with the system-missing value " "or blanks, as appropriate."), f->name); @@ -669,7 +669,7 @@ parse_delimited_no_span (const struct data_parser *parser, s = dfm_get_record (reader); ss_ltrim (&s, parser->soft_seps); if (!ss_is_empty (s)) - msg (SW, _("Record ends in data not part of any field.")); + msg (DW, _("Record ends in data not part of any field.")); exit: dfm_forward_record (reader); diff --git a/tests/language/data-io/data-list.at b/tests/language/data-io/data-list.at index 05c1eb61a3..ade227274c 100644 --- a/tests/language/data-io/data-list.at +++ b/tests/language/data-io/data-list.at @@ -266,7 +266,7 @@ BEGIN DATA. END DATA. ]) AT_CHECK([pspp -O format=csv data-list.sps], [0], [dnl -data-list.sps:4: warning: LIST: Missing delimiter following quoted string. +data-list.sps:4: warning: Missing delimiter following quoted string. Table: Data List s diff --git a/tests/language/stats/crosstabs.at b/tests/language/stats/crosstabs.at index 67571dd93e..4492e9a250 100644 --- a/tests/language/stats/crosstabs.at +++ b/tests/language/stats/crosstabs.at @@ -59,9 +59,9 @@ Variable,Format x,F8.0 y,A18 -"crosstabs.sps:4: warning: BEGIN DATA: Missing value(s) for all variables from x onward. These will be filled with the system-missing value or blanks, as appropriate." +"crosstabs.sps:4: warning: Missing value(s) for all variables from x onward. These will be filled with the system-missing value or blanks, as appropriate." -"crosstabs.sps:6: warning: BEGIN DATA: Missing value(s) for all variables from x onward. These will be filled with the system-missing value or blanks, as appropriate." +"crosstabs.sps:6: warning: Missing value(s) for all variables from x onward. These will be filled with the system-missing value or blanks, as appropriate." Table: Summary. ,Cases,,,,, diff --git a/tests/language/stats/rank.at b/tests/language/stats/rank.at index 6cb366849b..04d5accce7 100644 --- a/tests/language/stats/rank.at +++ b/tests/language/stats/rank.at @@ -481,19 +481,19 @@ DELETE VAR ran001 TO ran999. LIST. ]) AT_CHECK([pspp -O format=csv rank.sps], [0], [dnl -"rank.sps:3: warning: BEGIN DATA: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." +"rank.sps:3: warning: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." -"rank.sps:4: warning: BEGIN DATA: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." +"rank.sps:4: warning: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." -"rank.sps:5: warning: BEGIN DATA: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." +"rank.sps:5: warning: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." -"rank.sps:6: warning: BEGIN DATA: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." +"rank.sps:6: warning: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." -"rank.sps:7: warning: BEGIN DATA: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." +"rank.sps:7: warning: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." -"rank.sps:8: warning: BEGIN DATA: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." +"rank.sps:8: warning: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." -"rank.sps:9: warning: BEGIN DATA: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." +"rank.sps:9: warning: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." Variables Created By RANK -- 2.30.2