Signal-iOS/Signal/test/util/MiscTest.swift
Evan Hahn a066511a62 Remove useless test setup/teardown
We had a lot of functions like this, which are useless:

    override func setUp() {
        super.setUp()
    }

This removes them.
2022-10-04 14:06:34 -07:00

18 lines
514 B
Swift

//
// Copyright (c) 2022 Open Whisper Systems. All rights reserved.
//
import XCTest
class MiscTest: SignalBaseTest {
func test_uintRotation() {
XCTAssertEqual(UInt(0b10), UInt(0b1).rotateLeft(1))
XCTAssertEqual(UInt(0b101000), UInt(0b101).rotateLeft(3))
// Max bit should wrap around.
XCTAssertTrue(UInt.highestBit > 0)
XCTAssertEqual(UInt(0b1), UInt.highestBit.rotateLeft(1))
XCTAssertEqual(UInt(0b11), (UInt.highestBit | UInt(0b1)).rotateLeft(1))
}
}