From aa127d9a9f141e0157e7dc126737c9f690809bd3 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 13 Sep 2023 15:53:38 -0400 Subject: [PATCH] Add an empty 8088 suite test class. --- .../Clock Signal.xcodeproj/project.pbxproj | 4 ++ OSBindings/Mac/Clock SignalTests/8088Tests.mm | 57 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 OSBindings/Mac/Clock SignalTests/8088Tests.mm diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj index da9def458..eba4c39d0 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj +++ b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 423BDC4A2AB24699008E37B6 /* 8088Tests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 423BDC492AB24699008E37B6 /* 8088Tests.mm */; }; 4281683A2A37AFB4008ECD27 /* DispatcherTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 428168392A37AFB4008ECD27 /* DispatcherTests.mm */; }; 4B018B89211930DE002A3937 /* 65C02_extended_opcodes_test.bin in Resources */ = {isa = PBXBuildFile; fileRef = 4B018B88211930DE002A3937 /* 65C02_extended_opcodes_test.bin */; }; 4B01A6881F22F0DB001FD6E3 /* Z80MemptrTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B01A6871F22F0DB001FD6E3 /* Z80MemptrTests.swift */; }; @@ -1101,6 +1102,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 423BDC492AB24699008E37B6 /* 8088Tests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = 8088Tests.mm; sourceTree = ""; }; 4281572E2AA0334300E16AA1 /* Carry.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Carry.hpp; sourceTree = ""; }; 428168372A16C25C008ECD27 /* LineLayout.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = LineLayout.hpp; sourceTree = ""; }; 428168392A37AFB4008ECD27 /* DispatcherTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DispatcherTests.mm; sourceTree = ""; }; @@ -4273,6 +4275,7 @@ 4B90467222C6FA31000E2074 /* TestRunner68000.hpp */, 4BC62FF128A149300036AE59 /* NSData+dataWithContentsOfGZippedFile.m */, 4BDA7F8229C4EA28007A10A5 /* 6809OperationMapperTests.mm */, + 423BDC492AB24699008E37B6 /* 8088Tests.mm */, 4B04C898285E3DC800AA8FD6 /* 65816ComparativeTests.mm */, 4B90467522C6FD6E000E2074 /* 68000ArithmeticTests.mm */, 4B9D0C4A22C7D70900DE1AD3 /* 68000BCDTests.mm */, @@ -6077,6 +6080,7 @@ 4B778F0E23A5EC4F0000D260 /* Tape.cpp in Sources */, 4B778F2D23A5EF190000D260 /* MFMDiskController.cpp in Sources */, 4B7752C228217F5C0073E2C5 /* Spectrum.cpp in Sources */, + 423BDC4A2AB24699008E37B6 /* 8088Tests.mm in Sources */, 4B778F2723A5EEF60000D260 /* BinaryDump.cpp in Sources */, 4BFCA1241ECBDCB400AC40C1 /* AllRAMProcessor.cpp in Sources */, 4B778F5223A5F22F0000D260 /* StaticAnalyser.cpp in Sources */, diff --git a/OSBindings/Mac/Clock SignalTests/8088Tests.mm b/OSBindings/Mac/Clock SignalTests/8088Tests.mm new file mode 100644 index 000000000..904cf8da3 --- /dev/null +++ b/OSBindings/Mac/Clock SignalTests/8088Tests.mm @@ -0,0 +1,57 @@ +// +// 8088Tests.m +// Clock SignalTests +// +// Created by Thomas Harte on 13/09/2023. +// Copyright © 2023 Thomas Harte. All rights reserved. +// + +#import + +#include +#include + +#include +#include + +#include "NSData+dataWithContentsOfGZippedFile.h" + +namespace { + +// The tests themselves are not duplicated in this repository; +// provide their real path here. +constexpr char TestSuiteHome[] = "/Users/tharte/Projects/ProcessorTests/8088/v1"; + +} + +@interface i8088Tests : XCTestCase +@end + +@implementation i8088Tests + +- (NSArray *)testFiles { + NSString *path = [NSString stringWithUTF8String:TestSuiteHome]; + + NSArray *files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:nil]; + files = [files filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(NSString* evaluatedObject, NSDictionary *) { + return [evaluatedObject hasSuffix:@"json.gz"]; + }]]; + + NSMutableArray *fullPaths = [[NSMutableArray alloc] init]; + for(NSString *file in files) { + [fullPaths addObject:[path stringByAppendingPathComponent:file]]; + } + + return fullPaths; +} + +- (void)testDecoding { + for(NSString *file in [self testFiles]) { + NSData *data = [NSData dataWithContentsOfGZippedFile:file]; + NSArray *array = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil]; + NSLog(@"%@", array); + break; + } +} + +@end