From 92ac7c4a87b0cdb033ebba14bb19bd10448bb026 Mon Sep 17 00:00:00 2001 From: blafoo Date: Tue, 8 Nov 2011 23:02:32 +0100 Subject: Fixed regex due to GC.com update Conflicts: main/src/cgeo/geocaching/GCConstants.java + fix for ../tests/src/cgeo/geocaching/cgeoApplicationTest.java --- tests/src/cgeo/geocaching/test/WhitespaceTest.java | 11 +- tests/src/cgeo/geocaching/test/mock/GC1ZXX2.html | 575 +++++++++++------ tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java | 6 +- tests/src/cgeo/geocaching/test/mock/GC2CJPF.html | 681 ++++++++++++++------- tests/src/cgeo/geocaching/test/mock/GC2CJPF.java | 12 +- tests/src/cgeo/geocaching/test/mock/GC2JVEH.html | 573 +++++++++++------ tests/src/cgeo/geocaching/test/mock/GC2JVEH.java | 4 +- 7 files changed, 1283 insertions(+), 579 deletions(-) (limited to 'tests/src/cgeo/geocaching/test') diff --git a/tests/src/cgeo/geocaching/test/WhitespaceTest.java b/tests/src/cgeo/geocaching/test/WhitespaceTest.java index bb9f0e0..6fab7fd 100644 --- a/tests/src/cgeo/geocaching/test/WhitespaceTest.java +++ b/tests/src/cgeo/geocaching/test/WhitespaceTest.java @@ -22,6 +22,7 @@ import java.util.regex.Pattern; */ public class WhitespaceTest extends AndroidTestCase { + private final int EXPECTED_SIZE = 119418; private String data; @Override @@ -77,7 +78,7 @@ public class WhitespaceTest extends AndroidTestCase { Matcher matcher = pattern.matcher(data); String result = matcher.replaceAll(" ").trim(); final long end = System.currentTimeMillis(); - assertEquals(111956, result.length()); + assertEquals(EXPECTED_SIZE - 1, result.length()); Log.d(Settings.tag, (end - start) + " ms regex"); } @@ -85,7 +86,7 @@ public class WhitespaceTest extends AndroidTestCase { final long start = System.currentTimeMillis(); String result = data.replaceAll("\\s+", " "); final long end = System.currentTimeMillis(); - assertEquals(111958, result.length()); + assertEquals(EXPECTED_SIZE + 1, result.length()); Log.d(Settings.tag, (end - start) + " ms replaceAll"); } @@ -94,7 +95,7 @@ public class WhitespaceTest extends AndroidTestCase { final long start = System.currentTimeMillis(); result = BaseUtils.replaceWhitespace(data); final long end = System.currentTimeMillis(); - assertEquals(111957, result.length()); + assertEquals(EXPECTED_SIZE, result.length()); Log.d(Settings.tag, (end - start) + " ms actual implementation"); } @@ -103,7 +104,7 @@ public class WhitespaceTest extends AndroidTestCase { final long start = System.currentTimeMillis(); result = replaceWhitespaceManually(data); final long end = System.currentTimeMillis(); - assertEquals(111957, result.length()); + assertEquals(EXPECTED_SIZE, result.length()); Log.d(Settings.tag, (end - start) + " ms manually"); } @@ -112,7 +113,7 @@ public class WhitespaceTest extends AndroidTestCase { final long start = System.currentTimeMillis(); result = replaceWhitespaceStringUtils(data); final long end = System.currentTimeMillis(); - assertEquals(111956, result.length()); + assertEquals(EXPECTED_SIZE - 1, result.length()); Log.d(Settings.tag, (end - start) + " ms StringUtils"); } } \ No newline at end of file diff --git a/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.html b/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.html index d20df53..f85f10f 100644 --- a/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.html +++ b/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.html @@ -9,7 +9,7 @@ - + @@ -162,54 +162,15 @@ { display: none; } + - /* ----------------------------------------------------------------------- -Begin Pagination ------------------------------------------------------------------------ */ - - .PaginationWidget - { - margin: 1.5em 0; - font-size: 10px; - } - .pagination a - { - text-decoration: none; - border: solid 1px #00447c; - color: #00447c; - } - .pagination a, .pagination span - { - display: block; - float: left; - padding: 3px 5px; - margin-right: 5px; - min-width: 1em; - text-align: center; - } - .pagination .current - { - background: #13b5ea; - color: #fff; - border: solid 1px #13b5ea; - } - .pagination .current.prev, .pagination .current.next - { - color: #b0b0b0; - border-color: #b0b0b0; - background: #fff; - } - - /* ----------------------------------------------------------------------- -End Pagination ------------------------------------------------------------------------ */ - + - - - - + + + + + - - + + @@ -1551,6 +1803,8 @@ border="0" />
  • Magyar
  • +
  • Română
  • + @@ -1598,7 +1852,7 @@ border="0" />
  • Email Support
  • Forums
  • -
  • Feedback Site
  • +
  • Contact
  • @@ -1628,7 +1882,7 @@ border="0" />

    Copyright © 2000-2011 Groundspeak, Inc. All Rights Reserved.
    - Groundspeak Terms of Use | Privacy Policy |

    + Groundspeak Terms of Use | Privacy Policy | | API License Agreement

    @@ -1639,45 +1893,18 @@ border="0" />
    - - @@ -1727,9 +1954,7 @@ initalLogs = {"status":"success", "data": [{"LogID":190275925,"CacheID":1433909, function isiOS(){ return ( - (navigator.userAgent.match(/iPhone/i)) || - (navigator.userAgent.match(/iPod/i)) || - (navigator.userAgent.match(/iPad/i)) + (navigator.userAgent.match(/(iPhone)|(iPod)|(iPad)/i)) ); } }); @@ -1879,6 +2104,6 @@ initalLogs = {"status":"success", "data": [{"LogID":190275925,"CacheID":1433909, Quantcast - + diff --git a/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java b/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java index 6d63b18..4b09ec7 100644 --- a/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java +++ b/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java @@ -120,10 +120,10 @@ public class GC1ZXX2 extends MockedCache { public Map getLogCounts() { Map logCounts = new HashMap(); logCounts.put(cgBase.LOG_PUBLISH_LISTING, 1); - logCounts.put(cgBase.LOG_FOUND_IT, 370); + logCounts.put(cgBase.LOG_FOUND_IT, 369); logCounts.put(cgBase.LOG_POST_REVIEWER_NOTE, 1); logCounts.put(cgBase.LOG_DIDNT_FIND_IT, 7); - logCounts.put(cgBase.LOG_NOTE, 8); + logCounts.put(cgBase.LOG_NOTE, 10); logCounts.put(cgBase.LOG_ARCHIVE, 1); logCounts.put(cgBase.LOG_ENABLE_LISTING, 2); logCounts.put(cgBase.LOG_TEMP_DISABLE_LISTING, 3); @@ -133,7 +133,7 @@ public class GC1ZXX2 extends MockedCache { @Override public Integer getFavoritePoints() { - return new Integer(49); + return new Integer(47); } @Override diff --git a/tests/src/cgeo/geocaching/test/mock/GC2CJPF.html b/tests/src/cgeo/geocaching/test/mock/GC2CJPF.html index 965eecf..32519f7 100644 --- a/tests/src/cgeo/geocaching/test/mock/GC2CJPF.html +++ b/tests/src/cgeo/geocaching/test/mock/GC2CJPF.html @@ -9,7 +9,7 @@ - + @@ -162,54 +162,15 @@ { display: none; } + - /* ----------------------------------------------------------------------- -Begin Pagination ------------------------------------------------------------------------ */ - - .PaginationWidget - { - margin: 1.5em 0; - font-size: 10px; - } - .pagination a - { - text-decoration: none; - border: solid 1px #00447c; - color: #00447c; - } - .pagination a, .pagination span - { - display: block; - float: left; - padding: 3px 5px; - margin-right: 5px; - min-width: 1em; - text-align: center; - } - .pagination .current - { - background: #13b5ea; - color: #fff; - border: solid 1px #13b5ea; - } - .pagination .current.prev, .pagination .current.next - { - color: #b0b0b0; - border-color: #b0b0b0; - background: #fff; - } - - /* ----------------------------------------------------------------------- -End Pagination ------------------------------------------------------------------------ */ - + - - + + + - - + + @@ -1789,6 +2069,8 @@ wievielen Mitgliedern besteht die Schafherde ?

  • Magyar
  • +
  • Română
  • + @@ -1836,7 +2118,7 @@ wievielen Mitgliedern besteht die Schafherde ?

  • Email Support
  • Forums
  • -
  • Feedback Site
  • +
  • Contact
  • @@ -1866,7 +2148,7 @@ wievielen Mitgliedern besteht die Schafherde ?

    Copyright © 2000-2011 Groundspeak, Inc. All Rights Reserved.
    - Groundspeak Terms of Use | Privacy Policy |

    + Groundspeak Terms of Use | Privacy Policy | | API License Agreement

    @@ -1877,48 +2159,21 @@ wievielen Mitgliedern besteht die Schafherde ?

    - - @@ -1968,9 +2223,7 @@ initalLogs = {"status":"success", "data": [{"LogID":190838992,"CacheID":1811409, function isiOS(){ return ( - (navigator.userAgent.match(/iPhone/i)) || - (navigator.userAgent.match(/iPod/i)) || - (navigator.userAgent.match(/iPad/i)) + (navigator.userAgent.match(/(iPhone)|(iPod)|(iPad)/i)) ); } }); @@ -2120,6 +2373,6 @@ initalLogs = {"status":"success", "data": [{"LogID":190838992,"CacheID":1811409, Quantcast - + diff --git a/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java b/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java index 6ef2406..9f0186b 100644 --- a/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java +++ b/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java @@ -60,7 +60,7 @@ public class GC2CJPF extends MockedCache { @Override public String getHint() { - return "Das Final (unter Steinen) ist mit GC gekennzeichnet."; + return "Das Final ist unter Steinen"; } @Override @@ -134,19 +134,19 @@ public class GC2CJPF extends MockedCache { public Map getLogCounts() { Map logCounts = new HashMap(); logCounts.put(cgBase.LOG_PUBLISH_LISTING, 1); - logCounts.put(cgBase.LOG_FOUND_IT, 55); - logCounts.put(cgBase.LOG_DIDNT_FIND_IT, 1); - logCounts.put(cgBase.LOG_NOTE, 5); + logCounts.put(cgBase.LOG_FOUND_IT, 60); + logCounts.put(cgBase.LOG_DIDNT_FIND_IT, 3); + logCounts.put(cgBase.LOG_NOTE, 6); logCounts.put(cgBase.LOG_ENABLE_LISTING, 2); logCounts.put(cgBase.LOG_TEMP_DISABLE_LISTING, 2); - logCounts.put(cgBase.LOG_OWNER_MAINTENANCE, 2); + logCounts.put(cgBase.LOG_OWNER_MAINTENANCE, 3); logCounts.put(cgBase.LOG_NEEDS_MAINTENANCE, 2); return logCounts; } @Override public Integer getFavoritePoints() { - return new Integer(6); + return new Integer(7); } } diff --git a/tests/src/cgeo/geocaching/test/mock/GC2JVEH.html b/tests/src/cgeo/geocaching/test/mock/GC2JVEH.html index 4c103a5..c6da8bd 100644 --- a/tests/src/cgeo/geocaching/test/mock/GC2JVEH.html +++ b/tests/src/cgeo/geocaching/test/mock/GC2JVEH.html @@ -9,7 +9,7 @@ - + @@ -162,54 +162,15 @@ { display: none; } + - /* ----------------------------------------------------------------------- -Begin Pagination ------------------------------------------------------------------------ */ - - .PaginationWidget - { - margin: 1.5em 0; - font-size: 10px; - } - .pagination a - { - text-decoration: none; - border: solid 1px #00447c; - color: #00447c; - } - .pagination a, .pagination span - { - display: block; - float: left; - padding: 3px 5px; - margin-right: 5px; - min-width: 1em; - text-align: center; - } - .pagination .current - { - background: #13b5ea; - color: #fff; - border: solid 1px #13b5ea; - } - .pagination .current.prev, .pagination .current.next - { - color: #b0b0b0; - border-color: #b0b0b0; - background: #fff; - } - - /* ----------------------------------------------------------------------- -End Pagination ------------------------------------------------------------------------ */ - + - - + + + - - + + @@ -1518,6 +1770,8 @@ von11-16 Uhr erledigt hast.
  • Magyar
  • +
  • Română
  • + @@ -1565,7 +1819,7 @@ von11-16 Uhr erledigt hast.
  • Email Support
  • Forums
  • -
  • Feedback Site
  • +
  • Contact
  • @@ -1595,7 +1849,7 @@ von11-16 Uhr erledigt hast.

    Copyright © 2000-2011 Groundspeak, Inc. All Rights Reserved.
    - Groundspeak Terms of Use | Privacy Policy |

    + Groundspeak Terms of Use | Privacy Policy | | API License Agreement

    @@ -1606,45 +1860,18 @@ von11-16 Uhr erledigt hast. - - @@ -1694,9 +1921,7 @@ initalLogs = {"status":"success", "data": [{"LogID":189151654,"CacheID":1997597, function isiOS(){ return ( - (navigator.userAgent.match(/iPhone/i)) || - (navigator.userAgent.match(/iPod/i)) || - (navigator.userAgent.match(/iPad/i)) + (navigator.userAgent.match(/(iPhone)|(iPod)|(iPad)/i)) ); } }); @@ -1846,6 +2071,6 @@ initalLogs = {"status":"success", "data": [{"LogID":189151654,"CacheID":1997597, Quantcast - + diff --git a/tests/src/cgeo/geocaching/test/mock/GC2JVEH.java b/tests/src/cgeo/geocaching/test/mock/GC2JVEH.java index 38bce01..c0b9b3d 100644 --- a/tests/src/cgeo/geocaching/test/mock/GC2JVEH.java +++ b/tests/src/cgeo/geocaching/test/mock/GC2JVEH.java @@ -112,7 +112,7 @@ public class GC2JVEH extends MockedCache { @Override public Map getLogCounts() { Map logCounts = new HashMap(); - logCounts.put(cgBase.LOG_FOUND_IT, 57); + logCounts.put(cgBase.LOG_FOUND_IT, 59); logCounts.put(cgBase.LOG_NOTE, 7); logCounts.put(cgBase.LOG_TEMP_DISABLE_LISTING, 1); logCounts.put(cgBase.LOG_ENABLE_LISTING, 1); @@ -122,7 +122,7 @@ public class GC2JVEH extends MockedCache { @Override public Integer getFavoritePoints() { - return new Integer(20); + return new Integer(21); } @Override -- cgit v1.1