u-boot/test
Ion Agorria 80ef176ac1 test: hush: dollar: fix bugous behavior
The dollar test was merged with bugous console behavior, and
instead of fixing it, this behavior was just workarounded.
This was done to keep compatibility with the existing behavior.

It seems like without the fix the ut_assert_skipline(); didn't clear
console and running ut_assert_skipline(); many times would give always
OK. With e58bafc35f ("lib: membuff: fix readline not returning line in case of overflow")
the line is cleared correctly and next assert fails because now there
is nothing to clean which is correct if we look the this a bit above
the failing assert:

    if (gd->flags & GD_FLG_HUSH_MODERN_PARSER) {
         /*
          * For some strange reasons, the console is not empty after
          * running above command.
          * So, we reset it to not have side effects for other tests.
          */
         console_record_reset_enable();
    } else if (gd->flags & GD_FLG_HUSH_OLD_PARSER) {
         ut_assert_console_end();
    }

Which further confirms that tests workaround the old problem and now
that problem is fixed we can remove the whole if blocks and simply
place ut_assert_console_end() right after ut_assert_skipline() without
any conditional and will pass green.

So this part of code goes from:
    ut_assert_skipline();
    ut_assert_skipline();

    if (gd->flags & GD_FLG_HUSH_MODERN_PARSER) {
        /* See above comments. */
        console_record_reset_enable();
    } else if (gd->flags & GD_FLG_HUSH_OLD_PARSER) {
        ut_assert_console_end();
    }

to become:
    ut_assert_skipline();
    if (gd->flags & GD_FLG_HUSH_OLD_PARSER) {
        ut_assert_skipline();
    }
    ut_assert_console_end();

The if block mentioned above that calls console_record_reset_enable() is
completely removed as fixed by e58bafc35f.

[flaniel: adapt second if]

Signed-off-by: Ion Agorria <ion@agorria.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20240105072212.6615-8-clamor95@gmail.com
[mkorpershoek: reworded commit title]
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
[flaniel: remove console_record_reset_enable() if]
Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com>
2024-09-13 13:43:56 -06:00
..
boot test: boot: Use UTF_CONSOLE in tests 2024-08-26 18:51:49 -06:00
cmd test: cmd: Drop unnecessary console_record_reset_enable() 2024-08-26 18:51:49 -06:00
common test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
dm test: dm: Use UTF_CONSOLE in tests 2024-08-26 18:51:49 -06:00
env test: Rename UTF_CONSOLE_REC to UTF_CONSOLE 2024-08-26 18:51:49 -06:00
fs test: fs: fs-test: Move the tests to use sha256sum 2024-01-11 21:19:25 -05:00
fuzz Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"" 2024-05-19 08:16:36 -06:00
hush test: hush: dollar: fix bugous behavior 2024-09-13 13:43:56 -06:00
image test: Move some SPL-loading test-code into sandbox common 2024-08-09 16:03:19 -06:00
lib test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
log test: Rename UTF_CONSOLE_REC to UTF_CONSOLE 2024-08-26 18:51:49 -06:00
optee Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"" 2024-05-19 08:16:36 -06:00
overlay test: overlay: rename overlay source files to .dtso 2024-07-18 13:51:06 -06:00
py upl: Add an end-to-end test 2024-08-09 16:03:20 -06:00
stdint Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"" 2024-05-19 08:16:36 -06:00
trace
bloblist.c test: bloblist: Use UTF_CONSOLE in tests 2024-08-26 18:51:49 -06:00
bootm.c Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"" 2024-05-19 08:16:36 -06:00
cmd_ut.c upl: Add basic tests 2024-08-09 16:03:20 -06:00
command_ut.c Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"" 2024-05-19 08:16:36 -06:00
common.sh
compression.c test: Remove duplicate newlines 2024-07-15 12:12:18 -06:00
Kconfig test: CONFIG_UT_BOOTSTD must depend on CONFIG_BOOTSTD 2024-01-11 21:19:25 -05:00
Makefile test: build test/boot for CONFIG_UT_BOOTSTD=n 2024-01-11 21:19:25 -05:00
print_ut.c test: Rename UTF_CONSOLE_REC to UTF_CONSOLE 2024-08-26 18:51:49 -06:00
run
str_ut.c lib: Handle a special case with str_to_list() 2024-08-07 08:49:10 -06:00
test-main.c test: Rename UTF_CONSOLE_REC to UTF_CONSOLE 2024-08-26 18:51:49 -06:00
time_ut.c Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"" 2024-05-19 08:16:36 -06:00
unicode_ut.c Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"" 2024-05-19 08:16:36 -06:00
ut.c test: Fail when an empty line is expected but not present 2024-08-26 18:51:48 -06:00