diff options
author | Leonid Lisovskiy <lly.dev@gmail.com> | 2011-10-28 13:59:04 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-10-28 13:59:55 +0200 |
commit | 328f27fe447761f355104e7f524dc1115f16ca44 (patch) | |
tree | 1a8280c4cbc4458b89dda72c4d0c8f7402661355 /testsuite/uuencode.tests | |
parent | ec447c7f01acb0e3abd9daa52a1b616be3f39484 (diff) | |
download | busybox-w32-328f27fe447761f355104e7f524dc1115f16ca44.tar.gz busybox-w32-328f27fe447761f355104e7f524dc1115f16ca44.tar.bz2 busybox-w32-328f27fe447761f355104e7f524dc1115f16ca44.zip |
libbb: split decode_base64 off read_base64
function old new delta
decode_base64 - 182 +182
read_base64 378 255 -123
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 182/-123) Total: 59 bytes
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite/uuencode.tests')
-rwxr-xr-x | testsuite/uuencode.tests | 101 |
1 files changed, 98 insertions, 3 deletions
diff --git a/testsuite/uuencode.tests b/testsuite/uuencode.tests index cd6191b1b..6ce70f747 100755 --- a/testsuite/uuencode.tests +++ b/testsuite/uuencode.tests | |||
@@ -8,9 +8,9 @@ | |||
8 | 8 | ||
9 | . ./testing.sh | 9 | . ./testing.sh |
10 | 10 | ||
11 | # testing "test name" "options" "expected result" "file input" "stdin" | 11 | # testing "test name" "command(s)" "expected result" "file input" "stdin" |
12 | # file input will be file called "input" | 12 | # file input will be file called "input" |
13 | # test can create a file "actual" instead of writing to stdout | 13 | # test can create a file "actual" instead of writing to stdout |
14 | 14 | ||
15 | # Test setup of standard input | 15 | # Test setup of standard input |
16 | umask 0 | 16 | umask 0 |
@@ -24,4 +24,99 @@ testing "uuencode correct encoding" "uuencode bb_uuenc_test.out" \ | |||
24 | testing "uuencode correct base64 encoding" "uuencode -m bb_uuenc_test.out" \ | 24 | testing "uuencode correct base64 encoding" "uuencode -m bb_uuenc_test.out" \ |
25 | "begin-base64 644 bb_uuenc_test.out\nVGhlIGZhc3QgZ3JleSBmb3gganVtcGVkIG92ZXIgdGhlIGxhenkgYnJvd24g\nZG9nLgo=\n====\n" \ | 25 | "begin-base64 644 bb_uuenc_test.out\nVGhlIGZhc3QgZ3JleSBmb3gganVtcGVkIG92ZXIgdGhlIGxhenkgYnJvd24g\nZG9nLgo=\n====\n" \ |
26 | "" "The fast grey fox jumped over the lazy brown dog.\n" | 26 | "" "The fast grey fox jumped over the lazy brown dog.\n" |
27 | |||
28 | testing "uuencode empty file" 'r=`uuencode FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ | ||
29 | 'begin 644 FILE | ||
30 | ` | ||
31 | end | ||
32 | ' "" "" | ||
33 | testing "uuencode -m empty file" 'r=`uuencode -m FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ | ||
34 | 'begin-base64 644 FILE | ||
35 | ==== | ||
36 | ' "" "" | ||
37 | |||
38 | testing "uuencode file 'A'" 'r=`uuencode FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ | ||
39 | 'begin 644 FILE | ||
40 | !00`` | ||
41 | ` | ||
42 | end | ||
43 | A' "" "A" | ||
44 | testing "uuencode -m file 'A'" 'r=`uuencode -m FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ | ||
45 | 'begin-base64 644 FILE | ||
46 | QQ== | ||
47 | ==== | ||
48 | A' "" "A" | ||
49 | |||
50 | testing "uuencode file 'AB'" 'r=`uuencode FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ | ||
51 | 'begin 644 FILE | ||
52 | "04(` | ||
53 | ` | ||
54 | end | ||
55 | AB' "" "AB" | ||
56 | testing "uuencode -m file 'AB'" 'r=`uuencode -m FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ | ||
57 | 'begin-base64 644 FILE | ||
58 | QUI= | ||
59 | ==== | ||
60 | AB' "" "AB" | ||
61 | |||
62 | testing "uuencode file 'ABC'" 'r=`uuencode FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ | ||
63 | 'begin 644 FILE | ||
64 | #04)# | ||
65 | ` | ||
66 | end | ||
67 | ABC' "" "ABC" | ||
68 | testing "uuencode -m file 'ABC'" 'r=`uuencode -m FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ | ||
69 | 'begin-base64 644 FILE | ||
70 | QUJD | ||
71 | ==== | ||
72 | ABC' "" "ABC" | ||
73 | |||
74 | testing "uuencode file 'ABCD'" 'r=`uuencode FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ | ||
75 | 'begin 644 FILE | ||
76 | $04)#1``` | ||
77 | ` | ||
78 | end | ||
79 | ABCD' "" "ABCD" | ||
80 | testing "uuencode -m file 'ABCD'" 'r=`uuencode -m FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ | ||
81 | 'begin-base64 644 FILE | ||
82 | QUJDRA== | ||
83 | ==== | ||
84 | ABCD' "" "ABCD" | ||
85 | |||
86 | testing "uuencode file 'ABCDE'" 'r=`uuencode FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ | ||
87 | 'begin 644 FILE | ||
88 | %04)#1$4` | ||
89 | ` | ||
90 | end | ||
91 | ABCDE' "" "ABCDE" | ||
92 | testing "uuencode -m file 'ABCDE'" 'r=`uuencode -m FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ | ||
93 | 'begin-base64 644 FILE | ||
94 | QUJDREU= | ||
95 | ==== | ||
96 | ABCDE' "" "ABCDE" | ||
97 | |||
98 | testing "uuencode file 'ABCDEF'" 'r=`uuencode FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ | ||
99 | 'begin 644 FILE | ||
100 | &04)#1$5& | ||
101 | ` | ||
102 | end | ||
103 | ABCDEF' "" "ABCDEF" | ||
104 | testing "uuencode -m file 'ABCDEF'" 'r=`uuencode -m FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ | ||
105 | 'begin-base64 644 FILE | ||
106 | QUJDREVG | ||
107 | ==== | ||
108 | ABCDEF' "" "ABCDEF" | ||
109 | |||
110 | testing "uuencode file 'A<NUL><0xff>Z'" 'r=`uuencode FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ | ||
111 | 'begin 644 FILE | ||
112 | $00#_6@`` | ||
113 | ` | ||
114 | end | ||
115 | A\x0\xffZ' "" "A\x0\xffZ" | ||
116 | testing "uuencode -m file 'A<NUL><0xff>Z'" 'r=`uuencode -m FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ | ||
117 | 'begin-base64 644 FILE | ||
118 | QQD/Wg== | ||
119 | ==== | ||
120 | A\x0\xffZ' "" "A\x0\xffZ" | ||
121 | |||
27 | exit $FAILCOUNT | 122 | exit $FAILCOUNT |