summaryrefslogtreecommitdiff
path: root/src/test.cc
diff options
context:
space:
mode:
authorPixel <>2001-03-07 00:41:50 +0000
committerPixel <>2001-03-07 00:41:50 +0000
commit3aff7aaa9de61a5f3430bd86960c4f9c4b958786 (patch)
treee4f83c05031ccd816a2e8e8b3bf8d9a857484fbd /src/test.cc
parentcd61178eb1d3b9182f4fcb64cc8eee61971405a8 (diff)
Version finale pour les algos.
Diffstat (limited to 'src/test.cc')
-rw-r--r--src/test.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/test.cc b/src/test.cc
index fec7131..c5be9b8 100644
--- a/src/test.cc
+++ b/src/test.cc
@@ -20,7 +20,7 @@ void exception(int e, char *msg)
PriorityList *newlist(void)
{
- return new BHeap;
+ return new FHeap;
}
void DoCombTest(int number)
@@ -33,7 +33,9 @@ void DoCombTest(int number)
cerr << _("Creation of a priority list and adding ") << number << _(" random entrie(s)...");
T = newlist();
for (i = 1; i <= number; i++) {
- T->Insert(rand() % P_INFINITY, NULL);
+// T->Insert(rand() % P_INFINITY, NULL);
+// T->Insert(rand() % 100, NULL);
+ T->Insert(1, NULL);
}
cerr << _("Ok.\nDeleting the list...");
oK = P_INFINITY;
@@ -73,7 +75,7 @@ void FullTest(void)
cerr << _("Size of a BinHeap cell : ") << sizeof(binheap_t) << endl;
DoCombTest(0);
- DoCombTest(10);
+ DoCombTest(30);
DoCombTest(70);
DoCombTest(1000);
// DoCombTest(10000);
@@ -89,10 +91,12 @@ void FullTest(void)
for (i = 0; i < 30; i++) {
fprintf(stderr, "%i ", N[i]);
C1 = T->Insert(N[i], NULL);
- if (N[i] == 30) C3 = C1;
+ if (N[i] == 30)
+ C3 = C1;
}
-
- if (!C3) exit(-1);
+
+ if (!C3)
+ exit(-1);
fprintf(stderr, "59 54 -10\n");
C1 = T->Insert(59, NULL);