Commit Graph

1202 Commits

Author SHA1 Message Date
Dmitri Gribenko
55fa27008f StdlibCollectionUnittest: remove dead code
None of the minimal or defaulted collections raise expectation failures
when indexed out of bounds.  This idea seemed to be good on the surface,
but turned out not that nice or useful in practice.
2016-04-06 22:31:41 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Dave Abrahams
5864117b1b [stdlib] De-underscore Range.init(uncheckedBounds:) 2016-04-06 09:20:30 -07:00
Dave Abrahams
db03708a3d [stdlib] De-underscore Range protocols
There's really no excuse for keeping these hidden; they appear in public
APIs.
2016-04-05 16:32:15 -07:00
Dmitri Gribenko
0bab6fc461 StdlibUnittest: add a doc comment to LifetimeTracked, and remove a fixme 2016-04-05 15:39:30 -07:00
Slava Pestov
11cff083d8 StdlibUnittest: Add a default case to a switch over a resilient enum
I'm not completely satisfied with this fix because we get a compiler
warning when compiling without -enable-resilience. Perhaps we need
a policy change that a default case in a switch only generates a
warning if the enum is *explicitly* @_fixed_layout (or eventually,
@closed or however this attribute ends up being written).
2016-04-05 00:28:34 -07:00
Dmitri Gribenko
9c392bfdcb StdlibCollectionUnittest: generalize MutableCollection.SubSequence.subscript(_: Range)/Set tests 2016-04-04 18:38:11 -07:00
Dmitri Gribenko
0a0825d18d Merge pull request #1972 from apple/StdlibUnittest-make-classes-final
StdlibUnittest: make TestSuite and other helper classes final
2016-04-04 15:10:46 -07:00
Dmitri Gribenko
6985b958fd Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-04 11:42:17 -07:00
Dmitri Gribenko
b34c419a5e StdlibCollectionUnittest: implement fast index(_:stepsFrom:) entry points in minimal collections 2016-04-04 10:46:57 -07:00
practicalswift
abfecfde17 [gardening] if ([space]…[space]) → if (…), for(…) → for (…), while(…) → while (…), [[space]x, y[space]] → [x, y] 2016-04-04 16:22:11 +02:00
Dmitri Gribenko
ffc0cab597 StdlibCollectionUnittest: remove two slow tests 2016-04-01 23:05:55 -07:00
Dmitri Gribenko
e43e25e3b7 StdlibUnittest: add optimized overloads for expectEqualsUnordered() 2016-04-01 23:05:19 -07:00
Dmitri Gribenko
a53fb16591 StdlibCollectionUnittest: use parameterized tests for out-of-range subscript tests
This change decreases the testing time a little bit.
2016-04-01 14:14:58 -07:00
Dmitri Gribenko
8891f437c9 StdlibCollectionUnittest: remove some redundant range checks to speed up tests 2016-04-01 14:14:57 -07:00
Dmitri Gribenko
69e921a36f StdlibUnittest: implement slice subscript writeback in minimal collections 2016-04-01 14:14:57 -07:00
Dmitri Gribenko
f784fd9a08 StdlibUnittest: fix infinite recursion in range checking in minimal collections 2016-04-01 14:14:57 -07:00
Dmitri Gribenko
067b244c3f StdlibCollectionUnittest: stricter range checking in minimal collections 2016-04-01 14:12:19 -07:00
Dmitri Gribenko
2b9737cc9c StdlibCollectionUnittest: implement out-of-range tests for slicing subscript 2016-04-01 14:12:18 -07:00
Dmitri Gribenko
6477740cda StdlibCollectionUnittest: share data sets between out-of-bounds and slicing tests 2016-04-01 14:12:18 -07:00
Dmitri Gribenko
bad2ff1bb7 StdlibUnittest: add assertions for range checks 2016-04-01 14:12:17 -07:00
Max Moiseev
171169b01f [stdlib][swift-3-indexing-model] fixing Arrays tests 2016-04-01 14:12:17 -07:00
Dmitri Gribenko
5b2527ebb1 stdlib: make _writeBackMutableSlice() callable from StdlibCollectionUnittest 2016-04-01 14:12:16 -07:00
Dmitri Gribenko
340f464b6d StdlibCollectionUnittest: rename methods for consistency 2016-04-01 14:12:15 -07:00
Dmitri Gribenko
5a12349e9c Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-01 14:12:13 -07:00
Max Moiseev
97f06a09a7 [stdlib][swift-3-indexing-model] removing Strideable requirement for checkBidirectionalCollection 2016-04-01 14:11:54 -07:00
Dmitri Gribenko
8fbe94fe01 New indexing model: make validation-test/stdlib/CollectionType.swift.gyb compile (but not pass yet) 2016-04-01 14:11:53 -07:00
Dmitri Gribenko
629a941130 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-01 14:11:51 -07:00
Slava Pestov
49c54870c1 Serialization: Auto-linking recursively walks modules imported from -sil-serialize-all modules 2016-04-01 12:21:36 -07:00
Dmitri Gribenko
f782cba799 StdlibUnittest: fix a compiler warning 2016-03-31 09:52:28 -07:00
Dmitri Gribenko
66808b96b9 StdlibUnittest: correct precondition() message 2016-03-31 09:28:01 -07:00
Dmitri Gribenko
27e2f7f6d9 StdlibUnittest: new feature: data-parameterized tests 2016-03-31 00:50:10 -07:00
Dmitri Gribenko
cd4b963d40 StdlibUnittest: use 'Array.append(Element)' instead of 'Array += Array' 2016-03-30 21:03:24 -07:00
Dmitri Gribenko
76083bb1f3 StdlibUnittest: make TestSuite and other helper classes final
These classes are not meant to be subclassed.
2016-03-30 20:46:21 -07:00
swift-ci
5e6f4cf252 Merge pull request #1939 from tinysun212/pr-portable-random 2016-03-30 15:43:14 -07:00
Han Sangjin
5c1854bfcf stdlib: Portable random function
Changed rand32() implementation using a random engine in C++11 <random>.
2016-03-31 04:39:46 +09:00
Dmitri Gribenko
bd9e855e5b StdlibCollectionUnittest: make it work with new slice types, and add more test cases 2016-03-29 17:22:52 -07:00
Dmitri Gribenko
f065fde8e8 New indexing model: StdlibCollectionUnittest: rename methods for consistency 2016-03-29 16:35:32 -07:00
Max Moiseev
c93fcb98ae [stdlib][swift-3-indexing-model] fixing Concatenate tests
The 'reversed' tests are marked as XFAILing, because required methods
are not implemented on `ReversedCollection`.
2016-03-29 14:56:22 -07:00
Max Moiseev
b30a550801 [stdlib][swift-3-indexing-model] Fixing checkCollection functions 2016-03-29 14:56:21 -07:00
Oleksandr Tymoshenko
12dd0755af Fix build on FreeBSD
On FreBSD pthread_t and posix_spawn_file_actions_t are opaque pointers
so they should be initialized with nil as on Darwin
2016-03-29 11:49:34 -07:00
Dave Abrahams
8e4f85277b Merge remote-tracking branch 'refs/remotes/origin/master' into merge 2016-03-29 09:19:34 -07:00
Dave Abrahams
a5c3c63c3d [stdlib] Indexing model: nix RangeOfStrideable
Instead, use CountableRange which is constrained to have a Strideable
Bound whose Stride conforms to Integer.
2016-03-28 17:06:09 -07:00
David Farler
5ea5bb06a3 Split swift-refleciton-test into host and target test targets
swift-reflection-test is now the test that forks a swift executable
and performs remote reflection, making it runnable on other targets,
such as the iOS simulator.

swift-reflection-dump is now a host-side tool that dumps the remote
reflection sections for any platform binary and will continue to
link in LLVM object file support.

This necessitates finally moving lib/Refleciton into stdlib/public,
since we're linking target-specific versions of the test tool and
we would eventually like to adopt some of this functionality in
the runtime anyway.
2016-03-28 16:34:44 -07:00
Dave Abrahams
da5c4036ac func index(n: IndexDistance, stepsFrom i: Index)
M-x findr-query-replace

\<func advance(\([^(),]*\|[^(),]+([^()]*)[^(),]*\)\(,[
]*\)by \([^(),]*\|[^(),]+([^()]*)[^(),]*\)

func index(\3\2stepsFrom \1
2016-03-28 13:23:04 -07:00
Dave Abrahams
81d3e8ca83 limit: => limitedBy:, pt 2
M-x findr-query-replace

\<limit: \([^(),]*\|[^(),]+([^()]*)[^(),]*\))\( *\(?:[^ -]\|-[^>]\)\)

limitedBy: \1)\2
2016-03-28 13:12:02 -07:00
Dave Abrahams
4d651f8fc0 limit: => limitedBy:, pt 1
M-x findr-query-replace

\(,[
]*\)limit: \([^(),]*\|[^(),]+([^()]*)[^(),]*\)) ->

\1limitedBy limit: \2) ->
2016-03-28 13:03:59 -07:00
Dave Abrahams
01127b32d5 index(n, stepsFrom: i)
M-x findr-query-replace

\<advance(\([^:]+?\),\([
]+\)by: *\([^(),]*\|[^(),]+([^()]*)[^(),]*\)\(,\(?:[
]+\)limit: *\(?:[^()]*\|[^()]+([^()]*)[^()]*\)\)?)

index(\3,\2stepsFrom: \1\4)
2016-03-25 17:54:39 -07:00
David Farler
aa310cf0a7 Rename SwiftReflectionTest Cmake target to swiftSwiftReflectionTest
It appears a little redundant but this follows the convention of the
other private stdlib library targets, where "SwiftReflectionTest" is
the module name, so it should be included in the target name.
2016-03-25 13:33:16 -07:00
Dmitri Gribenko
2a66514058 CMake: SwiftReflectionTest depends on Darwin 2016-03-25 11:38:45 -07:00