Another effort to fix base64decode and associated unit test.
This commit is contained in:
parent
87e536dadf
commit
f1303cbcda
@ -215,7 +215,7 @@ namespace Exiv2 {
|
||||
if (j < output_length) out[j++] = (triple >> 1 * 8) & 0xFF;
|
||||
if (j < output_length) out[j++] = (triple >> 0 * 8) & 0xFF;
|
||||
}
|
||||
out[output_length++]=0;
|
||||
out[output_length]=0;
|
||||
result = output_length;
|
||||
}
|
||||
|
||||
|
||||
@ -147,7 +147,7 @@ TEST(base64decode, decodesValidString)
|
||||
const std::string original ("VGhpcyBpcyBhIHVuaXQgdGVzdA==");
|
||||
const std::string expected ("This is a unit test");
|
||||
char * result = new char [original.size()];
|
||||
ASSERT_EQ(static_cast<long>(expected.size()+1),
|
||||
ASSERT_EQ(static_cast<long>(expected.size()),
|
||||
base64decode(original.c_str(), result, original.size()));
|
||||
ASSERT_STREQ(expected.c_str(), result);
|
||||
delete [] result;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user