summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2020-05-21 09:56:35 +0200
committerSébastien Helleu <flashcode@flashtux.org>2020-05-21 09:56:35 +0200
commit99b13aa6719c0d6def4c7495482ccf05894d40d9 (patch)
tree8ab8dbf52e6818720bb015738157d868925a599c /tests
parenta997893cfef848e129199c7a92740265599a9cc7 (diff)
downloadweechat-99b13aa6719c0d6def4c7495482ccf05894d40d9.zip
tests: add test on function string_base64_decode with truncated base64 string
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/core/test-core-string.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/unit/core/test-core-string.cpp b/tests/unit/core/test-core-string.cpp
index 8674b6936..5154bd699 100644
--- a/tests/unit/core/test-core-string.cpp
+++ b/tests/unit/core/test-core-string.cpp
@@ -1839,6 +1839,9 @@ TEST(CoreString, Base64)
LONGS_EQUAL(length, string_base64_decode (str_base64[i][1], str));
STRCMP_EQUAL(str_base64[i][0], str);
}
+ /* invalid base64 string, missing two "=" at the end */
+ LONGS_EQUAL(4, string_base64_decode ("dGVzdA", str));
+ STRCMP_EQUAL("test", str);
}
/*