comparison ui/tests/commontest.cpp @ 233:d773e540dec3

Add checks for invalid input
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 28 Mar 2014 11:33:39 +0000
parents 1f44aae4528e
children 6435e28ae753
comparison
equal deleted inserted replaced
232:774e944c395b 233:d773e540dec3
22 22
23 QVERIFY(ret == 0); 23 QVERIFY(ret == 0);
24 QVERIFY(data_size == 1000); 24 QVERIFY(data_size == 1000);
25 QVERIFY(data); 25 QVERIFY(data);
26 26
27 ret = str_base64_decode(&data, &data_size, (char *)ba.constData(), ba.size());
28 QVERIFY(ret != 0);
29
30 const char * foo = "bla";
31 ret = str_base64_decode(&data, &data_size, (char *)foo, 3);
32 QVERIFY(ret != 0);
33
27 for (size_t i = 0; i < data_size; i++) { 34 for (size_t i = 0; i < data_size; i++) {
28 QVERIFY(garbage[i] == data[i]); 35 QVERIFY(garbage[i] == data[i]);
29 } 36 }
30 free (data); 37 free (data);
31 } 38 }

http://wald.intevation.org/projects/trustbridge/