commit ca114b13c896eb3d05de11e08ba4aff1fce3f84f11c931326475926a7cc8cd33 from: Stefan Sperling date: Sat Aug 22 14:19:02 2026 UTC add a memleak test for histedit, prompted by a report from bentley@ This test is currently failing. The subsequent 10 commits will fix all relevant memory leaks to make it pass. commit - b5def47a1d71214197414530581e6d254b9b730536376acfcacb6d19d4259111 commit + ca114b13c896eb3d05de11e08ba4aff1fce3f84f11c931326475926a7cc8cd33 blob - e10a992ed8acf374f7354b6d201b29ce7a1baec88c016dd533af63acf4d93f28 blob + 027ec9d9e84e3db4ee37288daadff8cc0bcd63b94f40e8bb74ce642e8875c792 --- regress/cmdline/memleak.sh +++ regress/cmdline/memleak.sh @@ -81,6 +81,42 @@ EOF test_memleak_done "$testroot" "$ret" } +test_memleak_histedit_basic() { + local testroot=`test_init memleak_histedit_basic` + + got checkout $testroot/repo $testroot/wt > /dev/null + ret=$? + if [ $ret -ne 0 ]; then + test_done "$testroot" "$ret" + return 1 + fi + + echo "foo" > $testroot/wt/foo + (cd $testroot/wt && got add foo > /dev/null) + (cd $testroot/wt && got commit -m 'add foo' foo > /dev/null) + local commit_id=`git_show_head $testroot/repo` + + echo -n > $testroot/histedit-script + for i in `seq 10`; do + echo "change $i" >> $testroot/wt/foo + (cd $testroot/wt && got commit -m 'change foo' foo > /dev/null) + echo "pick `git_show_head $testroot/repo`" \ + >> $testroot/histedit-script + done + + echo "last change" >> $testroot/wt/foo + (cd $testroot/wt && got commit -m 'last change to foo' foo > /dev/null) + echo "drop `git_show_head $testroot/repo`" >> $testroot/histedit-script + + (cd $testroot/wt && got up -c $commit_id > /dev/null) + (cd $testroot/wt && $(check_memleak $testroot) \ + got histedit -F $testroot/histedit-script > /dev/null) + + test_memleak_done "$testroot" "$ret" +} + + test_parseargs "$@" run_test test_memleak_add_basic run_test test_memleak_send_basic +run_test test_memleak_histedit_basic