@@ -31,7 +31,7 @@ using namespace TAP;
3131int
3232main ()
3333{
34- TEST_START (5 );
34+ TEST_START (7 );
3535 { /* 1..1 */
3636 char data[] = " папа\0 мама\0 бабушка\0 дедушка\0 братик\0 сестричка" ;
3737 std::shared_ptr<Blob> blob = std::make_shared<Blob>(data, (sizeof data)-1 );
@@ -51,28 +51,60 @@ main()
5151 }
5252
5353 { /* 3..3 */
54+ unsigned char data[] = {
55+ 0x41 , 0x00 , 0x00 , 0xB2 , 0x03 , 0x00 , 0x14 , 0x04 , 0x00 , 0x9C , 0x4E , 0x00 , 0xC4 , 0x30 , 0x00 , 0x36 , 0xF4 , 0x01 , 0x23 , 0x0E , 0x00 , 0x0F , 0x00 , 0x2C ,
56+ 0x03 , 0x26 , 0x00 , 0xA9 , 0xF4 , 0x01 , 0x19 , 0x4E , 0x00 , 0x1E , 0xF6 , 0x01 , 0x95 , 0x0D , 0x00 , 0xA5 , 0x07 , 0x00 , 0x7D , 0x0F , 0x00 , 0xD0 , 0x05 , 0x00 ,
57+ 0x13 , 0xF9 , 0x01 , 0xA9 , 0x03 , 0x00 , 0x66 , 0x5B , 0x00 , 0x0A , 0x0E , 0x00 , 0xE3 , 0x53 , 0x00 , 0x30 , 0x2B , 0x00 , 0xB8 , 0x30 , 0x01 , 0x7C , 0xF4 , 0x01 ,
58+ 0xA2 , 0xF3 , 0x01 , 0x35 , 0x0C , 0x00 , 0x0D , 0x4E , 0x00 , 0xB0 , 0xF9 , 0x01 , 0xE6 , 0x0C , 0x00 , 0x8E , 0xF4 , 0x01 , 0xA9 , 0x06 , 0x00 , 0xC7 , 0xF4 , 0x01 ,
59+ 0x5C , 0x0B , 0x00 , 0x4B , 0x4E , 0x00 , 0xD2 , 0x05 , 0x00 , 0x13 , 0xF9 , 0x01 , 0x28 , 0x0F , 0x00 , 0xF4 , 0xF3 , 0x01 , 0x95 , 0x0B , 0x00 , 0x80 , 0x0D , 0x00 ,
60+ 0x3E , 0xF3 , 0x01 , 0x7B ,
61+ };
62+ std::shared_ptr<Blob> blob = std::make_shared<Blob>((char *) data, (sizeof data)-1 );
63+ StampStringUTF8 stamp_str_ascii;
64+ std::string s = stamp_str_ascii.ExtractStr (blob);
65+ is (s, " AβД亜ツ🐶ร☃💩丙😞ඕޥཽא🤓Ω学ช口⬰𓂸👼🎢వ不🦰೦💎ک📇ଡ଼之ג🤓༨🏴க🌾" ,
66+ " StampTextUTF8" );
67+ }
68+
69+ { /* 4..4 */
5470 char data[] = " dad\0 mam\0 granddad\0 grandmam\0 brother\0 sister" ;
5571 std::shared_ptr<Blob> blob = std::make_shared<Blob>(data, (sizeof data)-1 );
5672 StampText<StampStringLatin1> stamp;
5773 std::string s = stamp.ExtractStr (blob);
5874 is (s, " d dad gra n dmam broth er siste" , " StampText<StampStringLatin1>" );
5975 }
6076
61- { /* 4..4 */
77+ { /* 5..5 */
6278 char data[] = " abcdef" " abcdef" " ABCDEF" " 012345" ;
6379 std::shared_ptr<Blob> blob = std::make_shared<Blob>(data, (sizeof data)-1 );
6480 StampText<StampDictLCAlphaSmall> stamp;
6581 std::string s = stamp.ExtractStr (blob);
6682 is (s, " gleam godfather graffiti greened grouping gunshots gleam godfather graffiti greened grouping gunshots dismally dissented divested doorstep dread drunks convertors corpulent counterparts cranking crippled crusades" , " StampText<StampDictLCAlphaSmall>" );
6783 }
6884
69- { /* 5..5 */
85+ { /* 6..6 */
7086 char data[] = " Некоторый текст написанный русскими буквами в кодировке utf-8" ;
7187 std::shared_ptr<Blob> blob = std::make_shared<Blob>(data, (sizeof data)-1 );
7288 StampText<StampStringASCII> stamp;
7389 std::string s = stamp.ExtractStr (blob);
7490 is (s, " P9 Q Q\x3 Q \x1 Q \x1 P: P8 P<P 8 P 1Q\x3 P:P 2P0 P<P 8 P 2 P: P>P 4P8 Q P>P 2P :P5 ut f-8" , " StampText<StampStringASCII>" );
7591 }
7692
93+ { /* 7..7 */
94+ unsigned char data[] = {
95+ 0x41 , 0x00 , 0x00 , 0xB2 , 0x03 , 0x00 , 0x14 , 0x04 , 0x00 , 0x9C , 0x4E , 0x00 , 0xC4 , 0x30 , 0x00 , 0x36 , 0xF4 , 0x01 , 0x23 , 0x0E , 0x00 , 0x0F , 0x00 , 0x2C ,
96+ 0x03 , 0x26 , 0x00 , 0xA9 , 0xF4 , 0x01 , 0x19 , 0x4E , 0x00 , 0x1E , 0xF6 , 0x01 , 0x95 , 0x0D , 0x00 , 0xA5 , 0x07 , 0x00 , 0x7D , 0x0F , 0x00 , 0xD0 , 0x05 , 0x00 ,
97+ 0x13 , 0xF9 , 0x01 , 0xA9 , 0x03 , 0x00 , 0x66 , 0x5B , 0x00 , 0x0A , 0x0E , 0x00 , 0xE3 , 0x53 , 0x00 , 0x30 , 0x2B , 0x00 , 0xB8 , 0x30 , 0x01 , 0x7C , 0xF4 , 0x01 ,
98+ 0xA2 , 0xF3 , 0x01 , 0x35 , 0x0C , 0x00 , 0x0D , 0x4E , 0x00 , 0xB0 , 0xF9 , 0x01 , 0xE6 , 0x0C , 0x00 , 0x8E , 0xF4 , 0x01 , 0xA9 , 0x06 , 0x00 , 0xC7 , 0xF4 , 0x01 ,
99+ 0x5C , 0x0B , 0x00 , 0x4B , 0x4E , 0x00 , 0xD2 , 0x05 , 0x00 , 0x13 , 0xF9 , 0x01 , 0x28 , 0x0F , 0x00 , 0xF4 , 0xF3 , 0x01 , 0x95 , 0x0B , 0x00 , 0x80 , 0x0D , 0x00 ,
100+ 0x3E , 0xF3 , 0x01 , 0x7B ,
101+ };
102+ std::shared_ptr<Blob> blob = std::make_shared<Blob>((char *)data, (sizeof data)-1 );
103+ StampText<StampStringUTF8> stamp;
104+ std::string s = stamp.ExtractStr (blob);
105+ is (s, " 𰇴𰀅𰀎S𠇴N𠁎𰀅" ,
106+ " StampText<StampStringUTF8>" );
107+ }
108+
77109 TEST_END;
78110}
0 commit comments