projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
format: Always output 2-digit hours for TIME format.
[pspp]
/
tests
/
libpspp
/
abt-test.c
diff --git
a/tests/libpspp/abt-test.c
b/tests/libpspp/abt-test.c
index 8bbe7d76e401af79d6a93a10560ce942552415fa..8088f19cd93dcc188c7be9cf345fde40b1620eee 100644
(file)
--- a/
tests/libpspp/abt-test.c
+++ b/
tests/libpspp/abt-test.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2007, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2010
, 2011
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
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
@@
-119,7
+119,7
@@
static int aux_data;
static struct element *
abt_node_to_element (const struct abt_node *node)
{
static struct element *
abt_node_to_element (const struct abt_node *node)
{
- return
abt_data
(node, struct element, node);
+ return
ABT_DATA
(node, struct element, node);
}
/* Compares the `x' values in A and B and returns a strcmp-type
}
/* Compares the `x' values in A and B and returns a strcmp-type
@@
-138,20
+138,17
@@
compare_elements (const struct abt_node *a_, const struct abt_node *b_,
/* Recalculates the count for NODE's subtree by adding up the
counts for its LEFT and RIGHT child subtrees. */
static void
/* Recalculates the count for NODE's subtree by adding up the
counts for its LEFT and RIGHT child subtrees. */
static void
-reaugment_elements (struct abt_node *node_,
- const struct abt_node *left,
- const struct abt_node *right,
- const void *aux)
+reaugment_elements (struct abt_node *node_, const void *aux)
{
struct element *node = abt_node_to_element (node_);
check (aux == &aux_data);
node->count = 1;
{
struct element *node = abt_node_to_element (node_);
check (aux == &aux_data);
node->count = 1;
- if (
left
!= NULL)
- node->count += abt_node_to_element (
left
)->count;
- if (
right
!= NULL)
- node->count += abt_node_to_element (
right
)->count;
+ if (
node->node.down[0]
!= NULL)
+ node->count += abt_node_to_element (
node->node.down[0]
)->count;
+ if (
node->node.down[1]
!= NULL)
+ node->count += abt_node_to_element (
node->node.down[1]
)->count;
}
/* Compares A and B and returns a strcmp-type return value. */
}
/* Compares A and B and returns a strcmp-type return value. */
@@
-374,6
+371,7
@@
check_abt (struct abt *abt, const int data[], size_t cnt)
check (abt_node_to_element (p)->data == order[cnt - i - 1]);
check (p == NULL);
}
check (abt_node_to_element (p)->data == order[cnt - i - 1]);
check (p == NULL);
}
+ check (abt_is_empty (abt) == (cnt == 0));
free (order);
}
free (order);
}