summaryrefslogtreecommitdiff
path: root/test/Base64Test.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-02-17 13:35:04 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-02-17 13:35:04 +0000
commit52634627bc3be9365180e52d7a96c9ca8497f3dc (patch)
tree3e31f1657753ec8d5e9b5711040822e65256f145 /test/Base64Test.cc
Initial import
Diffstat (limited to 'test/Base64Test.cc')
-rw-r--r--test/Base64Test.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/Base64Test.cc b/test/Base64Test.cc
new file mode 100644
index 00000000..9ace6f5b
--- /dev/null
+++ b/test/Base64Test.cc
@@ -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"));
+}