.autotest, .cosmetics

This commit is contained in:
Mirek Fidler 2021-12-05 18:54:24 +01:00
parent 198e8114a6
commit d2207cd21f
4 changed files with 13 additions and 4 deletions

View file

@ -68,6 +68,17 @@ void CheckType(const T& x, bool checkhash = false)
RDUMP(ValueMap(vf));
ASSERT(ValueMap(vf) == ValueMap(x));
}
else
if(tt.Is<Drawing>()) {
PaintingPainter dw1(100, 100), dw2(100, 100);
dw1.DrawDrawing(0, 0, tt);
dw2.DrawDrawing(0, 0, vf);
Painting a = dw1.GetResult();
Painting b = dw2.GetResult();
// DDUMPHEX(StoreAsString(a));
// DDUMPHEX(StoreAsString(b));
ASSERT(a == b);
}
else {
RDUMP(vf.To<T>());
ASSERT(vf.To<T>() == x);

View file

@ -10,7 +10,6 @@ enum {
#define CHARSET_TOASCII 253
#define CHARSET_UTF32 254 // auxilary
#define CHARSET_UTF8 255
#define CHARSET_UNICODE 255
enum {
DEFAULTCHAR = 0x1f

View file

@ -58,8 +58,7 @@ value of parameter). Guaranteed to be equal to 0.&]
[s3; &]
[s4; &]
[s5;:CHARSET`_UTF8: [* CHARSET`_UTF8]&]
[s5;:CHARSET`_UNICODE: [* CHARSET`_UNICODE]&]
[s2;%% These are equal and mean UTF`-8 encoding.&]
[s2;%% UTF`-8 encoding.&]
[s3;%% &]
[s4; &]
[s5;:DEFAULTCHAR: [@(0.0.255) enum]_[* DEFAULTCHAR]_`=_[@3 0]x1f_&]

View file

@ -561,7 +561,7 @@ void Draw::DrawDrawingOp(const Rect& target, const Drawing& w) {
text = WString(txt, n);
}
else
if(cs == CHARSET_UNICODE) { // backward compatibility
if(cs == CHARSET_UTF8) { // backward compatibility "CHARSET_UNICODE"
Buffer<char16> txt(n);
ps.Stream::GetW(txt, n);
text = ToUtf32(txt, n);