diff options
author | 2021-03-15 23:57:11 +0000 | |
---|---|---|
committer | 2021-03-17 17:55:00 +0000 | |
commit | 64d371896e8615428481e00b4827c746a3733a7f (patch) | |
tree | 0e6225d4f6ab8f1ac4fcb917fa1cdfa1117c6057 /android/test_asserts.go | |
parent | afeee22c17ee20ea118d7cfdb8edebfcc7e388a1 (diff) |
Add AssertIntEquals
Bug: 182402754
Test: m nothing
Change-Id: Ifed5cd656b6ad72ef59f9a5fadb10add5807c015
Diffstat (limited to 'android/test_asserts.go')
-rw-r--r-- | android/test_asserts.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/android/test_asserts.go b/android/test_asserts.go index 5100abb79..e2df12fa9 100644 --- a/android/test_asserts.go +++ b/android/test_asserts.go @@ -31,6 +31,15 @@ func AssertBoolEquals(t *testing.T, message string, expected bool, actual bool) } } +// AssertIntEquals checks if the expected and actual values are equal and if they are not then it +// reports an error prefixed with the supplied message and including a reason for why it failed. +func AssertIntEquals(t *testing.T, message string, expected int, actual int) { + t.Helper() + if actual != expected { + t.Errorf("%s: expected %d, actual %d", message, expected, actual) + } +} + // AssertStringEquals checks if the expected and actual values are equal and if they are not then // it reports an error prefixed with the supplied message and including a reason for why it failed. func AssertStringEquals(t *testing.T, message string, expected string, actual string) { |