diff options
author | dcashman <dcashman@google.com> | 2014-05-30 09:34:04 -0700 |
---|---|---|
committer | dcashman <dcashman@google.com> | 2014-06-02 10:29:40 -0700 |
commit | 874d0d4032dc940327a81359f144d38d3cb580a3 (patch) | |
tree | a47894c0f48e52290a1a80ec6dd3dc3a6bbb8a89 /test-runner/src/android | |
parent | 8756a9897a9b94c1abaabd69945e5b0a36b7fa86 (diff) | |
download | frameworks_base-874d0d4032dc940327a81359f144d38d3cb580a3.zip frameworks_base-874d0d4032dc940327a81359f144d38d3cb580a3.tar.gz frameworks_base-874d0d4032dc940327a81359f144d38d3cb580a3.tar.bz2 |
Add ArrayUtils methods and tests for consumption by KeySet code.
Adds methods for dealing specifically with long data types. Used by
PackageKeySetData as part of the KeySet work. Add appropriate test methods
to MoreAsserts as well.
Bug: 6967056
Change-Id: I1e263301b353e0cd1b45126be6ef5ec310f311a8
Diffstat (limited to 'test-runner/src/android')
-rw-r--r-- | test-runner/src/android/test/MoreAsserts.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test-runner/src/android/test/MoreAsserts.java b/test-runner/src/android/test/MoreAsserts.java index fb0faba..3364895 100644 --- a/test-runner/src/android/test/MoreAsserts.java +++ b/test-runner/src/android/test/MoreAsserts.java @@ -128,6 +128,33 @@ public final class MoreAsserts { } /** + * @hide Asserts that array {@code actual} is the same size and every element equals + * those in array {@code expected}. On failure, message indicates first + * specific element mismatch. + */ + public static void assertEquals( + String message, long[] expected, long[] actual) { + if (expected.length != actual.length) { + failWrongLength(message, expected.length, actual.length); + } + for (int i = 0; i < expected.length; i++) { + if (expected[i] != actual[i]) { + failWrongElement(message, i, expected[i], actual[i]); + } + } + } + + /** + * @hide Asserts that array {@code actual} is the same size and every element equals + * those in array {@code expected}. On failure, message indicates first + * specific element mismatch. + */ + public static void assertEquals(long[] expected, long[] actual) { + assertEquals(null, expected, actual); + } + + + /** * Asserts that array {@code actual} is the same size and every element equals * those in array {@code expected}. On failure, message indicates first * specific element mismatch. |