diff options
Diffstat (limited to 'src/test.cc')
-rw-r--r-- | src/test.cc | 13 |
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. |