aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2014-01-08 13:50:25 +0100
committerSamuel Tardieu <sam@rfc1149.net>2014-01-08 13:50:25 +0100
commit025c0affdf07fef63615c732c112fbc96a52fe75 (patch)
treefddd6c8a2164f04d8f0e452350d885a2b7a5e38d /tests
parenta3c0cbe929202375a9831cc3bf9e60a6a1329a53 (diff)
parent20232a47f33653f0950663c4e96467f4de60e303 (diff)
downloadcgeo-025c0affdf07fef63615c732c112fbc96a52fe75.zip
cgeo-025c0affdf07fef63615c732c112fbc96a52fe75.tar.gz
cgeo-025c0affdf07fef63615c732c112fbc96a52fe75.tar.bz2
Merge branch 'release' into upstream
Diffstat (limited to 'tests')
-rw-r--r--tests/src/cgeo/geocaching/geopoint/ViewportTest.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/src/cgeo/geocaching/geopoint/ViewportTest.java b/tests/src/cgeo/geocaching/geopoint/ViewportTest.java
index ac32468..60766b4 100644
--- a/tests/src/cgeo/geocaching/geopoint/ViewportTest.java
+++ b/tests/src/cgeo/geocaching/geopoint/ViewportTest.java
@@ -6,6 +6,7 @@ import android.test.AndroidTestCase;
import java.util.Collections;
import java.util.HashSet;
+import java.util.Locale;
import java.util.Set;
public class ViewportTest extends AndroidTestCase {
@@ -54,8 +55,17 @@ public class ViewportTest extends AndroidTestCase {
}
public static void testSqlWhere() {
- assertEquals("latitude >= -1.0 and latitude <= 3.0 and longitude >= -2.0 and longitude <= 4.0", vpRef.sqlWhere(null));
- assertEquals("t.latitude >= -1.0 and t.latitude <= 3.0 and t.longitude >= -2.0 and t.longitude <= 4.0", vpRef.sqlWhere("t"));
+ assertEquals("latitude >= -1.0 and latitude <= 3.0 and longitude >= -2.0 and longitude <= 4.0", vpRef.sqlWhere(null).toString());
+ assertEquals("t.latitude >= -1.0 and t.latitude <= 3.0 and t.longitude >= -2.0 and t.longitude <= 4.0", vpRef.sqlWhere("t").toString());
+ Locale current = null;
+ try {
+ current = Locale.getDefault();
+ Locale.setDefault(Locale.FRENCH);
+ assertEquals("1,0", String.format("%.2g", 1.0d)); // Control that we are in a locale with commma separator
+ assertEquals("t.latitude >= -1.0 and t.latitude <= 3.0 and t.longitude >= -2.0 and t.longitude <= 4.0", vpRef.sqlWhere("t").toString());
+ } finally {
+ Locale.setDefault(current);
+ }
}
public static void testEquals() {