Commit Graph

66 Commits

Author SHA1 Message Date
Lance Parker
276f49af84 Merge pull request #11982 from lancep/comprehensiveArrayTests
[stdlib] Comprehensive array tests
2017-09-20 13:01:59 -07:00
Lance Parker
bd055412d2 Make the reserve capacity test use GT/GE rather than testing for a speicific value 2017-09-20 11:23:42 -07:00
Lance Parker
a386f747ed Removed more occurrences of the incorrect comment 2017-09-19 16:26:36 -07:00
Lance Parker
135b9b0a33 Max's feedback 2017-09-19 16:17:05 -07:00
Lance Parker
f000afea11 Removed debug parameters from build line 2017-09-18 11:55:30 -07:00
Lance Parker
6ff5310260 Moved helpers to a new file 2017-09-18 11:51:59 -07:00
Lance Parker
b484f59202 Iterator tests 2017-09-18 11:51:59 -07:00
Lance Parker
b67f38d940 Killed all the warnings in the Array tests 2017-09-18 11:51:59 -07:00
Lance Parker
36cfba3bfc Array casting tests 2017-09-18 11:51:59 -07:00
Lance Parker
d7a17bcd1f More Array bridging tests 2017-09-18 11:51:59 -07:00
Lance Parker
87e6485a15 Add bridging tests like Dictionary's 2017-09-18 11:51:46 -07:00
Lance Parker
2ae14bbf24 Disable failing test on Linux 2017-09-07 11:09:38 -07:00
Lance Parker
7a37e9ee1d radar in comment 2017-09-06 22:22:04 -07:00
Lance Parker
e06a66587f Use .skip instead of commenting out the test 2017-09-06 10:48:49 -07:00
Lance Parker
787268c412 Disable test that's sometimes failing on Linux 2017-09-05 16:55:36 -07:00
Lance Parker
c049b14bfa Removed useless parts of Array tests 2017-08-30 22:32:07 -06:00
Lance Parker
77b0f39cc2 Max's feedback 2017-08-29 17:23:11 -07:00
Lance Parker
3c8f5fa04a Add COW test for Array 2017-08-28 17:20:18 -07:00
Lance Parker
f42bd011cb Disable ArraySlice.append index test 2017-08-25 10:18:04 -07:00
Lance Parker
f7437689a5 Fix comment from copy/paste 2017-08-23 12:03:40 -07:00
Lance Parker
5847455307 Make index tests more data based 2017-08-23 12:00:17 -07:00
Lance Parker
f17a53468f Remove redundant test 2017-08-21 16:14:58 -07:00
Lance Parker
726fba69ec Remove xfail for ArraySlice/append 2017-08-21 16:07:49 -07:00
Lance Parker
c49b8f98c5 Add index unit tests for Arrays 2017-08-21 13:38:46 -07:00
Erik Eckstein
2be1062cf2 Revert "Disable two stdlib tests in optimization mode."
The problem is fixed, so these tests should pass in optimized mode again.

This reverts commit bdd8626374.
2017-02-20 12:49:18 -08:00
Erik Eckstein
bdd8626374 Disable two stdlib tests in optimization mode.
Until rdar://problem/30579713 is fixed.
2017-02-17 14:28:57 -08:00
Max Moiseev
a552cd45e5 [validation-test] Extracting array and slice types conformance tests
Since these tests take the most time, spliting them into 'one type -
one conformance' pairs to maximize parallelism.

<rdar://problem/30269532>
2017-02-07 11:58:47 -08:00
Max Moiseev
c059b45a0b [validation-test] Splitting Arrays.swift.gyb into multiple files
In order to parallelize tests more and avoid a single long running
bottleneck.

<rdar://problem/30269532>
2017-02-03 17:06:55 -08:00
Ben Cohen
fefc2e40df Migrate _copyContents to be called from UnsafeMutableBufferPointer with checks for overrun. 2017-01-05 11:59:49 -08:00
practicalswift
cc852042c9 [gardening] Fix accidental trailing whitespace. 2016-10-29 10:22:58 +02:00
Andrew Trick
9c729e4c0c SE-0138: UnsafeRawBufferPointer revision.
The withUnsafeMutableBytes closure argument should not be `inout`.

Improve testing, fix comments.

Addresses DaveA's review.
2016-09-25 19:56:21 -07:00
Dmitri Gribenko
243a35cd65 Migrate callsites from 'expectEmpty()' to 'expectNil()' 2016-09-10 20:05:42 -07:00
Xiaodi Wu
f9435b9ce8 [stdlib] Restore MemoryLayout.*(ofValue:) 2016-08-08 10:46:37 -05:00
Dmitri Gribenko
987acd375d stdlib: make tests rely on Array implementation details less 2016-08-07 14:20:36 -07:00
Jordan Rose
f42158b12e Revert "[Sema] ban multi-arguments to tuple coercion" (#3922)
It breaks cases where there really is a single unlabeled argument of tuple type, like this:

  let pairs = [(1, "A"), (2, "B")]
  print(pairs.map { $0.0 })
2016-08-01 19:22:19 -07:00
Daniel Duan
c9b73dacc2 [Sema] ban multi-arguments to tuple coercion
Implements part of SE-0110. Single argument in closures will not be accepted if
there exists explicit type with a number of arguments that's not 1.

```swift
let f: (Int, Int) -> Void = { x in } // this is now an error
```

Note there's a second part of SE-0110 which could be considered additive,
which says one must add an extra pair of parens to specify a single arugment
type that is a tuple:

```swift
let g ((Int, Int)) -> Void = { y in } // y should have type (Int, Int)
```

This patch does not implement that part.
2016-07-31 16:22:57 -07:00
Dmitri Gribenko
bb6c6740ca stdlib: fix a bug in ArraySlice.removeLast() when startIndex != 0
ArraySlice.removeLast() only worked when startIndex was equal to zero.

This change fixes the bug, and uses the proper customization point for
the algorithm.

Fixes SR-1791, rdar://problem/26897658.
2016-07-31 02:04:23 -07:00
Rintaro Ishizaki
c6f4bcd01e [SE-0101] MemoryLayout: Migrate testsuite and benchmarks 2016-07-30 03:11:45 +09:00
Andrew Trick
a18d490d6a Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3773)
* Migrate from `UnsafePointer<Void>` to `UnsafeRawPointer`.

As proposed in SE-0107: UnsafeRawPointer.

`void*` imports as `UnsafeMutableRawPointer`.
`const void*` imports as `UnsafeRawPointer`.

Occurrences of `UnsafePointer<Void>` are replaced with UnsafeRawPointer.

* Migrate overlays from UnsafePointer<Void> to UnsafeRawPointer.

This requires explicit memory binding in several places,
particularly in NSData and CoreAudio.

* Fix a bunch of test cases for Void->Raw migration.

* qsort takes IUO values

* Bridge `Unsafe[Mutable]RawPointer as `void [const] *`.

* Parse #dsohandle as UnsafeMutableRawPointer

* Update a bunch of test cases for Void->Raw migration.

* Trivial fix for the SceneKit test case.

* Add an UnsafeRawPointer self initializer.

This is unfortunately necessary for assignment between types imported from C.

* Tiny simplification of the initializer.
2016-07-26 14:21:15 -07:00
Andrew Trick
0ed9ee8dee Revert "Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3724)"
This reverts commit ece0951924.

This results in lldb failues on linux that I can't readily debug.
Backing out until they can be resolved.
2016-07-26 02:50:57 -07:00
Andrew Trick
ece0951924 Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3724)
* Migrate from `UnsafePointer<Void>` to `UnsafeRawPointer`.

As proposed in SE-0107: UnsafeRawPointer.

`void*` imports as `UnsafeMutableRawPointer`.
`const void*` imports as `UnsafeRawPointer`.

Occurrences of `UnsafePointer<Void>` are replaced with UnsafeRawPointer.

* Migrate overlays from UnsafePointer<Void> to UnsafeRawPointer.

This requires explicit memory binding in several places,
particularly in NSData and CoreAudio.

* Fix a bunch of test cases for Void->Raw migration.

* qsort takes IUO values

* Bridge `Unsafe[Mutable]RawPointer as `void [const] *`.

* Parse #dsohandle as UnsafeMutableRawPointer

* Update a bunch of test cases for Void->Raw migration.

* Trivial fix for the SceneKit test case.

* Add an UnsafeRawPointer self initializer.

This is unfortunately necessary for assignment between types imported from C.

* Tiny simplification of the initializer.
2016-07-26 02:18:21 -07:00
Dmitri Gribenko
824bccc871 stdlib: change Collection._copyToNativeArrayBuffer() to be defined in terms of public types 2016-07-11 10:54:43 -07:00
Chris Lattner
87db7b4cf2 update validation tests to modern syntax. 2016-07-02 17:10:49 -07:00
rintaro ishizaki
4b51d85abb [test] Add %target-run-simple-swiftgyb
* Utilize %target-run-simple-swiftgyb where possible
2016-06-15 11:49:44 +09:00
Rintaro Ishizaki
1bdce7ced6 [lit] Add substitutions: %utils and %line-directive
%utils => ${SWIFT_SOURCE_DIR}/utils
%line-directive => ${SWIFT_SOURCE_DIR}/utils/line-directive
2016-06-11 02:41:15 +09:00
Trent Nadeau
b9db36cda5 Removed last uses of @warn_unused_result 2016-06-06 19:12:51 -04:00
Dave Abrahams
0d68b3a4af [stdlib] Generate RandomAccessCollection defaults
The defaults we were generating for Collection and
BidirectionalCollection didn't make any sense, because if you could do
that strideable arithmetic then you essentially had random access.
Instead we constrain the defaults to apply to RandomAccessCollection
where the Indices are a CountableRange.
2016-05-02 11:35:32 -07:00
Dave Abrahams
9bee5d182f [stdlib] location/formLocation => index/formIndex 2016-04-26 17:46:16 -07:00
Dmitri Gribenko
54d81b6633 Rewrite tests for _copyToNativeArrayBuffer() default implementations to use StdlibCollectionUnittest infrastructure 2016-04-21 18:31:31 -07:00
Dave Abrahams
47a870cc50 [stdlib] Use location/formLocation for all index movement 2016-04-21 17:13:41 -07:00