1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-02 20:30:00 +00:00
CLK/OSBindings/Mac/Clock SignalTests/MacGCRTests.mm

44 lines
1.0 KiB
Plaintext
Raw Normal View History

//
// MacGCRTests.mm
// Clock SignalTests
//
// Created by Thomas Harte on 15/06/2019.
// Copyright © 2019 Thomas Harte. All rights reserved.
//
#import <XCTest/XCTest.h>
#include "../../../Storage/Disk/Encodings/AppleGCR/Encoder.hpp"
@interface MacGCRTests : XCTestCase
@end
@implementation MacGCRTests {
}
- (void)testSector0Track0Side0 {
const auto header = Storage::Encodings::AppleGCR::Macintosh::header(0x22, 0, 0, false);
const std::vector<uint8_t> expected_mark = {
0xd5, 0xaa, 0x96,
0x96, 0x96, 0x96, 0xd9, 0xd9,
0xde, 0xaa, 0xeb
};
const auto mark_segment = Storage::Disk::PCMSegment(expected_mark);
XCTAssertEqual(mark_segment.data, header.data);
}
- (void)testSector9Track11Side1 {
const auto header = Storage::Encodings::AppleGCR::Macintosh::header(0x22, 11, 9, true);
const std::vector<uint8_t> expected_mark = {
0xd5, 0xaa, 0x96,
0xad, 0xab, 0xd6, 0xd9, 0x96,
0xde, 0xaa, 0xeb
};
const auto mark_segment = Storage::Disk::PCMSegment(expected_mark);
XCTAssertEqual(mark_segment.data, header.data);
}
@end