WIP: segfault

This commit is contained in:
John Rommel Estropia
2016-07-20 08:12:04 +09:00
parent f486ace437
commit 267c21063a
129 changed files with 2205 additions and 3282 deletions

View File

@@ -40,26 +40,26 @@ final class OrderByTests: XCTestCase {
let orderBy = OrderBy()
XCTAssertEqual(orderBy, OrderBy([] as [NSSortDescriptor]))
XCTAssertNotEqual(orderBy, OrderBy(NSSortDescriptor(key: "key", ascending: false)))
XCTAssertNotEqual(orderBy, OrderBy(SortDescriptor(key: "key", ascending: false)))
XCTAssertTrue(orderBy.sortDescriptors.isEmpty)
}
do {
let sortDescriptor = NSSortDescriptor(key: "key1", ascending: true)
let sortDescriptor = SortDescriptor(key: "key1", ascending: true)
let orderBy = OrderBy(sortDescriptor)
XCTAssertEqual(orderBy, OrderBy(sortDescriptor))
XCTAssertEqual(orderBy, OrderBy(.Ascending("key1")))
XCTAssertNotEqual(orderBy, OrderBy(.Ascending("key2")))
XCTAssertNotEqual(orderBy, OrderBy(.Descending("key1")))
XCTAssertNotEqual(orderBy, OrderBy(NSSortDescriptor(key: "key1", ascending: false)))
XCTAssertNotEqual(orderBy, OrderBy(SortDescriptor(key: "key1", ascending: false)))
XCTAssertEqual(orderBy, OrderBy([sortDescriptor]))
XCTAssertEqual(orderBy.sortDescriptors, [sortDescriptor])
}
do {
let sortDescriptors = [
NSSortDescriptor(key: "key1", ascending: true),
NSSortDescriptor(key: "key2", ascending: false)
SortDescriptor(key: "key1", ascending: true),
SortDescriptor(key: "key2", ascending: false)
]
let orderBy = OrderBy(sortDescriptors)
XCTAssertEqual(orderBy, OrderBy(sortDescriptors))
@@ -68,8 +68,8 @@ final class OrderByTests: XCTestCase {
orderBy,
OrderBy(
[
NSSortDescriptor(key: "key1", ascending: false),
NSSortDescriptor(key: "key2", ascending: false)
SortDescriptor(key: "key1", ascending: false),
SortDescriptor(key: "key2", ascending: false)
]
)
)
@@ -80,7 +80,7 @@ final class OrderByTests: XCTestCase {
do {
let orderBy = OrderBy(.Ascending("key1"))
let sortDescriptor = NSSortDescriptor(key: "key1", ascending: true)
let sortDescriptor = SortDescriptor(key: "key1", ascending: true)
XCTAssertEqual(orderBy, OrderBy(sortDescriptor))
XCTAssertEqual(orderBy, OrderBy(.Ascending("key1")))
XCTAssertNotEqual(orderBy, OrderBy(.Descending("key1")))
@@ -92,8 +92,8 @@ final class OrderByTests: XCTestCase {
let orderBy = OrderBy(.Ascending("key1"), .Descending("key2"))
let sortDescriptors = [
NSSortDescriptor(key: "key1", ascending: true),
NSSortDescriptor(key: "key2", ascending: false)
SortDescriptor(key: "key1", ascending: true),
SortDescriptor(key: "key2", ascending: false)
]
XCTAssertEqual(orderBy, OrderBy(sortDescriptors))
XCTAssertEqual(orderBy, OrderBy(.Ascending("key1"), .Descending("key2")))
@@ -101,8 +101,8 @@ final class OrderByTests: XCTestCase {
orderBy,
OrderBy(
[
NSSortDescriptor(key: "key1", ascending: false),
NSSortDescriptor(key: "key2", ascending: false)
SortDescriptor(key: "key1", ascending: false),
SortDescriptor(key: "key2", ascending: false)
]
)
)
@@ -115,8 +115,8 @@ final class OrderByTests: XCTestCase {
let sortKeys: [SortKey] = [.Ascending("key1"), .Descending("key2")]
let orderBy = OrderBy(sortKeys)
let sortDescriptors = [
NSSortDescriptor(key: "key1", ascending: true),
NSSortDescriptor(key: "key2", ascending: false)
SortDescriptor(key: "key1", ascending: true),
SortDescriptor(key: "key2", ascending: false)
]
XCTAssertEqual(orderBy, OrderBy(sortDescriptors))
XCTAssertEqual(orderBy, OrderBy(.Ascending("key1"), .Descending("key2")))
@@ -124,8 +124,8 @@ final class OrderByTests: XCTestCase {
orderBy,
OrderBy(
[
NSSortDescriptor(key: "key1", ascending: false),
NSSortDescriptor(key: "key2", ascending: false)
SortDescriptor(key: "key1", ascending: false),
SortDescriptor(key: "key2", ascending: false)
]
)
)