diff options
| -rw-r--r-- | main/src/cgeo/geocaching/connector/gc/GCConstants.java | 2 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/SettingsTest.java | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/connector/gc/GCConstants.java b/main/src/cgeo/geocaching/connector/gc/GCConstants.java index 8a4a741..dcad388 100644 --- a/main/src/cgeo/geocaching/connector/gc/GCConstants.java +++ b/main/src/cgeo/geocaching/connector/gc/GCConstants.java @@ -70,7 +70,7 @@ public final class GCConstants { /** Use replaceAll("[,.]","") on the resulting string before converting to an int */ public static final Pattern PATTERN_CACHES_FOUND = Pattern.compile("<strong[^>]*>.*?([\\d,.]+) Caches Found"); public static final Pattern PATTERN_AVATAR_IMAGE_PROFILE_PAGE = Pattern.compile("<img src=\"(http://img.geocaching.com/user/avatar/[0-9a-f-]+\\.jpg)\"[^>]*\\salt=\"Avatar\""); - public static final Pattern PATTERN_LOGIN_NAME_LOGIN_PAGE = Pattern.compile("<h4>Success:</h4> <p>You are logged in as[^<]*<strong><span id=\"ctl00_ContentBody_lbUsername\"[^>]*>([^<]+)[^<]*</span>"); + public static final Pattern PATTERN_LOGIN_NAME_LOGIN_PAGE = Pattern.compile("ctl00_ContentBody_lbUsername\">.*<strong>(.*)</strong>"); public static final Pattern PATTERN_CUSTOMDATE = Pattern.compile("<option selected=\"selected\" value=\"([ /Mdy-]+)\">"); /** diff --git a/tests/src/cgeo/geocaching/SettingsTest.java b/tests/src/cgeo/geocaching/SettingsTest.java index f113180..cedf777 100644 --- a/tests/src/cgeo/geocaching/SettingsTest.java +++ b/tests/src/cgeo/geocaching/SettingsTest.java @@ -32,4 +32,9 @@ public class SettingsTest extends ActivityInstrumentationTestCase2<cgeo> { public static void testSettings() { assertEquals(GCConstants.MEMBER_STATUS_PM, Settings.getMemberStatus()); } + + public static void testDeviceHasNormalLogin() { + // if the unit tests were interrupted in a previous run, the device might still have the "temporary" login data from the last tests + assertFalse("c:geo".equals(Settings.getUsername())); + } } |
