Hans Boehm | 75ca21c | 2015-03-11 18:43:24 -0700 | [diff] [blame] | 1 | Run on Android with |
| 2 | |
| 3 | 1) Build the tests. |
| 4 | 2) Install the calculator with |
Hans Boehm | 4db31b4 | 2015-05-31 12:19:05 -0700 | [diff] [blame] | 5 | adb install <tree root>/out/target/product/generic/data/app/ExactCalculator/ExactCalculator.apk |
Hans Boehm | 75ca21c | 2015-03-11 18:43:24 -0700 | [diff] [blame] | 6 | 3) adb install <tree root>/out/target/product/generic/data/app/ExactCalculatorTests/ExactCalculatorTests.apk |
| 7 | 4) adb shell am instrument -w com.android.exactcalculator.tests/android.test.InstrumentationTestRunner |
| 8 | |
| 9 | There are two kinds of tests: |
| 10 | |
| 11 | 1. A superficial test of calculator functionality through the UI. |
| 12 | This is a resurrected version of a test that appeared in KitKat. |
Hans Boehm | 4a6b7cb | 2015-04-03 18:41:52 -0700 | [diff] [blame] | 13 | This is currently only a placeholder for regression tests we shouldn't |
| 14 | forget; it doesn't yet actually do much of anything. |
Hans Boehm | 75ca21c | 2015-03-11 18:43:24 -0700 | [diff] [blame] | 15 | |
| 16 | 2. A test of the BoundedRationals library that mostly checks for agreement |
| 17 | with the constructive reals (CR) package. (The BoundedRationals package |
| 18 | is used by the calculator mostly to identify exact results, i.e. |
| 19 | terminating decimal expansions. But it's also used to optimize CR |
| 20 | computations, and bugs in BoundedRational could result in incorrect |
| 21 | outputs.) |
Hans Boehm | 5e802f3 | 2015-06-22 17:18:52 -0700 | [diff] [blame] | 22 | |
| 23 | We currently have no automatic tests for display formatting corner cases. |
| 24 | The following numbers have exhibited problems in the past and would be good |
| 25 | to test. Some of them are difficult to test automatically, because they |
| 26 | require scrolling to both ends of the result. For those with finite |
| 27 | decimal expansions, it also worth confirming that the "display with leading |
| 28 | digits" display shows an exact value when scrolled all the way to the right. |
| 29 | |
| 30 | Some interesting test cases: |
| 31 | |
| 32 | 10^10 + 10^30 |
| 33 | 10^30 + 10^-10 |
| 34 | -10^30 + 20 |
| 35 | 10^30 + 10^-30 |
| 36 | -10^30 - 10^10 |
| 37 | -1.2x10^-9 |
| 38 | -1.2x10^-8 |
| 39 | 1 - 10^-98 |
| 40 | 1 - 10^-100 |
| 41 | 1 - 10^-300 |
| 42 | 1/-56x10^18 (on a Nexus 7 sized portrait display) |
| 43 | -10^-500 (scroll to see the 1, then scroll back & verify minus sign appears) |