diff options
author | Samuel Tardieu <sam@rfc1149.net> | 2014-11-23 18:16:29 +0100 |
---|---|---|
committer | Samuel Tardieu <sam@rfc1149.net> | 2015-01-01 12:40:11 +0100 |
commit | 69b14c2a67529b92dfb961650c642e91bc47e7d8 (patch) | |
tree | 4ae4f413b7b0204f695f82bb24d301593c8aec75 /tests/src/cgeo/geocaching | |
parent | e79732dc9ef6805dd9a4eb1b011049fded646e28 (diff) | |
download | cgeo-69b14c2a67529b92dfb961650c642e91bc47e7d8.zip cgeo-69b14c2a67529b92dfb961650c642e91bc47e7d8.tar.gz cgeo-69b14c2a67529b92dfb961650c642e91bc47e7d8.tar.bz2 |
Update Intellij IDEA files
Diffstat (limited to 'tests/src/cgeo/geocaching')
-rw-r--r-- | tests/src/cgeo/geocaching/ImageUtilsTest.java | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/tests/src/cgeo/geocaching/ImageUtilsTest.java b/tests/src/cgeo/geocaching/ImageUtilsTest.java deleted file mode 100644 index 7f6c7e5..0000000 --- a/tests/src/cgeo/geocaching/ImageUtilsTest.java +++ /dev/null @@ -1,30 +0,0 @@ -package cgeo.geocaching; - -import static org.assertj.core.api.Assertions.assertThat; - -import cgeo.geocaching.test.AbstractResourceInstrumentationTestCase; -import cgeo.geocaching.test.R; -import cgeo.geocaching.utils.ImageUtils; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; - -public class ImageUtilsTest extends AbstractResourceInstrumentationTestCase { - - private static final String icon64 = "iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAABAElEQVQY002NvUpDQRQG52yEILn+IAYCClaS4tqKtZ1dbHwNuaS00dYmQmrfwMZGRBAtrMQHSCMpTCMqaIx6k909e6wCme4bPhhhhuc8d8PxeC+ZPW33++9T72ZPvdFow1SvStX9We8sz2U6FlQPLUYqqkW30VgGsKJAbur1g5pzXYMosC5giEgy+6hAtUzpqLLq3O8q7M6bbZkqmpKllExUa9+q2gvhbJrKLrLsdkVkxwABShg9eN86nUzunXU6AD/O+2EMgdJ7fAiY92EtxjcAJ+02JyKNkNLmawj9xxiLlxAu/2JcWoQmwBxAFT4Hqq1rs687GADnx9DMnOsD/AMJ54Nj8e9zcgAAAABJRU5ErkJggg=="; - - public void testBase64decoding() throws IOException { - final ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - ImageUtils.decodeBase64ToStream(icon64, outputStream); - final byte[] decodedImage = outputStream.toByteArray(); - outputStream.close(); - assertThat(decodedImage.length).as("decoded image size").isEqualTo(409); - final InputStream originalStream = getResourceStream(R.raw.small_file); - final byte[] originalImage = new byte[409]; - assertEquals("original image has the right size (consistency check)", 409, originalStream.read(originalImage)); - originalStream.close(); - assertThat(decodedImage).as("decoded base64 image").isEqualTo(originalImage); - } - -} |