2 using namespace mimetic;
7 * input output in text mode output in binary mode
9 * note: maxlen == 12 during the following tests
11 const char* test_qp::test[][3] = {
12 { "test", "test", 0 },
13 { "te st", "te st", "te=20st" },
14 { " test", " test", "=20test" },
15 { "\ttest", "\ttest", "=09test" },
16 { "tes\tt", "tes\tt", "tes=09t" },
17 { "equal=", "equal=3D", 0 },
18 { "Fantastic", "Fantastic", 0 },
19 { "Fromage", "Fromage", 0 },
20 { "From ", "=46rom=20", 0 },
21 { "From more", "=46rom more", "=46rom=20mo=\nre" },
22 { "From age", "=46rom age", "=46rom=20age" },
23 { "te\xfest", "te=FEst", 0 },
24 { "te\1st", "te=01st", 0 },
25 { ".test", ".test", 0 },
28 { "unsafe!#$", "unsafe=21=\n=23=24", 0 },
30 { "aaaabbbbcccc", "aaaabbbbcccc", 0 },
31 { "aaaabbbbccccd", "aaaabbbbccc=\ncd", 0 },
32 { "aaaabbbbccccdddd", "aaaabbbbccc=\ncdddd", 0 },
33 { "aaaabbbbcc##", "aaaabbbbcc=\n=23=23", 0 },
34 { "aaaabbbbccc##", "aaaabbbbccc=\n=23=23", 0 },
35 { "aaaabbbbcccc##", "aaaabbbbccc=\nc=23=23", 0 },
36 // trailing blank (sp && tab)
37 { "abcde f", "abcde f", "abcde=20=20=\n=20=20f" },
38 { "abcde ", "abcde =20", "abcde=20=20=\n=20=20" },
39 { "Abcde ", "Abcde =20", "Abcde=20=20=\n=20=20=20" },
40 { "ABcde ", "ABcde =\n=20", "ABcde=20=20=\n=20=20=20=20"},
41 { "abcde\t \t a", "abcde\t \t a", "abcde=09=20=\n=09=20a" },
43 { "abcde\nf", "abcde\nf", "abcde=0Af" },
44 { "abcdef\n\ng", "abcdef\n\ng", "abcdef=0A=\n=0Ag" },
45 { "\nabc\n\ndefgh","\nabc\n\ndefgh","=0Aabc=0A=\n=0Adefgh" },
52 * expected decoded string malformed encoded string
54 const char* test_qp::test_decode_malformed[][2] = {
56 {"abcdefghilmnopqrst", "abcdefghilm= \r\nnopqrst"},
57 {"abcdefghilmnopqrst", "abcdefghilm= \r\nnopqrst"},
58 {"abcdefghilmnopqrst", "abcdefghilm= \r\nnopqrst"},
59 {"abcdefghilmnopqrst", "abcdefghilm= \r\nnopqrst"},
60 {"abcdefghilm= X\nnopqrst","abcdefghilm= X\r\nnopqrst"},
62 {"ab=cde","ab=3dcde"},
63 {"ab\xfe cde","ab=fE cde"},
65 {"abcdefgh=ilmnopqrst","abcdefgh=ilmno=\r\npqrst"},
66 {"abcd=Xefghilmnopqrst","abcd=Xefghi=\r\nlmnopqrst"},
67 {"abcd= efghilmnopqrst","abcd= efghi=\r\nlmnopqrst"},
68 {"abcdefghilm=nopqrst", "abcdefghilm=\r\n=nopqrst"},
75 {"abcde","ab\2c\3de"},
76 {"abcdefghi","\4abcd\5efghi"},
77 // rfc2045 6.7 note 4 (max line == 12)
78 {"abcdefghilmnopqrstuvz","abcdefghilmnopqrstuvz"},