From ec68b01357f608f7800da530fc14f41d32cb2b45 Mon Sep 17 00:00:00 2001 From: Pixel <> Date: Mon, 5 Mar 2001 14:24:03 +0000 Subject: Plein de modifs --- src/test.cc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/test.cc') diff --git a/src/test.cc b/src/test.cc index e9a15c1..48d7762 100644 --- a/src/test.cc +++ b/src/test.cc @@ -20,7 +20,7 @@ void exception(int e, char *msg) PriorityList *newlist(void) { - return new FHeap; + return new BHeap; } void DoCombTest(int number) @@ -59,7 +59,7 @@ void FullTest(void) { PriorityList *T; Datas_t Datas; - Cell C1, C2; + Cell C1, C2, C3; Key_t K; int i; @@ -76,7 +76,7 @@ void FullTest(void) DoCombTest(10); DoCombTest(70); DoCombTest(1000); - DoCombTest(10000); +// DoCombTest(10000); #ifdef BT DoCombTest(100000); #ifdef VBT @@ -88,7 +88,8 @@ void FullTest(void) T = newlist(); for (i = 0; i < 30; i++) { fprintf(stderr, "%i ", N[i]); - T->Insert(N[i], NULL); + C1 = T->Insert(N[i], NULL); + if (N[i] == 30) C3 = C1; } fprintf(stderr, "59 54 -10\n"); @@ -101,18 +102,22 @@ void FullTest(void) cerr << _("Ok.\nExtract_Min + List browsing...\n"); cerr << T->Extract_Min(Datas) << endl; T->Dump(cerr); - cerr << _("Ok.\nLower_Key(-12) over 59...\n"); - T->Lower_Key(C1, -12); + cerr << _("Ok.\nLower_Key(0) over 59...\n"); + T->Lower_Key(C1, 0); cerr << _("Ok.\nList browsing...\n"); T->Dump(cerr); cerr << _("Ok.\nDelete over 54...\n"); T->Delete(Datas, C2); cerr << _("Ok.\nList browsing...\n"); T->Dump(cerr); - cerr << "Ok.\nExtract_Min...\n"; + cerr << _("Ok.\nLower_Key(-12) over 30...\n"); + T->Lower_Key(C3, -12); + cerr << _("Ok.\nList browsing...\n"); + T->Dump(cerr); + cerr << _("Ok.\nExtract_Min...\n"); cerr << T->Extract_Min(Datas) << endl; cerr << _("Ok.\nExtracting datas...\n"); - for (i = 1; i <= 30; i++) { + for (i = 0; i <= 29; i++) { cerr << _("Minimum #") << i << " = " << (K = (T->Extract_Min(Datas))) << endl; if (K != i) -- cgit v1.2.3