10 #include <gtest/gtest.h> 21 for (
unsigned int seed = 0; seed < 500; seed++)
27 std::vector<uint8_t> myData(block_len);
28 for (
size_t n = 0;
n < block_len;
n++)
35 std::vector<uint8_t> outData;
37 GTEST_FAIL() <<
"Error decoding the just encoded data!\n";
40 EXPECT_EQ(outData.size(), myData.size());
44 EXPECT_TRUE(outData == myData)
45 <<
"64-decoded data does not match original data!!\n";
A namespace of pseudo-random numbers generators of diferent distributions.
uint32_t drawUniform32bit()
Generate a uniformly distributed pseudo-random number using the MT19937 algorithm, in the whole range of 32-bit integers.
void randomize(const uint32_t seed)
Initialize the PRNG from the given random seed.
bool decodeBase64(const std::string &inString, std::vector< uint8_t > &outData)
Decode a base-64 string into the original sequence of bytes.
GLsizei const GLchar ** string
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void encodeBase64(const std::vector< uint8_t > &inputData, std::string &outString)
Encode a sequence of bytes as a string in base-64.
TEST(Base64, RandomEncDec)
CRandomGenerator & getRandomGenerator()
A static instance of a CRandomGenerator class, for use in single-thread applications.