summaryrefslogtreecommitdiff
path: root/src/test.cc
diff options
context:
space:
mode:
authorPixel <>2001-03-13 08:02:55 +0000
committerPixel <>2001-03-13 08:02:55 +0000
commit68332dfa57850ceabed4c270638096edf2bc32e7 (patch)
tree22aae350f751c334fe054677b4be2860d0019e79 /src/test.cc
parentba0db98fd886c561e21ac2b9da02a528270fe750 (diff)
Chtit bug
Diffstat (limited to 'src/test.cc')
-rw-r--r--src/test.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/test.cc b/src/test.cc
index 05f5414..a557b69 100644
--- a/src/test.cc
+++ b/src/test.cc
@@ -264,7 +264,7 @@ int main(int argc, char **argv)
char choice = 0, **slots;
PriorityList *T, * Temp;
Datas_t Datas;
- Cell Cells[10];
+ Cell Cells[10], M;
int i;
Key_t Key;
@@ -350,6 +350,9 @@ int main(int argc, char **argv)
T = newlist(method);
T->Union(Temp);
delete Temp;
+ for (i = 0; i < 10; i++) {
+ Cells[i] = NULL;
+ }
break;
case 'd': // Effacement d'une clef.
slots = buildslots(T, Cells, 0);
@@ -360,9 +363,17 @@ int main(int argc, char **argv)
}
choice -= '0';
cerr << _("Delete result: ") << T->Delete(Datas, Cells[choice]);
+ Cells[choice] = NULL;
freeslots(slots);
break;
case 'e': // Extract Min.
+ M = T->Min();
+ for (i = 0; i < 10; i++) {
+ if (Cells[i] == M) {
+ Cells[i] = NULL;
+ break;
+ }
+ }
cerr << _("Extract Min result: ") << T->Extract_Min(Datas);
break;
case 'l': // Lower Key.