This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository terminology.

View the commit online.

commit 9178e5e6d9adbb98def1edb9cd80c1c513a2fc19
Author: Boris Faure <[email protected]>
AuthorDate: Sat Aug 22 14:35:09 2026 +0200

    tytest: fold the scrollback into the checksum
    
    and rebuild tests.results
---
 src/bin/tytest.c    | 34 ++++++++++++++++++++++++++++++++++
 tests/tests.results | 30 +++++++++++++++---------------
 2 files changed, 49 insertions(+), 15 deletions(-)

diff --git a/src/bin/tytest.c b/src/bin/tytest.c
index d8b9c2b2..95c0a340 100644
--- a/src/bin/tytest.c
+++ b/src/bin/tytest.c
@@ -13,6 +13,7 @@
 #include "config.h"
 #include "termpty.h"
 #include "termptyops.h"
+#include "backlog.h"
 #include "termiointernals.h"
 #include "tytest.h"
 #include "unit_tests.h"
@@ -144,6 +145,37 @@ _termpty_to_termpty_tests(Termpty *ty, Termpty_Tests *tt)
    tt->bracketed_paste = ty->bracketed_paste;
 }
 
+/* Fold the scrollback into the checksum.
+ *
+ * Only backsize/backpos/beacon used to be covered, so everything that had
+ * scrolled off the screen was invisible to the tests -- which is precisely
+ * where a bug in the scroll or text-append path shows up first. Rows are read
+ * back through termpty_cellrow_get() rather than reached into directly, so the
+ * test keeps comparing what a reader of the backlog would see even if how a
+ * row is stored changes. */
+static void
+_checksum_backlog(Termpty *ty, MD5_CTX *ctx)
+{
+   ssize_t len = termpty_backlog_length(ty);
+   int y;
+
+   for (y = 1; y <= (int)len; y++)
+     {
+        const Termcell *cells;
+        ssize_t w = 0;
+        uint32_t width;
+
+        cells = termpty_cellrow_get(ty, -y, &w);
+        if (!cells || (w < 0)) w = 0;
+        /* Fixed width, not sizeof(ssize_t): the checksum is compared across
+         * machines and must not depend on the size of a pointer. */
+        width = (uint32_t)w;
+        MD5Update(ctx, (unsigned char const*)&width, sizeof(width));
+        if (cells && (w > 0))
+          MD5Update(ctx, (unsigned char const*)cells, sizeof(Termcell) * w);
+     }
+}
+
 static void
 _tytest_checksum(Termpty *ty)
 {
@@ -168,6 +200,8 @@ _tytest_checksum(Termpty *ty)
    MD5Update(&ctx,
              (unsigned char const*)ty->screen2,
              sizeof(Termcell) * ty->w * ty->h);
+   /* The scrollback */
+   _checksum_backlog(ty, &ctx);
    /* Icon/Title */
    if (ty->prop.icon)
      {
diff --git a/tests/tests.results b/tests/tests.results
index 727f63a2..a4950901 100644
--- a/tests/tests.results
+++ b/tests/tests.results
@@ -8,7 +8,7 @@ decfra-decera-default-values-restrict-cursor.sh c560b8109c4e1e5b73aa18565abc1745
 decfra-decera-default-values-no-restrict-cursor.sh 7d7846049f209a0627e4d82e983e9b84
 cursor-movements.sh 880a64ce470853df78fea1f06d3cb8d4
 cursor-movements-alias.sh 880a64ce470853df78fea1f06d3cb8d4
-fonts.sh 6a28e19506e89e13b1746a94821e0c75
+fonts.sh 184ddefedae324506fede39b52392cf3
 cursor-shape-0.sh c4158ed98a8e4104cb14063bbb14c248
 cursor-shape-1.sh c4158ed98a8e4104cb14063bbb14c248
 cursor-shape-2.sh c4158ed98a8e4104cb14063bbb14c248
@@ -29,7 +29,7 @@ dsr-deccksr.sh 63c573a679a63496d48ed24ff0707415
 dsr-os.sh ec12b9bef28bd875d6140a4c1d5f7a02
 dsr-pp.sh cce6b8bedc183f635d9a5d176bb32b79
 dsr-udk.sh ff22d657614bb6137bdb5f0788b4c7c7
-colors.sh e32761a6b7f6099f0d68192365d6bde7
+colors.sh 03282bddefd22c8a9fac7dfc1d37a4ce
 colors_regression.sh 988cea4d5f08c0896a94ac54b8060aa1
 sgr-leading-trailing-semicolon.sh 04aad2aa7bad05daf66ac2266f6bfc20
 sgr-truecolors.sh d4b734a8e0bce1cc329e6b72ca012f20
@@ -57,15 +57,15 @@ decrara-no-rectangular-restrict-cursor.sh 161735f93a179f96512bf9fae780262f
 decic-decdc.sh 1e88ff7e19c9558f3f15a59dda5014dc
 ich.sh d96a88b7beffe078a597255ce16bbbe4
 deccra.sh da33245af1439f8c1c95805a95e19251
-ed-0.sh d8ae92dfe721d2fe1da925a18ddbe977
-ed-1.sh c5ce8829b95846c97eefb807aef08357
-ed-2.sh 94eb9cde56d9a07098ab2b06aea6790a
+ed-0.sh 4485e8a1bf1a91bb1c694aefc38cb41e
+ed-1.sh 52956f2a78f6b71c1f05a2f01978a1db
+ed-2.sh 6f56e3cd4306168d79fef3d8096f3545
 ed-3.sh 85d65d2019328c901bca80f6aa33f0da
-ed-4.sh 2bd30bedaf289f7cce7d18069e0072de
+ed-4.sh c4aa110d74e408369943e81475829a57
 el.sh 61fc84bf523380c997699b6f2dff7531
 il.sh a56b8fc5367f6f2315fb1682fc1a3518
 dl.sh 0b3355e7dc86eaf8ddfb72e577452026
-su.sh 4a12c024392a77d706024afec991dae9
+su.sh c39c0db4961a6b641f9459eaf8aa89e9
 sd.sh 68181f983b5063cef1fef55b82ab3ca0
 decst8c.sh 30db60c51a94776cd4cc09875902c641
 ctc.sh 79d7fafcf9aacd8a142f7d902e6cb0e4
@@ -74,7 +74,7 @@ ech.sh bd3e4bb93bb4911779e69cfa87ed35ae
 text_append_after_right_margin.sh 5afedcb8b0d8abb8ef5c619decfd5c33
 cbt.sh 687e95911f04262b08fc48f78b15ed07
 hpa.sh b4740ae6a395eb1fef152a4b77679f52
-rep.sh 3c7a143f9e026299d8d6cf204427686d
+rep.sh ae6e15852020def0169792f6d793f6d7
 da.sh ff77a3285a98c78dd225d3f3ea7f8c4a
 uts.sh f0f33a807af659ee05bde6d836bb4e46
 vpa.sh 018997127c51f4826ed08c41297b987d
@@ -90,9 +90,9 @@ selection_box_drag.sh 9855fe72c325b9ed95de8a95f27e8b35
 selection_double_click.sh b028759ce05954c71e3aace6910f384d
 selection_word_regression.sh 86dc33e937bd5d6dabca2ed7de44f5cf
 selection_triple_click.sh 1a628cbd6b88fe18328438028ca6e887
-selection_scrolls.sh 121e89e4234b3d56f095881b4a13505f
+selection_scrolls.sh 47bb71c59189e2b504f14a3daa0e0db5
 selection_with_margins_scrolled.sh bde9eaae126e8bddbc340399edc8f565
-selection_in_history.sh f7c90908b3948fc8838498c1fba68bb8
+selection_in_history.sh 3438ed2bf58eb81e4995ad7df48b0768
 selection_over_multiple_lines.sh 5f23b0087b117f0c13c390251a644aff
 selection_invisible.sh b95410413cb1d967bd56c62ba51ed927
 selection_to_position.sh e39538611df6cff3d3017b860f8c8227
@@ -131,11 +131,11 @@ title_icon_stack_default.sh 62a34a00406243ecf57a79d69b92ef50
 zero-width-spaces.sh 4713ffc7a5f6e7573910183f1609275f
 link_detection_email_surrounded.sh 119ce6c19b50fd02d9e5d7290baa7bac
 link_detection_email_surrounded_more.sh 7abc7889df346369a53c9092268af131
-selection_scrolls_up.sh 9565ec642ad982e008c3856de955e356
-selection_box_in_history.sh ed2fba61de4316ac3dd08bd3c3d1c831
-selection_box_scrolls_up.sh 9565ec642ad982e008c3856de955e356
-selection_scrolls_down.sh 9565ec642ad982e008c3856de955e356
-selection_box_scrolls_down.sh 9565ec642ad982e008c3856de955e356
+selection_scrolls_up.sh 50974157db192d2a87f9140569973028
+selection_box_in_history.sh ce2327baf14ea3e20838ad542ef53c6e
+selection_box_scrolls_up.sh 50974157db192d2a87f9140569973028
+selection_scrolls_down.sh 50974157db192d2a87f9140569973028
+selection_box_scrolls_down.sh 50974157db192d2a87f9140569973028
 true_color_cache_thrashing.sh 277c13fbac95cea95a07227a7b466f67
 true_color_cache_reuse.sh 144a8199f4744ed031270d5ea69e00d2
 selection_word_low_ascii_separators.sh 053af5439fb5432b6eb859b51c226747

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to