#include "config.h"
#include "base64.hh"
+#include <limits>
#include <stdexcept>
#include <boost/scoped_array.hpp>
#include <openssl/bio.h>
bio = BIO_push(b64, bio);
BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL);
int bioWriteRet = BIO_write(bio, src.c_str(), src.length());
- if (bioWriteRet < 0 || (size_t)bioWriteRet != src.length()) {
+ if (bioWriteRet < 0 || static_cast<size_t>(bioWriteRet) != src.length()) {
BIO_free_all(bio);
throw std::runtime_error("BIO_write failed to write all data to memory buffer");
}
#include <boost/assign/std/map.hpp>
#include "base64.hh"
+#include "openssl/conf.h"
using namespace boost;
{
const std::string paddingOnly("====");
std::string decoded;
- BOOST_CHECK_EQUAL(B64Decode(paddingOnly, decoded), -1);
+ auto ret = B64Decode(paddingOnly, decoded);
+#if OPENSSL_VERSION_NUMBER >= 0x30500000
+ BOOST_CHECK_EQUAL(ret, -1);
+#else
+ // does not test anything meaningful, but avoids a "ret unused" warning
+ BOOST_CHECK(ret == 0 || ret == -1);
+#endif
}
BOOST_AUTO_TEST_SUITE_END()