projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid redundant linking against libtool convenience libraries.
[pspp]
/
tests
/
libpspp
/
sparse-array-test.c
diff --git
a/tests/libpspp/sparse-array-test.c
b/tests/libpspp/sparse-array-test.c
index 9f63181b6daf3d2c39a0ac483b28bc809002dcd8..e146c3dbf537b7c765dfec60a16267756f8b4356 100644
(file)
--- a/
tests/libpspp/sparse-array-test.c
+++ b/
tests/libpspp/sparse-array-test.c
@@
-1,26
+1,25
@@
-/* PSPP -
computes sample statistic
s.
- Copyright (C) 2007 Free Software Foundation, Inc.
+/* PSPP -
a program for statistical analysi
s.
+ Copyright (C) 2007
, 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 the Free Software Foundation; either version 2 of the
-
License, or
(at your option) any later version.
+ 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
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
- This program is distributed in the hope that it will be useful,
but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU
- General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+
but
WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ G
NU G
eneral Public License for more details.
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* This is a test program for the sparse array routines defined
in sparse-array.c. This test program aims to be as
comprehensive as possible. "gcov -b" should report 100%
coverage of lines and branches in sparse-array.c when compiled
/* This is a test program for the sparse array routines defined
in sparse-array.c. This test program aims to be as
comprehensive as possible. "gcov -b" should report 100%
coverage of lines and branches in sparse-array.c when compiled
- with -DNDEBUG. "valgrind --leak-check=yes
+ with -DNDEBUG and BITS_PER_LEVEL is greater than the number of
+ bits in a long. "valgrind --leak-check=yes
--show-reachable=yes" should give a clean report. */
#ifdef HAVE_CONFIG_H
--show-reachable=yes" should give a clean report. */
#ifdef HAVE_CONFIG_H
@@
-166,8
+165,8
@@
check_sparse_array (struct sparse_array *spar,
check (!sparse_array_remove (spar, order[cnt - 1] + 1));
}
check (!sparse_array_remove (spar, order[cnt - 1] + 1));
}
- for (i = 0, p = sparse_array_
scan (spar, NULL
, &idx); i < cnt;
- i++, p = sparse_array_
scan (spar, &
idx, &idx))
+ for (i = 0, p = sparse_array_
first (spar
, &idx); i < cnt;
+ i++, p = sparse_array_
next (spar,
idx, &idx))
{
check (p != NULL);
check (idx == order[i]);
{
check (p != NULL);
check (idx == order[i]);
@@
-175,6
+174,15
@@
check_sparse_array (struct sparse_array *spar,
}
check (p == NULL);
}
check (p == NULL);
+ for (i = 0, p = sparse_array_last (spar, &idx); i < cnt;
+ i++, p = sparse_array_prev (spar, idx, &idx))
+ {
+ check (p != NULL);
+ check (idx == order[cnt - i - 1]);
+ check (*p == order[cnt - i - 1]);
+ }
+ check (p == NULL);
+
free (order);
}
free (order);
}