Skip to content

Commit 42ea37b

Browse files
committed
fix string comparison and degree to integer args
1 parent f1821d8 commit 42ea37b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

java/src/test/java/com/google/openlocationcode/EncodingTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void testEncodeFromDegrees() {
6666
String got =
6767
OpenLocationCode.encode(
6868
testData.latitudeDegrees, testData.longitudeDegrees, testData.length);
69-
if (got != testData.code) {
69+
if (!testData.code.equals(got)) {
7070
failedEncodings++;
7171
System.out.printf(
7272
"ENCODING DIFFERENCE: encode(%f,%f,%d) got %s, want %s\n",
@@ -90,7 +90,7 @@ public void testEncodeFromDegrees() {
9090
public void testDegreesToIntegers() {
9191
for (TestData testData : testDataList) {
9292
long[] got =
93-
OpenLocationCode.degreesToIntegers(testData.latitudeDegrees, testData.latitudeDegrees);
93+
OpenLocationCode.degreesToIntegers(testData.latitudeDegrees, testData.longitudeDegrees);
9494
Assert.assertTrue(
9595
String.format(
9696
"degreesToIntegers(%f, %f) returned latitude %d, expected %d",

0 commit comments

Comments
 (0)