mirror of
https://github.com/aria2/aria2.git
synced 2025-04-06 22:17:38 +03:00
Initial import
This commit is contained in:
commit
52634627bc
101 changed files with 19834 additions and 0 deletions
34
test/Base64Test.cc
Normal file
34
test/Base64Test.cc
Normal file
|
@ -0,0 +1,34 @@
|
|||
#include "Base64.h"
|
||||
#include <string>
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Base64Test:public CppUnit::TestFixture {
|
||||
|
||||
CPPUNIT_TEST_SUITE(Base64Test);
|
||||
CPPUNIT_TEST(testEncode);
|
||||
CPPUNIT_TEST(testDecode);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
private:
|
||||
|
||||
public:
|
||||
void setUp() {
|
||||
}
|
||||
|
||||
void testEncode();
|
||||
void testDecode();
|
||||
};
|
||||
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION( Base64Test );
|
||||
|
||||
void Base64Test::testEncode() {
|
||||
CPPUNIT_ASSERT_EQUAL(string("SGVsbG8gV29ybGQh"),
|
||||
Base64::encode("Hello World!"));
|
||||
}
|
||||
|
||||
void Base64Test::testDecode() {
|
||||
CPPUNIT_ASSERT_EQUAL(string("Hello World!"),
|
||||
Base64::decode("SGVsbG8gV29ybGQh"));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue