From: Ben Pfaff Date: Thu, 9 Apr 2009 04:39:22 +0000 (-0700) Subject: NPAR TESTS: Consistently order variables in summary statistics. X-Git-Tag: v0.7.3~166 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp-builds.git;a=commitdiff_plain;h=62c871225e944dbdb2a50e1253423952719145cf NPAR TESTS: Consistently order variables in summary statistics. The set of variables in the NPAR TESTS specs structure was ordered randomly, according to however the hash function happened to arrange them. Sort them by variable name, instead, so that they always appear in alphabetical order in, e.g., descriptive statistics output. The particular hash function PSPP uses now tends to order variables alphabetically anyhow. The next commit changes the PSPP hash functions, so fixing this in advance prevents having to update any test output. --- diff --git a/src/language/stats/npar.q b/src/language/stats/npar.q index 3234c4f7..bbccce67 100644 --- a/src/language/stats/npar.q +++ b/src/language/stats/npar.q @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. -*-c-*- - Copyright (C) 2006, 2008 Free Software Foundation, Inc. + Copyright (C) 2006, 2008, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -160,7 +160,7 @@ cmd_npar_tests (struct lexer *lexer, struct dataset *ds) test->insert_variables (test, var_hash); } - npar_specs.vv = (const struct variable **) const_hsh_data (var_hash); + npar_specs.vv = (const struct variable **) const_hsh_sort (var_hash); npar_specs.n_vars = const_hsh_count (var_hash); if ( cmd.sbc_statistics )