diff options
| author | SammysHP <sven@sammyshp.de> | 2011-11-05 22:52:03 +0100 |
|---|---|---|
| committer | SammysHP <sven@sammyshp.de> | 2011-11-05 22:52:03 +0100 |
| commit | d92352446f5d53c435a9dfd4857593c76355069f (patch) | |
| tree | d0344a02cbc609bc06c9cc4e2867da18d3bf293c /tests | |
| parent | c0aaabf1b2b676ff3ba221003ef3096f0c34c640 (diff) | |
| download | cgeo-d92352446f5d53c435a9dfd4857593c76355069f.zip cgeo-d92352446f5d53c435a9dfd4857593c76355069f.tar.gz cgeo-d92352446f5d53c435a9dfd4857593c76355069f.tar.bz2 | |
Fix #646: caches can not be watched if imported by GPX
Part of it: Add a method to convert the geocode to the id with a base31-conversion (with Groundspeak-alphabet).
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/src/cgeo/geocaching/utils/CryptUtilsTest.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/src/cgeo/geocaching/utils/CryptUtilsTest.java b/tests/src/cgeo/geocaching/utils/CryptUtilsTest.java index b53220f..29c0e92 100644 --- a/tests/src/cgeo/geocaching/utils/CryptUtilsTest.java +++ b/tests/src/cgeo/geocaching/utils/CryptUtilsTest.java @@ -1,7 +1,5 @@ package cgeo.geocaching.utils; -import cgeo.geocaching.utils.CryptUtils; - import junit.framework.TestCase; public class CryptUtilsTest extends TestCase { @@ -11,4 +9,10 @@ public class CryptUtilsTest extends TestCase { assertEquals("Pnpur uvag", CryptUtils.rot13("Cache hint")); assertEquals("123", CryptUtils.rot13("123")); } + + public static void testConvertToGcBase31() { + assertEquals("1186660", CryptUtils.convertToGcBase31("GC1PKK9")); + assertEquals("4660", CryptUtils.convertToGcBase31("GC1234")); + assertEquals("61731", CryptUtils.convertToGcBase31("GCF123")); + } } |
