diff options
author | Hans Boehm <hboehm@google.com> | 2015-10-10 00:12:02 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-10-10 00:12:02 +0000 |
commit | ca9a5ad0d46acb1e69730b06dd9716349a781bff (patch) | |
tree | d6dd5cc793f6b62436db7a8c384800121fa5ef4f /tests/src/com/android/calculator2/BRTest.java | |
parent | 492d496dc01b452973b05ffd3c11a33d2e86bd5b (diff) | |
parent | 114e08db3c0ed3ffb77129ee5db62645edc580bb (diff) | |
download | android_packages_apps_ExactCalculator-ca9a5ad0d46acb1e69730b06dd9716349a781bff.tar.gz android_packages_apps_ExactCalculator-ca9a5ad0d46acb1e69730b06dd9716349a781bff.tar.bz2 android_packages_apps_ExactCalculator-ca9a5ad0d46acb1e69730b06dd9716349a781bff.zip |
am 114e08db: Merge "BoundedRational.java cleanup" into mnc-dr-dev
* commit '114e08db3c0ed3ffb77129ee5db62645edc580bb':
BoundedRational.java cleanup
Diffstat (limited to 'tests/src/com/android/calculator2/BRTest.java')
-rw-r--r-- | tests/src/com/android/calculator2/BRTest.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/src/com/android/calculator2/BRTest.java b/tests/src/com/android/calculator2/BRTest.java index 77d4bf0..0163a0f 100644 --- a/tests/src/com/android/calculator2/BRTest.java +++ b/tests/src/com/android/calculator2/BRTest.java @@ -139,6 +139,12 @@ public class BRTest extends TestCase { check(BR_0.signum() == 0, "signum(0)"); check(BR_M1.signum() == -1, "signum(-1)"); check(BR_2.signum() == 1, "signum(2)"); + check(BoundedRational.asBigInteger(BR_390).intValue() == 390, "390.asBigInteger()"); + check(BoundedRational.asBigInteger(BoundedRational.HALF) == null, "1/2.asBigInteger()"); + check(BoundedRational.asBigInteger(BoundedRational.MINUS_HALF) == null, + "-1/2.asBigInteger()"); + check(BoundedRational.asBigInteger(new BoundedRational(15, -5)).intValue() == -3, + "-15/5.asBigInteger()"); check(BoundedRational.digitsRequired(BoundedRational.ZERO) == 0, "digitsRequired(0)"); check(BoundedRational.digitsRequired(BoundedRational.HALF) == 1, "digitsRequired(1/2)"); check(BoundedRational.digitsRequired(BoundedRational.MINUS_HALF) == 1, |