8 static guchar data
[DATA_SIZE
];
11 test_incremental (gboolean line_break
,
15 gsize len
, decoded_len
, max
, input_len
, block_size
;
21 data2
= g_malloc (length
);
22 text
= g_malloc (length
* 4);
28 while (input_len
< length
)
30 block_size
= MIN (BLOCK_SIZE
, length
- input_len
);
31 len
+= g_base64_encode_step (data
+ input_len
, block_size
,
32 line_break
, text
+ len
, &state
, &save
);
33 input_len
+= block_size
;
35 len
+= g_base64_encode_close (line_break
, text
+ len
, &state
, &save
);
38 max
= length
* 4 / 3 + length
* 4 / (3 * 72) + 7;
40 max
= length
* 4 / 3 + 6;
42 /* Check encoded length */
43 g_assert_cmpint (len
, <=, max
);
51 int chunk_len
= MIN (BLOCK_SIZE
, len
);
52 decoded_len
+= g_base64_decode_step (p
,
55 &state
, &decoder_save
);
60 g_assert_cmpmem (data
, length
, data2
, decoded_len
);
67 test_incremental_break (gconstpointer d
)
69 gint length
= GPOINTER_TO_INT (d
);
71 test_incremental (TRUE
, length
);
75 test_incremental_nobreak (gconstpointer d
)
77 gint length
= GPOINTER_TO_INT (d
);
79 test_incremental (FALSE
, length
);
83 test_full (gconstpointer d
)
85 gint length
= GPOINTER_TO_INT (d
);
90 text
= g_base64_encode (data
, length
);
91 data2
= g_base64_decode (text
, &len
);
94 g_assert_cmpmem (data
, length
, data2
, len
);
101 gint length
; /* of data */
102 guchar data
[DATA_SIZE
];
105 /* 100 pre-encoded string from data[] buffer. Data length from 1..100
107 static const char *ok_100_encode_strs
[] = {
120 "AAECAwQFBgcICQoLDA==",
121 "AAECAwQFBgcICQoLDA0=",
122 "AAECAwQFBgcICQoLDA0O",
123 "AAECAwQFBgcICQoLDA0ODw==",
124 "AAECAwQFBgcICQoLDA0ODxA=",
125 "AAECAwQFBgcICQoLDA0ODxAR",
126 "AAECAwQFBgcICQoLDA0ODxAREg==",
127 "AAECAwQFBgcICQoLDA0ODxAREhM=",
128 "AAECAwQFBgcICQoLDA0ODxAREhMU",
129 "AAECAwQFBgcICQoLDA0ODxAREhMUFQ==",
130 "AAECAwQFBgcICQoLDA0ODxAREhMUFRY=",
131 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYX",
132 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGA==",
133 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBk=",
134 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBka",
135 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGw==",
136 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxw=",
137 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwd",
138 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHg==",
139 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8=",
140 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8g",
141 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gIQ==",
142 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISI=",
143 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIj",
144 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJA==",
145 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCU=",
146 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUm",
147 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJw==",
148 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJyg=",
149 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygp",
150 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKg==",
151 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKis=",
152 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKiss",
153 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLQ==",
154 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4=",
155 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4v",
156 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMA==",
157 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDE=",
158 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEy",
159 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMw==",
160 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ=",
161 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1",
162 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Ng==",
163 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc=",
164 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4",
165 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OQ==",
166 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo=",
167 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7",
168 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PA==",
169 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0=",
170 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+",
171 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+Pw==",
172 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0A=",
173 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BB",
174 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQg==",
175 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkM=",
176 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNE",
177 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERQ==",
178 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUY=",
179 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZH",
180 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSA==",
181 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSEk=",
182 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElK",
183 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKSw==",
184 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0w=",
185 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xN",
186 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTg==",
187 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk8=",
188 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc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gcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFi",
207 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiYw==",
212 generate_databuffer_for_base64 (struct MyRawData
*p
)
215 for (i
= 0; i
< DATA_SIZE
; i
++)
220 test_base64_encode (void)
225 struct MyRawData myraw
;
227 generate_databuffer_for_base64 (&myraw
);
229 for (i
= 0; ok_100_encode_strs
[i
]; i
++)
232 text
= g_base64_encode (myraw
.data
, length
);
233 g_assert_cmpstr (text
, ==, ok_100_encode_strs
[i
]);
234 /* printf ("\"%s\",\n",text); */
239 /* Test that incremental and all-in-one encoding of strings of a length which
240 * is not a multiple of 3 bytes behave the same, as the state carried over
241 * between g_base64_encode_step() calls varies depending on how the input is
242 * split up. This is like the test_base64_decode_smallblock() test, but for
245 test_base64_encode_incremental_small_block (gconstpointer block_size_p
)
248 struct MyRawData myraw
;
250 g_test_bug ("780066");
252 generate_databuffer_for_base64 (&myraw
);
254 for (i
= 0; ok_100_encode_strs
[i
] != NULL
; i
++)
256 const guint block_size
= GPOINTER_TO_UINT (block_size_p
);
257 gchar
*encoded_complete
= NULL
;
258 gchar encoded_stepped
[1024];
259 gint state
= 0, save
= 0;
260 gsize len_written
, len_read
, len_to_read
, input_length
;
262 input_length
= i
+ 1;
264 /* Do it all at once. */
265 encoded_complete
= g_base64_encode (myraw
.data
, input_length
);
267 /* Split the data up so some number of bits remain after each step. */
268 for (len_written
= 0, len_read
= 0; len_read
< input_length
; len_read
+= len_to_read
)
270 len_to_read
= MIN (block_size
, input_length
- len_read
);
271 len_written
+= g_base64_encode_step (myraw
.data
+ len_read
, len_to_read
,
273 encoded_stepped
+ len_written
,
277 len_written
+= g_base64_encode_close (FALSE
, encoded_stepped
+ len_written
,
279 g_assert_cmpuint (len_written
, <, G_N_ELEMENTS (encoded_stepped
));
281 /* Nul-terminate to make string comparison easier. */
282 encoded_stepped
[len_written
] = '\0';
284 /* Compare results. They should be the same. */
285 g_assert_cmpstr (encoded_complete
, ==, ok_100_encode_strs
[i
]);
286 g_assert_cmpstr (encoded_stepped
, ==, encoded_complete
);
288 g_free (encoded_complete
);
293 decode_and_compare (const gchar
*datap
,
294 const struct MyRawData
*p
)
299 data2
= g_base64_decode (datap
, &len
);
300 g_assert_cmpmem (p
->data
, p
->length
, data2
, len
);
305 decode_inplace_and_compare (const gchar
*datap
,
306 const struct MyRawData
*p
)
312 data
= g_strdup (datap
);
313 data2
= g_base64_decode_inplace (data
, &len
);
314 g_assert_cmpmem (p
->data
, p
->length
, data2
, len
);
319 test_base64_decode (void)
322 struct MyRawData myraw
;
324 generate_databuffer_for_base64 (&myraw
);
326 for (i
= 0; ok_100_encode_strs
[i
]; i
++)
328 myraw
.length
= i
+ 1;
329 decode_and_compare (ok_100_encode_strs
[i
], &myraw
);
334 test_base64_decode_inplace (void)
337 struct MyRawData myraw
;
339 generate_databuffer_for_base64 (&myraw
);
341 for (i
= 0; ok_100_encode_strs
[i
]; i
++)
343 myraw
.length
= i
+ 1;
344 decode_inplace_and_compare (ok_100_encode_strs
[i
], &myraw
);
349 test_base64_encode_decode (void)
353 struct MyRawData myraw
;
355 generate_databuffer_for_base64 (&myraw
);
357 for (i
= 0; i
< DATA_SIZE
; i
++)
359 myraw
.length
= i
+ 1;
360 text
= g_base64_encode (myraw
.data
, myraw
.length
);
362 decode_and_compare (text
, &myraw
);
369 test_base64_decode_smallblock (gconstpointer blocksize_p
)
371 const guint blocksize
= GPOINTER_TO_UINT (blocksize_p
);
374 for (i
= 0; ok_100_encode_strs
[i
]; i
++)
376 const char *str
= ok_100_encode_strs
[i
];
378 gsize len
= strlen (str
);
382 gsize decoded_size
= 0;
383 guchar
*decoded_atonce
;
384 gsize decoded_atonce_size
= 0;
386 decoded
= g_malloc (len
/ 4 * 3 + 3);
391 int chunk_len
= MIN (blocksize
, len
);
392 gsize size
= g_base64_decode_step (p
, chunk_len
,
393 decoded
+ decoded_size
,
395 decoded_size
+= size
;
400 decoded_atonce
= g_base64_decode (str
, &decoded_atonce_size
);
402 g_assert_cmpmem (decoded
, decoded_size
, decoded_atonce
, decoded_atonce_size
);
405 g_free (decoded_atonce
);
411 main (int argc
, char *argv
[])
415 g_test_init (&argc
, &argv
, NULL
);
416 g_test_bug_base ("https://bugzilla.gnome.org/browse.cgi?product=");
418 for (i
= 0; i
< DATA_SIZE
; i
++)
421 g_test_add_data_func ("/base64/full/1", GINT_TO_POINTER (DATA_SIZE
), test_full
);
422 g_test_add_data_func ("/base64/full/2", GINT_TO_POINTER (1), test_full
);
423 g_test_add_data_func ("/base64/full/3", GINT_TO_POINTER (2), test_full
);
424 g_test_add_data_func ("/base64/full/4", GINT_TO_POINTER (3), test_full
);
426 g_test_add_data_func ("/base64/encode/incremental/small-block/1", GINT_TO_POINTER (1), test_base64_encode_incremental_small_block
);
427 g_test_add_data_func ("/base64/encode/incremental/small-block/2", GINT_TO_POINTER (2), test_base64_encode_incremental_small_block
);
428 g_test_add_data_func ("/base64/encode/incremental/small-block/3", GINT_TO_POINTER (3), test_base64_encode_incremental_small_block
);
429 g_test_add_data_func ("/base64/encode/incremental/small-block/4", GINT_TO_POINTER (4), test_base64_encode_incremental_small_block
);
431 g_test_add_data_func ("/base64/incremental/nobreak/1", GINT_TO_POINTER (DATA_SIZE
), test_incremental_nobreak
);
432 g_test_add_data_func ("/base64/incremental/break/1", GINT_TO_POINTER (DATA_SIZE
), test_incremental_break
);
434 g_test_add_data_func ("/base64/incremental/nobreak/2", GINT_TO_POINTER (DATA_SIZE
- 1), test_incremental_nobreak
);
435 g_test_add_data_func ("/base64/incremental/break/2", GINT_TO_POINTER (DATA_SIZE
- 1), test_incremental_break
);
437 g_test_add_data_func ("/base64/incremental/nobreak/3", GINT_TO_POINTER (DATA_SIZE
- 2), test_incremental_nobreak
);
438 g_test_add_data_func ("/base64/incremental/break/3", GINT_TO_POINTER (DATA_SIZE
- 2), test_incremental_break
);
440 g_test_add_data_func ("/base64/incremental/nobreak/4-a", GINT_TO_POINTER (1), test_incremental_nobreak
);
441 g_test_add_data_func ("/base64/incremental/nobreak/4-b", GINT_TO_POINTER (2), test_incremental_nobreak
);
442 g_test_add_data_func ("/base64/incremental/nobreak/4-c", GINT_TO_POINTER (3), test_incremental_nobreak
);
444 g_test_add_func ("/base64/encode", test_base64_encode
);
445 g_test_add_func ("/base64/decode", test_base64_decode
);
446 g_test_add_func ("/base64/decode-inplace", test_base64_decode_inplace
);
447 g_test_add_func ("/base64/encode-decode", test_base64_encode_decode
);
449 g_test_add_data_func ("/base64/incremental/smallblock/1", GINT_TO_POINTER(1),
450 test_base64_decode_smallblock
);
451 g_test_add_data_func ("/base64/incremental/smallblock/2", GINT_TO_POINTER(2),
452 test_base64_decode_smallblock
);
453 g_test_add_data_func ("/base64/incremental/smallblock/3", GINT_TO_POINTER(3),
454 test_base64_decode_smallblock
);
455 g_test_add_data_func ("/base64/incremental/smallblock/4", GINT_TO_POINTER(4),
456 test_base64_decode_smallblock
);
458 return g_test_run ();