summaryrefslogtreecommitdiff
path: root/src/test.cc
diff options
context:
space:
mode:
authorPixel <>2001-03-05 14:24:03 +0000
committerPixel <>2001-03-05 14:24:03 +0000
commitec68b01357f608f7800da530fc14f41d32cb2b45 (patch)
tree54504700af2fea763c4bd8156884574ca1b98aa3 /src/test.cc
parent04d8a10293bdb5407127dc7693da33e168fa4d5c (diff)
Plein de modifs
Diffstat (limited to 'src/test.cc')
-rw-r--r--src/test.cc21
1 files changed, 13 insertions, 8 deletions
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)