From: John Darrington Date: Fri, 17 Jul 2009 15:11:44 +0000 (+0800) Subject: Ensure correct behaviour when the state var is missing. X-Git-Tag: build37~50^2~9 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa937be5e1ac11fadf7a3c6705416f9b4ad35c1f;p=pspp-builds.git Ensure correct behaviour when the state var is missing. When the state variable is missing, then the entire case is skipped. --- diff --git a/src/language/stats/roc.c b/src/language/stats/roc.c index 0709992c..1e8ac4e0 100644 --- a/src/language/stats/roc.c +++ b/src/language/stats/roc.c @@ -49,7 +49,7 @@ struct cmd_roc const struct variable **vars; const struct dictionary *dict; - struct variable *state_var ; + const struct variable *state_var ; union value state_value; /* Plot the roc curve */ @@ -640,14 +640,21 @@ do_roc (struct cmd_roc *roc, struct casereader *reader, struct dictionary *dict) struct subcase up_ordering; struct subcase down_ordering; + struct casewriter *neg_wtr = NULL; + struct casereader *input = casereader_create_filter_missing (reader, roc->vars, roc->n_vars, roc->exclude, NULL, NULL); + input = casereader_create_filter_missing (input, + &roc->state_var, 1, + roc->exclude, + NULL, + NULL); - struct casewriter *neg_wtr = autopaging_writer_create (casereader_get_proto (input)); + neg_wtr = autopaging_writer_create (casereader_get_proto (input)); prepare_cutpoints (roc, rs, input); diff --git a/tests/command/roc.sh b/tests/command/roc.sh index 57dad752..0c24f0c5 100755 --- a/tests/command/roc.sh +++ b/tests/command/roc.sh @@ -73,6 +73,7 @@ begin data. 4 2 14 1 4 3 2 0 5 4 20 1 +5 4 20 . 5 5 1 0 end data.