From 68332dfa57850ceabed4c270638096edf2bc32e7 Mon Sep 17 00:00:00 2001 From: Pixel <> Date: Tue, 13 Mar 2001 08:02:55 +0000 Subject: Chtit bug --- src/test.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/test.cc') 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. -- cgit v1.2.3