Add a second torture test to test hash-table resizing.
All checks were successful
Remind unit tests / tests (push) Successful in 31s

This commit is contained in:
Dianne Skoll
2024-12-10 15:12:24 -05:00
parent 28e0599380
commit 6c0e7b4ff5
4 changed files with 600024 additions and 1 deletions

View File

@@ -77,6 +77,13 @@ FreeXlateItem(XlateItem *item)
static void
RemoveTranslation(XlateItem *item)
{
hash_table_delete(&TranslationTable, item);
FreeXlateItem(item);
}
static void
RemoveTranslationNoResize(XlateItem *item)
{
hash_table_delete_no_resize(&TranslationTable, item);
FreeXlateItem(item);
@@ -96,7 +103,7 @@ ClearTranslationTable(void)
item = hash_table_next(&TranslationTable, NULL);
while(item) {
next = hash_table_next(&TranslationTable, item);
RemoveTranslation(item);
RemoveTranslationNoResize(item);
item = next;
}
hash_table_free(&TranslationTable);

View File

@@ -619,6 +619,9 @@ fi
# Test --print-tokens long option
../src/remind --print-tokens < /dev/null >> ../tests/test.out 2>&1
# Torture test #2
../src/remind ../tests/torture2.rem >> ../tests/test.out 2>&1
# Make sure all the include files are ok
find ../include -type f -name '*.rem' | while read x; do ../src/remind -n $x 1 Jan 2024 2>>../tests/test.out 1>/dev/null; done
cmp -s ../tests/test.out ../tests/test.cmp

View File

@@ -24064,3 +24064,12 @@ $Uw
$Uy
$Was
$Wednesday
No reminders.
Var hash: total = 1; maxlen = 1; avglen = 0.059
Func hash: total = 1; maxlen = 1; avglen = 0.059
Dedup hash: total = 0; maxlen = 0; avglen = 0.000
Trans hash: total = 1; maxlen = 1; avglen = 0.059
Expression nodes allocated: 300032
Expression nodes high-water: 300000
Expression nodes leaked: 0
Parse level high-water: 7

600004
tests/torture2.rem Normal file

File diff suppressed because it is too large Load Diff