Files
swift-atomics/Tests/AtomicsTests/Basics/BasicTestSupport.swift
T
Karoy Lorentey 8ca2dee2bf Split Basics.swift.gyb up into 26 different files
The original autogenerated swift file is so humongous that it causes problems for some folks.

Split it up into one file per XCTestCase.
2023-03-18 01:27:16 -07:00

49 lines
1.4 KiB
Swift

//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Atomics open source project
//
// Copyright (c) 2020-2023 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
import Atomics
extension Unmanaged: Equatable { // FIXME: This is terrible
public static func ==(left: Self, right: Self) -> Bool {
left.toOpaque() == right.toOpaque()
}
}
struct Foo: Equatable, CustomStringConvertible {
var value: Int
init(_ value: Int) { self.value = value }
var description: String { "Foo(\(value))" }
}
class Bar: Equatable, CustomStringConvertible {
var value: Int
init(_ value: Int) { self.value = value }
var description: String { "Bar(\(value))" }
static func ==(left: Bar, right: Bar) -> Bool {
left === right
}
}
final class Baz: Equatable, CustomStringConvertible, AtomicReference {
var value: Int
init(_ value: Int) { self.value = value }
var description: String { "Bar(\(value))" }
static func ==(left: Baz, right: Baz) -> Bool {
left === right
}
}
enum Fred: Int, AtomicValue {
case one
case two
}