diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-07-18 00:34:56 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-07-18 00:34:56 +0300 |
commit | 3a2583e918bcc805fe860252f8a520fc2f9b26ce (patch) | |
tree | cfe2b7846df4e8c2d1572c6b7b961225a8e87487 /tests | |
parent | 4794367ce0c31f820bf2bd72d44c886984e3f7ed (diff) | |
download | sciteco-3a2583e918bcc805fe860252f8a520fc2f9b26ce.tar.gz |
fixed minor memory leaks of per-state data in teco_machine_main_t
* These were leaked e.g. in case of end-of-macro errors,
but also in case of syntax highlighting (teco_lexer_style()).
I considered to solve this by overwriting more of the end_of_macro_cb,
but it didn't turn out to be trivial always.
* Considering that the union in teco_machine_main_t saved only 3 machine words
of memory, I decided to sacrifice those for more robust memory management.
* teco_machine_qregspec_t cannot be directly embedded into teco_machine_main_t
due to recursive dependencies with teco_machine_stringbuilding_t.
It could now and should perhaps be allocated only once in teco_machine_main_init(),
but it would require more refactoring.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testsuite.at | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/testsuite.at b/tests/testsuite.at index 8d4daa7..a5fa98e 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -228,6 +228,14 @@ TE_CHECK([[@^Ua{@EQ.x//} Ma @^U.x/FOO/]], 1, ignore, ignore) TE_CHECK([[@^Ua{@EQ.x// Mb Q*U*} Ma]], 0, ignore, ignore) AT_CLEANUP +# This is also for detecting leaks under Valgrind. +AT_SETUP([Unterminated commands]) +TE_CHECK([[G[foo^Q] ]], 1, ignore, ignore) +TE_CHECK([[!foo ]], 1, ignore, ignore) +TE_CHECK([[^Ua ]], 1, ignore, ignore) +TE_CHECK([[EGa ]], 1, ignore, ignore) +AT_CLEANUP + AT_SETUP([Loading files into Q-Registers]) TE_CHECK([[@I/../ @EW/loadqreg.txt/ @EQa/loadqreg.txt/ :Qa-2"N(0/0)']], 0, ignore, ignore) # Does the same as FG..$. Afterwards, the parent directory should be shorter. @@ -409,6 +417,8 @@ TE_CHECK([[@EU$"."]], 0, ignore, ignore) AT_CLEANUP AT_SETUP([Empty help topic]) +# FIXME: Produces a false positive under Valgrind +# due to the value of $SCITECOPATH. TE_CHECK([[@?//]], 1, ignore, ignore) AT_CLEANUP |