Commit Graph

3245 Commits

Author SHA1 Message Date
Dmitri Hrybenko
a741eccfeb Dictionary test: split leaking tests further so that they can be fixed
separately

rdar://17944094


Swift SVN r21364
2014-08-21 17:12:32 +00:00
Dmitri Hrybenko
9a267ef2a7 Dictionary test: separate tests that leave objects on the autorelease pool from
those that don't

rdar://17944094


Swift SVN r21363
2014-08-21 17:04:43 +00:00
Dmitri Hrybenko
9cf1bf0d59 Add a comment explaining the purpose of the test
Swift SVN r21349
2014-08-21 08:26:58 +00:00
Greg Parker
b0e15c09c9 [test] Fix some optional handling chnaged by an API notes update.
Swift SVN r21346
2014-08-21 07:03:10 +00:00
Greg Parker
98411714aa Use 16K segment alignment on 32-bit arm.
<rdar://18066791> iOS swift runtime libs should have 16KB page size


Swift SVN r21345
2014-08-21 06:11:54 +00:00
Dave Abrahams
1fb0f889d7 [stdlib] Make UnsafePointer conversions explicit
Previously, it was possible to write Unsafe[Mutable]Pointer(x) and have
Swift deduce the pointee type based on context.  Since reinterpreting
memory is a fundamentally type-unsafe operation, it's better to be
explicit about conversions from Unsafe[Mutable]Pointer<T> to
Unsafe[Mutable]Pointer<U>.  This change is consistent with the move from
reinterpretCast(x) to unsafeBitCast(x, T.self).

Also, we've encoded the operations of explicitly adding or removing
mutability as properties, so that adding mutability can be separated
from wild reinterpretCast'ing, a much more severe form of unsafety.

Swift SVN r21324
2014-08-20 23:15:56 +00:00
Anna Zaks
fa6c359842 API Notes File: Add notes fro Objective C framework
Note that isEqual: has been audited to take an optional parameter.

Swift SVN r21317
2014-08-20 21:15:25 +00:00
Mikhail Zolotukhin
5ecaed6966 stdlib: Add tests for sorting routines.
Swift SVN r21281
2014-08-19 13:41:10 +00:00
Mikhail Zolotukhin
4027d140d1 stdlib: Replace quicksort with introsort.
Also, unite predicated and unpredicated versions of all functions via
GYB.

Swift SVN r21280
2014-08-19 13:41:04 +00:00
Dmitri Hrybenko
c956e8ab88 Remove AssertDebug test; validation-test/stdlib/Assert.swift covers the
debug build configuration

Swift SVN r21271
2014-08-18 23:35:02 +00:00
Dmitri Hrybenko
4a9245fbe4 Move Assert.swift test to the validation testsuite
Swift SVN r21269
2014-08-18 23:05:21 +00:00
Dmitri Hrybenko
9276660e8a Move long-running Unicode tests to the validation testsuite
Swift SVN r21267
2014-08-18 23:03:47 +00:00
Dmitri Hrybenko
b689a27300 Move FixedPointArithmeticTraps test to the validation test suite
Swift SVN r21266
2014-08-18 22:56:01 +00:00
Dmitri Hrybenko
577ea23075 Refactor FixedPointArithmeticTraps test to use StdlibUnittest
Swift SVN r21265
2014-08-18 22:55:57 +00:00
Mikhail Zolotukhin
fd50a501b1 stdlib: Add floorLog2 function.
Swift SVN r21252
2014-08-18 14:26:02 +00:00
Dmitri Hrybenko
58083094d8 stdlib: port Assert.swift test to StdlibUnittest
Swift SVN r21251
2014-08-18 14:07:56 +00:00
Dmitri Hrybenko
cae11e1e41 stdlib/Assert: add overloads for assertionFailure(), preconditionFailure(),
fatalError() that accept string interpolation

rdar://18043533


Swift SVN r21250
2014-08-18 10:48:52 +00:00
Dmitri Hrybenko
16604871b3 stdlib: disallow concatenating Characters with "+"
rdar://18026160


Swift SVN r21249
2014-08-18 10:13:36 +00:00
Dmitri Hrybenko
532ca776ca stdlib/String: fix a memory safety issue with using foreign indexes
(indexes obtained from a different object)

rdar://18037790

Swift SVN r21244
2014-08-15 23:56:30 +00:00
Dmitri Hrybenko
a7f886a7a4 stdlib/Printing: add a regression test for rdar://17222588, this works
correctly now


Swift SVN r21235
2014-08-15 16:40:15 +00:00
Dmitri Hrybenko
5bffe7bffb stdlib/Reflection: add a regression test for rdar://17098079; this does not
crash anymore


Swift SVN r21234
2014-08-15 16:11:50 +00:00
Dmitri Hrybenko
e6c586a932 stdlib/NSString APIs on String: add tests for the rest of the APIs
Finally finishes rdar://17002128


Swift SVN r21233
2014-08-15 15:48:35 +00:00
Dmitri Hrybenko
8342c4a211 stdlib/NSString APIs on String: add more tests
Swift SVN r21232
2014-08-15 14:40:32 +00:00
Dmitri Hrybenko
1dbca014c3 stdlib/NSString APIs on String: add more tests
Swift SVN r21231
2014-08-15 11:05:49 +00:00
Dmitri Hrybenko
29de855bb0 stdlib/String: add an XFAIL'ed test demonstrating a String bug
Swift SVN r21228
2014-08-15 10:09:17 +00:00
Dmitri Hrybenko
2869641329 stdlib/String: add tests for using indices from one String with a different
String


Swift SVN r21227
2014-08-15 10:00:31 +00:00
Dmitri Hrybenko
203057da5b stdlib: add a test for string literal concatenation
rdar://17879373

Swift SVN r21226
2014-08-15 09:21:25 +00:00
Dmitri Hrybenko
8cca039e62 StdlibUnittest: rename TestCase to TestSuite since it contains multiple tests
Thanks, Ben!


Swift SVN r21222
2014-08-15 00:09:58 +00:00
Doug Gregor
15b1790245 Fix generic definitions of &= and ^= for bitwise types <rdar://problem/18018525>.
Swift SVN r21202
2014-08-14 17:27:42 +00:00
Dmitri Hrybenko
938e7c2676 stdlib: introduce UnicodeScalarLiteralConvertible protocol
This allows UnicodeScalars to be constructed from an integer, rather
then from a string.  Not only this avoids an unnecessary memory
allocation (!) when creating a UnicodeScalar, this also allows the
compiler to statically check that the string contains a single scalar
value (in the same way the compiler checks that Character contains only
a single extended grapheme cluster).

rdar://17966622

Swift SVN r21198
2014-08-14 16:04:39 +00:00
Anna Zaks
c519ecfe4f API Notes File: The product of the 2d nullability audit of Foundation.
As well as the required test/stdlib modifications.

Swift SVN r21181
2014-08-13 19:39:59 +00:00
Dave Abrahams
6f80758ace [stdlib] Add a missing test
Thanks for suggesting this one, Jordan!

Swift SVN r21177
2014-08-13 16:46:55 +00:00
Dave Abrahams
f075c1070a [stdlib] Add a ?? overload with T? on the RHS
Swift SVN r21175
2014-08-13 16:33:35 +00:00
Dmitri Hrybenko
d812966d32 stdlib: remove Optional.hasValue property
rdar://17931456


Swift SVN r21172
2014-08-13 10:51:26 +00:00
Doug Gregor
8df878c02a Give CGRect/CGSize/CGVector initializers that take Doubles.
Now that CGFloat is its own distinct type, it's useful to have Double
initializers to go along with the Int initializers we added a while
back <rdar://problem/17224725>.

Swift SVN r21156
2014-08-12 21:54:50 +00:00
Dmitri Hrybenko
1fc7709085 Fix Dictionary printing test on 32-bit platforms by allowing any
key/value order

Swift SVN r21149
2014-08-12 16:49:04 +00:00
Dmitri Hrybenko
93b815589e Remove a fatalError() that I pasted here by mistake
Swift SVN r21146
2014-08-12 16:11:32 +00:00
Dmitri Hrybenko
e2f264354d Try harder to fix the Runtime test on 32-bit iOS simulator
Swift SVN r21145
2014-08-12 15:58:27 +00:00
Dmitri Hrybenko
680b06798d Fix two tests under 32-bit iOS simulator
Swift SVN r21144
2014-08-12 15:35:44 +00:00
Dmitri Hrybenko
7777fe0799 Fix warnings in tests
Swift SVN r21143
2014-08-12 14:03:57 +00:00
Dmitri Hrybenko
3a04e0809f stdlib: add a function to squeeze a number in a given range from a hash value
This function mixes the bits in the hash value, which improves Dictionary
performance for keys with bad hashes.

PrecommitBenchmark changes with greater than 7% difference:

``````````Dictionary2`,```1456.00`,```1508.00`,```1502.00`,````624.00`,````607.00`,````592.00`,`864.00`,``145.9%
``````````Dictionary3`,```1379.00`,```1439.00`,```1408.00`,````585.00`,````567.00`,````552.00`,`827.00`,``149.8%
````````````Histogram`,````850.00`,````849.00`,````851.00`,```1053.00`,```1049.00`,```1048.00`,`199.00`,``-19.0%
````````````````Prims`,```1999.00`,```2005.00`,```2018.00`,```1734.00`,```1689.00`,```1701.00`,`310.00`,```18.4%
``````````StrSplitter`,```2365.00`,```2334.00`,```2316.00`,```1979.00`,```1997.00`,```2000.00`,`337.00`,```17.0%
```````````````TwoSum`,```1551.00`,```1568.00`,```1556.00`,```1771.00`,```1741.00`,```1716.00`,`165.00`,```-9.6%

Regressions are in benchmarks that use `Int` as dictionary key: we are just
doing more work than previously (hashing an `Int` was an identity function).

rdar://17962402


Swift SVN r21142
2014-08-12 12:02:26 +00:00
Dmitri Hrybenko
0492048ead Remove TrapTestPrototype, it is merged into StdlibUnittest now
Swift SVN r21141
2014-08-12 11:29:42 +00:00
Anna Zaks
ca03e527c3 API Notes File: Add the notes generated as the product of the first nullability audit of Foundation
As well as the required test modifications.

Swift SVN r21126
2014-08-09 01:40:48 +00:00
Dmitri Hrybenko
7255f900b9 stdlib: move test for floating point conversion traps to the validation
testsuite

Fixes for traps will follow.


Swift SVN r21108
2014-08-08 15:20:05 +00:00
Dmitri Hrybenko
ff8f68f3c6 StdlibUnittest: use builder syntax for 'xfail' and 'skip' annotations
Swift SVN r21106
2014-08-08 13:41:07 +00:00
Dmitri Hrybenko
4fa064696d NSString APIs test: attempt to fix the test on iOS by removing a dependency on
a file in the source tree


Swift SVN r21105
2014-08-08 11:58:56 +00:00
Dmitri Hrybenko
7b09119e8e Dictionary test: comment out checks that fail on the buildbot. Apparently, the
number of leaked objects depends on the OS version.


Swift SVN r21099
2014-08-07 22:36:23 +00:00
Jordan Rose
dc6d11ce6a [test] Foundation doesn't import CoreGraphics on iOS.
Swift SVN r21095
2014-08-07 17:35:09 +00:00
Dmitri Hrybenko
6f20c51e3e stdlib: fix crashes in CGPoint, CGSize, CGRect mirrors
rdar://17933906


Swift SVN r21091
2014-08-07 15:59:24 +00:00
Dmitri Hrybenko
f2436065db StdlibUnittest: run tests out of process
The test harness now can recover after test crashes, allowing:

- check for crashes themselves (without reporting them to the Python lit driver,
  which is about 10x slower -- even if CrashTracer is disabled);

- recover from unexpected test crashes and run the rest of the tests;

- this lays the groundwork for assertions that end the test execution, but
  allow the rest of the tests to run (rdar://17906801).

Note that we don't spawn a fresh process for every test.  We create a child
process and reuse it until it crashes.


Swift SVN r21090
2014-08-07 15:14:57 +00:00