Граф коммитов

17 Коммитов

Автор SHA1 Сообщение Дата
Simon Tatham a4cbd3dfdb Support ESC[38;2;R;G;Bm for 24-bit true colour.
This is a heavily rewritten version of a patch originally by Lorenz
Diener; it was tidied up somewhat by Christian Brabandt, and then
tidied up more by me. The basic idea is to add to the termchar
structure a pair of small structs encoding 24-bit RGB values, each
with a flag indicating whether it's turned on; if it is, it overrides
any other specification of fg or bg colour for that character cell.

I've added a test line to colours.txt containing a few example colours
from /usr/share/X11/rgb.txt. In fact it makes quite a good demo to run
the whole of rgb.txt through this treatment, with a command such as

  perl -pe 's!^\s*(\d+)\s+(\d+)\s+(\d+).*$!\e[38;2;$1;$2;$3m$&\e[m!' rgb.txt
2017-09-30 18:19:44 +01:00
Simon Tatham 581dd7071e Squash the 256-colour test text into fewer lines.
I'm about to want to add more stuff to that file, and it would be nice
to have it still fit on a screen after I do.
2017-09-30 17:31:33 +01:00
Simon Tatham a22e43d3d8 Add a file of extra bignum tests.
I generated these as a by-product of using afl-fuzz on the testbn
executable. I'd hoped it would find interesting bugs in the bignum
code itself, but in fact it mostly found bugs in the parsing code in
the test main(). However, even so, it did produce a list of tests
which reach as much of the code as afl-fuzz was able to, and that
seems like a useful thing to save.

Also, of course, just having a place to put explicitly specified
bignum tests is a good thing anyway, because then we can put
regression tests on the end of it every time we fix bugs.
2016-03-30 08:45:21 +01:00
Jacob Nevins cd0495bc18 Note in vt100.txt when it can be expected to work. 2016-03-24 23:46:10 +00:00
Simon Tatham 984792e9f4 Add direct tests of division/modulus to testbn.
I'm about to rewrite the division code, so it'll be useful to have a
way to test it directly, particularly one which exercises difficult
cases such as extreme values of the leading word and remainders just
above and below zero.
2015-12-13 14:46:43 +00:00
Ben Harris 323c3c70c9 Gratuitous colour ramps in the colour test file. 2015-10-28 21:38:36 +00:00
Simon Tatham 67629cc0ba New test output file, checking all display-relevant stuff.
This is the test file I wish I'd had while I was rewriting the
text-drawing function this week :-) Better late than never.
2015-08-16 18:26:23 +01:00
Simon Tatham e01104f899 Fix an array-size bug in modmul, and add some tests for it.
[originally from svn r9977]
2013-08-02 06:27:54 +00:00
Simon Tatham 9d4005e5c1 Make bignum.py self-contained, by importing versions of the two
functions I was depending on from my personal Python maths utility
module.

[originally from svn r9104]
2011-02-22 00:06:12 +00:00
Simon Tatham 7a0bd8247c A few more modpow tests, exercising the fallback option. This is
mostly so I can valgrind both and make sure they free all their
workspace - a memory leak in this code would be not merely an
inconvenience but a security hazard.

[originally from svn r9101]
2011-02-20 15:42:44 +00:00
Simon Tatham 15d7f8bb3e Add tests of modpow.
[originally from svn r9100]
2011-02-20 15:27:48 +00:00
Simon Tatham 01d365b626 Beginnings of a test suite for the bignum code. The output of
testdata/bignum.py is twice the size of the rest of the PuTTY source
put together, so I'm not checking it in.

This reveals bugs in the new multiplication code, which I have yet to
fix.

[originally from svn r9097]
2011-02-20 14:59:00 +00:00
Jacob Nevins faf59c78be Add an option to use wcwidth_cjk() instead of wcwidth(), as several people
have asked for it.

[originally from svn r5542]
2005-03-22 23:20:23 +00:00
Simon Tatham e202f0f228 The end condition in the binary search loop in the new getType() was
incorrect. I must have written that binary search idiom a hundred
times, so it's rather embarrassing that I can't _automatically_ get
it right! This was causing all kinds of characters to be classified
as ON when they should have been various other classes.

Also while I'm here, I've added another test case to utf8.txt (a
small piece of Arabic within a predominantly L->R line), and also
supplied a means to compile minibidi.c with -DTEST_GETTYPE to
produce a command-line character class lookup tool. (Not sure what
use that'll be _other_ than debugging this precise problem, but I
don't like to throw it away now I've written it :-)

[originally from svn r5016]
2004-12-20 09:27:44 +00:00
Simon Tatham f4246872c4 Divide the do_paint() loop into several subloops. The activity of
going through the line and working out which bits need to be redrawn
is now in a separate loop from the subsequent activity of actually
going through and doing the redraws. This _should_ enable me to
tinker with the which-bits-to-redraw data in between the two, thus
fixing `font-overflow'. However, I thought it would be sensible to
break the work up into two commits so we can track bugs in the
restructuring separately from bugs introduced by the new feature.

Also added a couple more terminal test files.

[originally from svn r5001]
2004-12-17 11:37:16 +00:00
Simon Tatham fb6a1e9d42 I had apparently broken wrapping of double-width characters (again).
Also fixed the new UTF-8 test file so that it tests double-width
wrapping both with _and_ without LATTR_WRAPPED2.

[originally from svn r5000]
2004-12-17 11:24:25 +00:00
Simon Tatham 4a8c36d4b7 I'd rather not keep losing these little test files, so here's some
stuff that I can `cat' into a terminal to test particular features
of it.

[originally from svn r4999]
2004-12-17 11:18:13 +00:00