diff options
| author | mucek4 <tomaz@gorenc.org> | 2013-01-10 14:51:38 +0100 |
|---|---|---|
| committer | mucek4 <tomaz@gorenc.org> | 2013-01-11 09:49:35 +0100 |
| commit | f217995c8a0e591cb4c9e017cfb5e9f860133b0c (patch) | |
| tree | f91b49acdbd5cc69c23e4d7de7eda341d0477cd1 /tests/src | |
| parent | 9aa114f3ea8b8e88816f98f1534972766a134021 (diff) | |
| download | cgeo-f217995c8a0e591cb4c9e017cfb5e9f860133b0c.zip cgeo-f217995c8a0e591cb4c9e017cfb5e9f860133b0c.tar.gz cgeo-f217995c8a0e591cb4c9e017cfb5e9f860133b0c.tar.bz2 | |
Added unit tests for PNG parsing
Diffstat (limited to 'tests/src')
| -rw-r--r-- | tests/src/cgeo/geocaching/connector/gc/IconDecoderTest.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/src/cgeo/geocaching/connector/gc/IconDecoderTest.java b/tests/src/cgeo/geocaching/connector/gc/IconDecoderTest.java index 35886d4..af5d1bc 100644 --- a/tests/src/cgeo/geocaching/connector/gc/IconDecoderTest.java +++ b/tests/src/cgeo/geocaching/connector/gc/IconDecoderTest.java @@ -383,4 +383,41 @@ public class IconDecoderTest extends AbstractResourceInstrumentationTestCase { assertEquals(CacheType.EARTH, parseMapPNG(bitmap, 24, 212, 11).getType()); } + public void testParseExtraMapall14() { + final Bitmap bitmap = getBitmap(R.raw.map_all14); + assertTrue(parseMapPNG(bitmap, 40, 16, 14).isFound()); + assertTrue(parseMapPNG(bitmap, 72, 16, 14).isFound()); + assertTrue(parseMapPNG(bitmap, 100, 16, 14).isFound()); + assertTrue(parseMapPNG(bitmap, 128, 16, 14).isFound()); + assertTrue(parseMapPNG(bitmap, 44, 44, 14).isOwn()); + assertTrue(parseMapPNG(bitmap, 76, 44, 14).isOwn()); + assertTrue(parseMapPNG(bitmap, 132, 44, 14).isOwn()); + assertEquals(CacheType.MULTI, parseMapPNG(bitmap, 40, 72, 14).getType()); + assertEquals(CacheType.MULTI, parseMapPNG(bitmap, 72, 72, 14).getType()); + assertEquals(CacheType.MULTI, parseMapPNG(bitmap, 100, 72, 14).getType()); + assertEquals(CacheType.MULTI, parseMapPNG(bitmap, 128, 72, 14).getType()); + assertEquals(CacheType.MYSTERY, parseMapPNG(bitmap, 40, 96, 14).getType()); + assertEquals(CacheType.MYSTERY, parseMapPNG(bitmap, 72, 96, 14).getType()); + assertEquals(CacheType.MYSTERY, parseMapPNG(bitmap, 100, 96, 14).getType()); + assertEquals(CacheType.MYSTERY, parseMapPNG(bitmap, 128, 96, 14).getType()); + assertEquals(CacheType.TRADITIONAL, parseMapPNG(bitmap, 40, 124, 14).getType()); + assertEquals(CacheType.TRADITIONAL, parseMapPNG(bitmap, 72, 124, 14).getType()); + assertEquals(CacheType.TRADITIONAL, parseMapPNG(bitmap, 100, 124, 14).getType()); + assertEquals(CacheType.TRADITIONAL, parseMapPNG(bitmap, 128, 124, 14).getType()); + assertEquals(CacheType.WHERIGO, parseMapPNG(bitmap, 40, 160, 14).getType()); + assertEquals(CacheType.WHERIGO, parseMapPNG(bitmap, 72, 160, 14).getType()); + assertEquals(CacheType.WHERIGO, parseMapPNG(bitmap, 100, 160, 14).getType()); + assertEquals(CacheType.WHERIGO, parseMapPNG(bitmap, 128, 160, 14).getType()); + assertEquals(CacheType.LETTERBOX, parseMapPNG(bitmap, 40, 184, 14).getType()); + assertEquals(CacheType.LETTERBOX, parseMapPNG(bitmap, 72, 184, 14).getType()); + assertEquals(CacheType.LETTERBOX, parseMapPNG(bitmap, 100, 184, 14).getType()); + assertEquals(CacheType.LETTERBOX, parseMapPNG(bitmap, 128, 184, 14).getType()); + + assertEquals(CacheType.CITO, parseMapPNG(bitmap, 12, 224, 14).getType()); + assertEquals(CacheType.EVENT, parseMapPNG(bitmap, 40, 220, 14).getType()); + assertEquals(CacheType.EARTH, parseMapPNG(bitmap, 68, 224, 14).getType()); + assertEquals(CacheType.MEGA_EVENT, parseMapPNG(bitmap, 96, 224, 14).getType()); + assertEquals(CacheType.WEBCAM, parseMapPNG(bitmap, 120, 224, 14).getType()); + assertEquals(CacheType.VIRTUAL, parseMapPNG(bitmap, 144, 224, 14).getType()); + } } |
