Skip to content

Commit

Permalink
Update minSdk values in UtilTest
Browse files Browse the repository at this point in the history
These were missed when upgrading to both SDK 19 and 21, but they now
cause failures like:

```
Caused by: java.lang.RuntimeException: Failed to parse package buildout/intermediates/apk_for_local_test/debugUnitTest/packageDebugUnitTestForUnitTest/apk-for-local-test.ap_: buildout/intermediates/apk_for_local_test/debugUnitTest/packageDebugUnitTestForUnitTest/apk-for-local-test.ap_ (at Binary XML file line #20): Requires newer sdk version #21 (current version is #19)
    at org.robolectric.shadows.ShadowPackageParser.callParsePackage(ShadowPackageParser.java:61)
    ... 20 more
```

#cherrypick

PiperOrigin-RevId: 670241471
  • Loading branch information
icbaker authored and copybara-github committed Sep 2, 2024
1 parent 1d92768 commit 4562c78
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,7 @@ public void contentEquals_oneNullSparseArrayAndOneNonNullSparseArray_returnsFals
}

@Test
@Config(minSdk = 16) // Specifies the minimum SDK to enforce the test to run with all API levels.
@Config(minSdk = 21) // Specifies the minimum SDK to enforce the test to run with all API levels.
public void contentEquals_sparseArraysWithEqualContent_returnsTrue() {
SparseArray<Integer> sparseArray1 = new SparseArray<>();
sparseArray1.put(1, 2);
Expand All @@ -1583,7 +1583,7 @@ public void contentEquals_sparseArraysWithEqualContent_returnsTrue() {
}

@Test
@Config(minSdk = 16) // Specifies the minimum SDK to enforce the test to run with all API levels.
@Config(minSdk = 21) // Specifies the minimum SDK to enforce the test to run with all API levels.
public void contentEquals_sparseArraysWithDifferentContents_returnsFalse() {
SparseArray<Integer> sparseArray1 = new SparseArray<>();
sparseArray1.put(1, 2);
Expand All @@ -1599,7 +1599,7 @@ public void contentEquals_sparseArraysWithDifferentContents_returnsFalse() {
}

@Test
@Config(minSdk = 16) // Specifies the minimum SDK to enforce the test to run with all API levels.
@Config(minSdk = 21) // Specifies the minimum SDK to enforce the test to run with all API levels.
public void contentHashCode_sparseArraysWithEqualContent_returnsEqualContentHashCode() {
SparseArray<Integer> sparseArray1 = new SparseArray<>();
sparseArray1.put(1, 2);
Expand All @@ -1612,7 +1612,7 @@ public void contentHashCode_sparseArraysWithEqualContent_returnsEqualContentHash
}

@Test
@Config(minSdk = 16) // Specifies the minimum SDK to enforce the test to run with all API levels.
@Config(minSdk = 21) // Specifies the minimum SDK to enforce the test to run with all API levels.
public void contentHashCode_sparseArraysWithDifferentContent_returnsDifferentContentHashCode() {
// In theory this is not guaranteed though, adding this test to ensure a sensible
// contentHashCode implementation.
Expand Down

0 comments on commit 4562c78

Please sign in to comment.