diff --git a/OSBindings/Mac/Clock SignalTests/8088Tests.mm b/OSBindings/Mac/Clock SignalTests/8088Tests.mm index 904cf8da3..49152082d 100644 --- a/OSBindings/Mac/Clock SignalTests/8088Tests.mm +++ b/OSBindings/Mac/Clock SignalTests/8088Tests.mm @@ -16,6 +16,8 @@ #include "NSData+dataWithContentsOfGZippedFile.h" +#include "../../../InstructionSets/x86/Decoder.hpp" + namespace { // The tests themselves are not duplicated in this repository; @@ -45,12 +47,30 @@ constexpr char TestSuiteHome[] = "/Users/tharte/Projects/ProcessorTests/8088/v1" return fullPaths; } +- (void)applyDecodingTest:(NSDictionary *)test { + using Decoder = InstructionSet::x86::Decoder; + Decoder decoder; + + NSArray *encoding = test[@"bytes"]; + std::pair stage; + for(NSNumber *number in encoding) { + const uint8_t next = [number intValue]; + stage = decoder.decode(&next, 1); + if(stage.first > 0) { + break; + } + } + + NSLog(@""); +} + - (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; + NSArray *testsInFile = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil]; + for(NSDictionary *test in testsInFile) { + [self applyDecodingTest:test]; + } } }