summaryrefslogtreecommitdiffstats
path: root/luni/src
Commit message (Collapse)AuthorAgeFilesLines
* Add math tests in csv format for libcore math functionsMichael Chen2014-07-216-0/+10328
| | | | | | | | | The goal here is to have a csv file with math tests that different parts of Android can all use the same math tests. This change provides these initial csv files as well as the corresponding testing framework for libcore. Change-Id: I56430bd9224d92853aefa5024d6fdd1d10dfb255
* Merge "CipherTest: check multiple calls to doFinal work"Kenny Root2014-07-171-0/+8
|\
| * CipherTest: check multiple calls to doFinal workKenny Root2014-07-141-0/+8
| | | | | | | | | | | | | | | | | | | | In existing implementations of JSSE Cipher providers, calling "doFinal" resets the cipher to the state it was at when "init" was called. Note that this is dangerous to do, but it appears some people do it. Bug: 16298401 Bug: http://code.google.com/p/android/issues/detail?id=73339 Change-Id: I32e26fde660dc7c50fdac0d74d5d97801f1da9f9
* | Revert "Revert "Add a cache for ZoneInfo objects in Java""Neil Fuller2014-07-174-13/+59
| | | | | | | | | | | | | | | | | | This reverts commit 01b6a878d10ee68db87c3d85d137e81a5257a78a. Contains a fix for when the timezone ID is not found. This includes a new test. Change-Id: I2e5e669782ea6caf4e97153ed6b63ca6ee4ef50d
* | Merge "Revert "Add a cache for ZoneInfo objects in Java""Neil Fuller2014-07-174-53/+13
|\ \
| * | Revert "Add a cache for ZoneInfo objects in Java"Neil Fuller2014-07-174-53/+13
| | | | | | | | | | | | | | | | | | This reverts commit a6e8689807f5a8bb9470ce7c26a47455d2d0608d. Change-Id: I17a0262d169db3418f2f8888195381f778975dc4
* | | Merge "Fix UnmodifiableEntrySet.toArray() ordering"Neil Fuller2014-07-171-1/+1
|\ \ \ | |/ / |/| |
| * | Fix UnmodifiableEntrySet.toArray() orderingNeil Fuller2014-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | toArray() was returning entries in reverse order. toArray(T[]) was correct. Thanks to Chris Povirk for discovering. The fix is simple. Change includes additional tests to avoid regressions. Test & support code has been cleaned up a little to improve coverage and make it (slightly) less horrible. Bug: https://code.google.com/p/android/issues/detail?id=72073 Change-Id: I42ff90e0f592482289cd0cd9fdbdaabf0c17ad93
* | | Add a cache for ZoneInfo objects in JavaNeil Fuller2014-07-164-13/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This mirrors the single-item cache in localtime.c. This is in preparation for an upcoming change to migrate android.format.text.Time over to Java. It will be making use of the Java ZoneInfo instead of the native equivalent. The Java cache has a size of 1 like the bionic one, though this can easily be increased. Given the default TimeZone / ZoneInfo was always pinned, in many cases the memory usage will not go up noticeably. In scenarios where applications load timezones besides the default a cache size of 1 potentially increases pinned memory usage by one ZoneInfo plus the overhead of the prototype object held by the cache (which is never returned to callers). An example ZoneInfo is "Europe/London", which has ~190 transitions (1 int + 1 byte) and ~6 types (1 int + 1 byte). Overhead of other fields is ~ 13 bytes, plus the ID string. 190 * (4 + 1) + 6 * (4 + 1) + 13 = 993 bytes. The prototypes held by the cache share the majority of their memory with their clones returned from ZoneInfo.makeTimeZone() and so the overhead of introducing the cache itself should be in the order of a few tens of bytes at most. In future we may want to increase the cache size to 2 in order to support apps that compare / switch timezones to increase the odds of the default remaining in the cache. Sizes above 2 look increasingly specialist. Change-Id: I0b7daa8ad5d334c8d421dfaa6e0421d3c181a915
* | | Tidy up OldAndroidLocaleTest#testICULocales.Narayan Kamath2014-07-161-6/+11
| | | | | | | | | | | | | | | | | | | | | Construct the locale object directly instead of having a list of strings and parsing them by hand. Change-Id: Ia26ab30cbe7c5e6e10aca81a0d55b213879b5112
* | | TLS-PSK cipher suites enabled when PSKKeyManager is provided.Alex Klyubin2014-07-143-8/+122
| |/ |/| | | | | | | | | | | | | This documents and tests that TLS-PSK cipher suites are enabled if a PSKKeyManager is provided to SSLContext during its initialization. Bug: 15073623 Change-Id: I8e2bc3e7a1ea8a986e468973b6bad19dc6b7bc3c
* | Merge "TLS-PSK cipher suites should appear in API Level 21."Alex Klyubin2014-07-112-16/+16
|\ \
| * | TLS-PSK cipher suites should appear in API Level 21.Alex Klyubin2014-07-082-16/+16
| | | | | | | | | | | | | | | | | | | | | This also fixes a typo in two TLS-PSK cipher suite names. Bug: 15073623 Change-Id: I92d289c2b91862529faf6e06f2eb9b0a21d42b52
* | | Merge "Invalidate cache of default SocketFactory"Kenny Root2014-07-104-0/+193
|\ \ \
| * | | Invalidate cache of default SocketFactoryKenny Root2014-06-274-0/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the default SocketFactory is set once and never invalidated. Use the Services cache version number to know when to invalidate our cache. This increases the time to get the default implementation from 63ns to 97ns on a Nexus 7 (2013) aka deb. Change-Id: I5d46f02fccaa25e5bcea69d5ca0e4924290cf0e1
* | | | Merge "KeyPairGeneratorTest: add back some DH tests"Kenny Root2014-07-101-6/+23
|\ \ \ \
| * | | | KeyPairGeneratorTest: add back some DH testsKenny Root2014-07-101-6/+23
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add back the DH tests that uses a pre-defined Diffie-Hellman prime and generator. Keep the tests that try to find safe prime disabled. Bug: 5513723 Bug: 16188130 Change-Id: If77b14287855528964665e7782be45c5f57434db
* | | | Merge "Fix unit tests now that the "tl" -> "fil" hack is gone."Narayan Kamath2014-07-091-11/+27
|\ \ \ \
| * | | | Fix unit tests now that the "tl" -> "fil" hack is gone.Narayan Kamath2014-07-071-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | | bug: 15873165 Change-Id: I2ffe1f384e2140b31adb72d1f4eaa029a70428f0
* | | | | Switch libcore to the new icu.Elliott Hughes2014-07-091-2/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: I58ec1fafdf5524538ac14c52d561bf93d5a6c946
* | | | | Remove more.Elliott Hughes2014-07-074-100/+3
| |_|/ / |/| | | | | | | | | | | | | | | | | | | (cherry-pick of f39b5ca3c6378c3c36c63889577004b9693ea9c6.) Change-Id: Idaf030cd369e728ec37df7107cd30062db899b7c
* | | | Remove.Elliott Hughes2014-07-0734-4938/+149
| | | | | | | | | | | | | | | | | | | | | | | | (cherry-pick of 63744c884dd4b4f4307f2b021fb894af164972af.) Change-Id: Ibf79a402e1bad98a262e380fcee3d35c127ae6d5
* | | | RemoveBrian Carlstrom2014-07-076-270/+0
|/ / / | | | | | | | | | | | | | | | (cherry picked from commit 36214feb86a0963b23f34c8c63584252bd757e19) Change-Id: I96d5109c01e39255b9970f7a515ddd3575a50e56
* | | Revert "Rename Arrays.ArrayList to Arrays.ArrayAdapter."Narayan Kamath2014-07-011-3/+3
| | | | | | | | | | | | | | | | | | This reverts commit 4b999a474eb92e0b89a34de56f3f7979fd491aa1. Change-Id: Ifd70798e74357ffe14cbc659ad49a9853b3be8c6
* | | Rename Arrays.ArrayList to Arrays.ArrayAdapter.Narayan Kamath2014-07-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Looking at Arrays.asList in isolation, it's easy to assume that the method returns a java.util.ArrayList instead of a private static class with the same name and different behaviour. Change-Id: Icd75a4a3d0e21c1302ca766e529172cf2de30c2c
* | | Fix System.arraycopyAndreas Gampe2014-06-261-52/+0
|/ / | | | | | | | | | | The generic version of arraycopy does not work. Remove it. Change-Id: I524289874cfbf62ed0af3c91264180041342c3f1
* | Merge "Fix a faulty Julian day computation."Elliott Hughes2014-06-264-5/+62
|\ \
| * | Fix a faulty Julian day computation.Elliott Hughes2014-06-264-5/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The use of Calendar.MILLISECONDS was wrong, as was the use of ZONE_OFFSET without DST_OFFSET. The existing code pretty much only works for the values tested in the unit test! This patch adds new tests to make up for that. I've also added calls to Calendar.clear to ensure we're not leaking SECONDS and MILLISECONDS from the Calendar instances (which get initialized to the current wall clock) into our test values. This hasn't mattered in the past, but actually does matter here because tests like isMidnight measure down to the millisecond. Bug: https://code.google.com/p/android/issues/detail?id=72356 Signed-off-by: jasper tsai <jasper3_tsai@asus.com> Signed-off-by: hellena shih <hellena_shih@asus.com> Change-Id: I7d57590a95d3f026bdf1b991e0b1ddb47ba9af37
* | | Merge "Clarify the String.compareTo contract and add tests."Elliott Hughes2014-06-261-0/+67
|\ \ \
| * | | Clarify the String.compareTo contract and add tests.Elliott Hughes2014-06-261-0/+67
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our use of vague terms like "negative" and "positive" led VM engineers to assume they had more leeway than they actually do. While we're here, let's fix all the ambiguous use of 'character' and add a warning and link to Collator anywhere the non-standard (and non-locale-specific) case folding is used. Change-Id: I0a0fb2a493861d32fac0bc4e28ae9634f8ac342c
* | | Merge "Fixed build for arraycopy with objects."Jeff Hao2014-06-261-3/+3
|\ \ \
| * | | Fixed build for arraycopy with objects.Emma Meersman2014-06-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Enabled arraycopy to call native code when passed two objects. Change-Id: I77f9455550acc53ab59ec2dc85cb1fe4d75583c9
* | | | Merge "Expanded arraycopy function to deal with more types and updated ↵Jeff Hao2014-06-261-2/+427
|\ \ \ \ | |/ / / | | | | | | | | benchmarking."
| * | | Expanded arraycopy function to deal with more types and updated benchmarking.Emma Meersman2014-06-231-2/+427
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Runs 48% faster on average for short arrays of length 16-128, depending on the type. Defaults to native code for longer arrays. Bug: 7103825 Change-Id: I70ca8f4a379600917e5bc103364af0637f18e03a
* | | | Don't return NULL as a jint.Ian Rogers2014-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Build fix. Change-Id: I49a566c3c34d2040e092689e52b0039c8195de03
* | | | Merge "Build fix: Remove reference to deleted java_io_Console function"Neil Fuller2014-06-201-1/+0
|\ \ \ \
| * | | | Build fix: Remove reference to deleted java_io_Console functionNeil Fuller2014-06-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function was deleted by 1f3014901704f3ae81538773b8a0b382945adc8d Bug: 12491103 Change-Id: If75f1f05d6a72cac7b7a86b7616bae870615452e
* | | | | Merge "Unimplement Console.readPassword and remove test"Neil Fuller2014-06-203-87/+4
|\ \ \ \ \ | |/ / / /
| * | | | Unimplement Console.readPassword and remove testNeil Fuller2014-06-233-87/+4
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ConsoleTest.test_readPassword* fails CTS tests. Context: Under standard Android applications the System.console() method will return null. The Console.readPassword() method must turn off echo. Under automated tests the ConsoleTest is exercising a Console object with fake stdout / stdin streams to get around the absence of a System.console(). setEcho() is hardcoded to use stdin / stdout in the native code. Under the test runners stdin / stdout are not connected to a TTY leading to a ENOTTY. Under Android readPassword is unimportant. Rather than leaving untested security-related code the password methods are being unimplemented. It is unlikely this code has ever been used on Android given the absence of a System Console instance. Bug: 12491103 Change-Id: I755c014e6b53236f5bef0535be137dd721918b44
* | | | Assert that setEnabledProtocols/CipherSuites copy their inputs.Alex Klyubin2014-06-193-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SSLSocket, SSLServerSocket, and SSLEngine offer setEnabledProtocols and setEnabledCipherSuites methods which take an array of protocols or cipher suites as input. If these methods store references to the input arrays, then the internal state (lists of enabled protocols and cipher suites) of SSLSocket, SSLServerSocket, and SSLEngine could be modified without going through the setter methods of these classes. Correct implementations of these methods should store copies of the input arrays. Bug: 15753142 Change-Id: Ia5248050d81320ed1da99892278bd60872605f52
* | | | Fix for currency symbol coming from the default localeNeil Fuller2014-06-194-19/+52
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NumberFormat.setCurrency() (actually DecimalFormat) was using currency.getSymbol() without passing the format's locale. This caused the default Locale to be used to look up the symbol. The fix uses the format locale, not the default. A test has been added to demonstrate the problem / fix. To avoid having the NativeDecimalFormat know about the locale class, the symbol is passed as an argument rather than the Currency object. This is an internal API. Making this change showed an issue with Currency.getSymbol(): For Locales without a country the currency code would be returned and not a symbol. ICU provides language-level symbols so this was not the best we could do. Since the code was previously using the default Locale, and the default locale usually has a country it was not previously obvious. testBug71369 broke because of this second issue. The code is also fixed here. This was discovered while investigating bug 71369 but is not related. Change-Id: If0ce280aefb042fe8f7ca126cced090b9268a866
* | | Merge "Fix CurrencyTest.test_getSymbol for unknown variants"Neil Fuller2014-06-172-0/+42
|\ \ \
| * | | Fix CurrencyTest.test_getSymbol for unknown variantsNeil Fuller2014-06-182-0/+42
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The behavior of CurrencyTest.getSymbol has changed since K for unrecoginzed locales. Commit de0eb683370d789e7bb25673b350b8dbf2ba5d69 now means the ICU default locale is set when the Java default locale is changed. Previously it would have been left unset and would have fallen back to using the system settings (most likely US or UK English during tests). The test is setting the Java default locale to "kr-KR" (a locale unrecognized by ICU) and requesting the currency symbol for USD for locale "kr-KR" (still unrecognized by ICU). Before the commit: Because the kr-KR argument is unrecognized ICU tries the ICU default (which was unset and so picked system setting of en). It returned "$". After the commit: As above, but now the ICU default is set to kr-KR. Since there is no entry for USD in the default it falls back to "root", and returns the value found there: "US$". Behavior when the default locale is unrecognized is edge-case and arguably it is no more / less correct before or after this commit. The test has been updated to reflect the new value + some tidy up of the test generally. This change also contains a more focused test that demonstrates the behavior in ICU and adds documentation to make ICU slightly clearer. Arguably neither the new ICUTest nor the existing CurrencyTest code should exist because they assert edge-case behavior that Android may wish to change in future. Bug: 14821275 Change-Id: I8beb6004b0c37d2fe59855d13d2c8e2e6fe1c530
* | | Merge "Removing tests that test the SqlLite API directly."Neil Fuller2014-06-1712-3152/+145
|\ \ \
| * | | Removing tests that test the SqlLite API directly.Neil Fuller2014-06-1712-3152/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many of the tests were testing that the SqlLite Java API works. Android does not ship with the SQLLite code as a public API so these have been removed. Some of the tests were testing JDBC APIs associated with Connection, Driver and DriverManager behavior so these have been retained and moved to libcore/java/sql/DriverTest.java / ConnectionTest.java Change-Id: I97ec05591019505f527ee134177c5637bbd08538
* | | | Merge "CTS fix: Signature2Test.test_clone()"Neil Fuller2014-06-172-1/+11
|\ \ \ \
| * | | | CTS fix: Signature2Test.test_clone()Neil Fuller2014-06-182-1/+11
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously it would throw a NullPointerException. Fixing that rendered the Signature cloneable and the test assertions failing. The test now passes but is of questionable value except to prove the absence of RuntimeException. Change-Id: I2a5b160f0914837b37b801e16b8a3717d00fd94e
* | | | Merge "Fix getISO3Country and getISO3Language."Narayan Kamath2014-06-174-17/+21
|\ \ \ \
| * | | | Fix getISO3Country and getISO3Language.Narayan Kamath2014-06-184-17/+21
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For backward compatibility, locales constructed with 3 letter countries and languages must return those languages and countries from these methods. With our strict language tag interpretation, these were being omitted or transformed to und. We fix this by passing only the language code (or the country code with a fixed language) down to ICU, which will then deal with it correctly. bug: 15638049 Change-Id: I517a82496a2a4c36b1ae9234f7d2d4eb89b34ffe
* | | | Merge "Relax KeyPairGeneratorTest"Neil Fuller2014-06-171-8/+43
|\ \ \ \