From 1bd1c98858c20e700f1fa8947330e1d593594dae Mon Sep 17 00:00:00 2001 From: Ziver Koc Date: Sat, 22 Mar 2014 21:51:01 +0000 Subject: [PATCH] Some fixes to test --- src/zutil/test/Base64Test.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/zutil/test/Base64Test.java b/src/zutil/test/Base64Test.java index 0161466..c9ec184 100644 --- a/src/zutil/test/Base64Test.java +++ b/src/zutil/test/Base64Test.java @@ -22,20 +22,21 @@ package zutil.test; -import static org.junit.Assert.*; - import org.junit.Test; - import zutil.parser.Base64Decoder; +import static org.junit.Assert.assertEquals; + public class Base64Test { @Test public void testHexToByte() { - Base64Decoder decoder = new Base64Decoder(); - //decoder.decode("TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4="); - //assertEquals( "Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure.", decoder.toString() ); - decoder.clear(); + assertEquals( "Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure.", + Base64Decoder.decode("TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4=") + ); + + Base64Decoder decoder = new Base64Decoder(); + decoder.clear(); decoder.write("YW55IGNhcm5hbCBwbGVhc3VyZQ=="); assertEquals( "any carnal pleasure", decoder.toString() ); decoder.clear();