summaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/calculator2/BRTest.java
diff options
context:
space:
mode:
authorHans Boehm <hboehm@google.com>2015-10-10 00:03:28 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-10-10 00:03:28 +0000
commit114e08db3c0ed3ffb77129ee5db62645edc580bb (patch)
tree2acd9d59ae7fb86b03b924afee578d5ad0117a81 /tests/src/com/android/calculator2/BRTest.java
parentb13daf1050757fe3c69c2f0246de33e7e69b5fa9 (diff)
parentfc8a8d3e6273356ba795f647b38fc01f68727c1c (diff)
downloadandroid_packages_apps_ExactCalculator-114e08db3c0ed3ffb77129ee5db62645edc580bb.tar.gz
android_packages_apps_ExactCalculator-114e08db3c0ed3ffb77129ee5db62645edc580bb.tar.bz2
android_packages_apps_ExactCalculator-114e08db3c0ed3ffb77129ee5db62645edc580bb.zip
Merge "BoundedRational.java cleanup" into mnc-dr-dev
Diffstat (limited to 'tests/src/com/android/calculator2/BRTest.java')
-rw-r--r--tests/src/com/android/calculator2/BRTest.java6
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,