summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbiouman <>2001-03-05 14:50:18 +0000
committerbiouman <>2001-03-05 14:50:18 +0000
commitcd61178eb1d3b9182f4fcb64cc8eee61971405a8 (patch)
treee0c0cd481749e2b8327cfb89c0fdb24a53fe935b
parentdeb75e32768c82d2945427d558f73c64c4c2f72d (diff)
Bug en moins
-rw-r--r--lib/BHeap.cc1
-rw-r--r--po/PriorityLists.pot32
-rw-r--r--po/cat-id-tbl.c100
-rw-r--r--src/test.cc4
4 files changed, 79 insertions, 58 deletions
diff --git a/lib/BHeap.cc b/lib/BHeap.cc
index 89d6f0f..1dfe6de 100644
--- a/lib/BHeap.cc
+++ b/lib/BHeap.cc
@@ -289,6 +289,7 @@ Key_t BHeap::Extract_Min(Datas_t & Datas)
// 3. inverser l'ordre de la liste chaînée des fils de x,
// et faire pointer tête[T'] sur la tête de la liste résultante.
for (P = y->Child; P;) {
+ P->Father = NULL;
P2 = Before->Brother;
P3 = P->Brother;
Before->Brother = P;
diff --git a/po/PriorityLists.pot b/po/PriorityLists.pot
index 32402f6..14a3e97 100644
--- a/po/PriorityLists.pot
+++ b/po/PriorityLists.pot
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2001-03-05 14:56+0100\n"
+"POT-Creation-Date: 2001-03-05 15:46+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -44,7 +44,7 @@ msgstr ""
msgid " keys (real count). Expecting "
msgstr ""
-#: src/test.cc:51 src/test.cc:119
+#: src/test.cc:51 src/test.cc:126
msgid "Incorrect order."
msgstr ""
@@ -84,41 +84,53 @@ msgstr ""
msgid "Creating a priority list and adding keys:\n"
msgstr ""
-#: src/test.cc:99 src/test.cc:106 src/test.cc:110
+#: src/test.cc:102 src/test.cc:109 src/test.cc:113 src/test.cc:117
msgid ""
"Ok.\n"
"List browsing...\n"
msgstr ""
-#: src/test.cc:101
+#: src/test.cc:104
msgid ""
"Ok.\n"
"Extract_Min + List browsing...\n"
msgstr ""
-#: src/test.cc:104
+#: src/test.cc:107
msgid ""
"Ok.\n"
-"Lower_Key(-12) over 59...\n"
+"Lower_Key(0) over 59...\n"
msgstr ""
-#: src/test.cc:108
+#: src/test.cc:111
msgid ""
"Ok.\n"
"Delete over 54...\n"
msgstr ""
-#: src/test.cc:114
+#: src/test.cc:115
+msgid ""
+"Ok.\n"
+"Lower_Key(-12) over 30...\n"
+msgstr ""
+
+#: src/test.cc:119
+msgid ""
+"Ok.\n"
+"Extract_Min...\n"
+msgstr ""
+
+#: src/test.cc:121
msgid ""
"Ok.\n"
"Extracting datas...\n"
msgstr ""
-#: src/test.cc:116
+#: src/test.cc:123
msgid "Minimum #"
msgstr ""
-#: src/test.cc:122
+#: src/test.cc:129
msgid ""
"Ok.\n"
"\n"
diff --git a/po/cat-id-tbl.c b/po/cat-id-tbl.c
index 98417ba..7c2abcb 100644
--- a/po/cat-id-tbl.c
+++ b/po/cat-id-tbl.c
@@ -35,64 +35,70 @@ Ok.\n\
Extract_Min + List browsing...\n", 20},
{"\
Ok.\n\
-Lower_Key(-12) over 59...\n", 21},
+Lower_Key(0) over 59...\n", 21},
{"\
Ok.\n\
Delete over 54...\n", 22},
{"\
Ok.\n\
-Extracting datas...\n", 23},
- {"Minimum #", 24},
+Lower_Key(-12) over 30...\n", 23},
+ {"\
+Ok.\n\
+Extract_Min...\n", 24},
+ {"\
+Ok.\n\
+Extracting datas...\n", 25},
+ {"Minimum #", 26},
{"\
Ok.\n\
\n\
-All the tests were successfull\n", 25},
- {"Unknow priority list type: ", 26},
- {"Error opening file (", 27},
- {"Bad dictionnary structure. See doc/README.en (missing : separator)", 28},
- {"Bad dictionnary structure. See doc/README.en (missing word)", 29},
- {"Bad dictionnary structure. See doc/README.en (missing frequency)", 30},
- {"Huffman [{-f|-i} file] {type}", 31},
- {"Huffman -h", 32},
- {"By Nicolas Noble (nicolas@nobis-crew.org).", 33},
- {"This will encode the input file with the Huffman code", 34},
- {"using the priority list defined by type.", 35},
- {"Type is a number taken from this list:", 36},
- {" 0 : Binary Heap (default)", 37},
- {" 1 : Binomial Heap", 38},
- {" 2 : Fibbonacci Heap (bugged)", 39},
- {" 3 : Sorted chained list", 40},
- {"-f file means that you specify a dictionnary file which is", 41},
- {" structured as described into the README file.", 42},
- {"-i file means that you specify a file to encode. It will", 43},
- {" built a quiet dumb dictionnary.", 44},
- {"By default, a dictionnary will be built from stdin.", 45},
- {"-h prints this help and exit.", 46},
- {"Unknow option: ", 47},
- {"-i and -f options are exclusive", 48},
- {"Extra command: ", 49},
- {"Internal error.", 50},
- {" * Head cell. (", 51},
- {"Insert: not over Head.", 52},
- {"Insert: No more memory.", 53},
- {"Extract_Min: Priority List is empty.", 54},
+All the tests were successfull\n", 27},
+ {"Unknow priority list type: ", 28},
+ {"Error opening file (", 29},
+ {"Bad dictionnary structure. See doc/README.en (missing : separator)", 30},
+ {"Bad dictionnary structure. See doc/README.en (missing word)", 31},
+ {"Bad dictionnary structure. See doc/README.en (missing frequency)", 32},
+ {"Huffman [{-f|-i} file] {type}", 33},
+ {"Huffman -h", 34},
+ {"By Nicolas Noble (nicolas@nobis-crew.org).", 35},
+ {"This will encode the input file with the Huffman code", 36},
+ {"using the priority list defined by type.", 37},
+ {"Type is a number taken from this list:", 38},
+ {" 0 : Binary Heap (default)", 39},
+ {" 1 : Binomial Heap", 40},
+ {" 2 : Fibbonacci Heap (bugged)", 41},
+ {" 3 : Sorted chained list", 42},
+ {"-f file means that you specify a dictionnary file which is", 43},
+ {" structured as described into the README file.", 44},
+ {"-i file means that you specify a file to encode. It will", 45},
+ {" built a quiet dumb dictionnary.", 46},
+ {"By default, a dictionnary will be built from stdin.", 47},
+ {"-h prints this help and exit.", 48},
+ {"Unknow option: ", 49},
+ {"-i and -f options are exclusive", 50},
+ {"Extra command: ", 51},
+ {"Internal error.", 52},
+ {" * Head cell. (", 53},
+ {"Insert: not over Head.", 54},
+ {"Insert: No more memory.", 55},
+ {"Extract_Min: Priority List is empty.", 56},
{"\
* Head cell.\n\
- |\n", 55},
- {"Not enough memory", 56},
- {"negative overflow", 57},
+ |\n", 57},
+ {"Not enough memory", 58},
+ {"negative overflow", 59},
{"\
* Head cell\n\
- |\n", 58},
- {"Bitstream length : ", 59},
- {" bits (= ", 60},
- {" bytes)\n", 61},
- {"Real size input : ", 62},
- {"Size squeezed by : ", 63},
- {" percents\n", 64},
- {"Dictionnary size : ", 65},
- {"Total bitstream length : ", 66},
- {"Real gain (4 bytes header) : ", 67},
+ |\n", 60},
+ {"Bitstream length : ", 61},
+ {" bits (= ", 62},
+ {" bytes)\n", 63},
+ {"Real size input : ", 64},
+ {"Size squeezed by : ", 65},
+ {" percents\n", 66},
+ {"Dictionnary size : ", 67},
+ {"Total bitstream length : ", 68},
+ {"Real gain (4 bytes header) : ", 69},
};
-int _msg_tbl_length = 67;
+int _msg_tbl_length = 69;
diff --git a/src/test.cc b/src/test.cc
index 48d7762..fec7131 100644
--- a/src/test.cc
+++ b/src/test.cc
@@ -59,7 +59,7 @@ void FullTest(void)
{
PriorityList *T;
Datas_t Datas;
- Cell C1, C2, C3;
+ Cell C1, C2, C3 = NULL;
Key_t K;
int i;
@@ -91,6 +91,8 @@ void FullTest(void)
C1 = T->Insert(N[i], NULL);
if (N[i] == 30) C3 = C1;
}
+
+ if (!C3) exit(-1);
fprintf(stderr, "59 54 -10\n");
C1 = T->Insert(59, NULL);