From 72932cf4626aa0f30d0a9f27382e884aefb3b6e3 Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Mon, 6 May 2019 11:02:20 +0100 Subject: [PATCH] Correct a few more style/correctness issues. Signed-off-by: Adrian Conlon --- EightBit/Register16.cs | 16 ---------------- MC6809/MC6809.Test/Properties/AssemblyInfo.cs | 7 +++++-- MC6809/MC6809.UnitTest/AbxTests.cs | 6 +++++- MC6809/MC6809.UnitTest/AdcTests.cs | 6 +++++- MC6809/MC6809.UnitTest/AddTests.cs | 6 +++++- MC6809/MC6809.UnitTest/AndTests.cs | 6 +++++- MC6809/MC6809.UnitTest/AslTests.cs | 6 +++++- MC6809/MC6809.UnitTest/AsrTests.cs | 6 +++++- MC6809/MC6809.UnitTest/BgtTests.cs | 10 +++++++--- MC6809/MC6809.UnitTest/BhiTests.cs | 12 ++++++++---- MC6809/MC6809.UnitTest/BitTests.cs | 6 +++++- MC6809/MC6809.UnitTest/BleTests.cs | 10 +++++++--- MC6809/MC6809.UnitTest/Board.cs | 6 +++++- MC6809/MC6809.UnitTest/ClrTests.cs | 6 +++++- MC6809/MC6809.UnitTest/CmpTests.cs | 6 +++++- MC6809/MC6809.UnitTest/DecTests.cs | 6 +++++- MC6809/MC6809.UnitTest/IncTests.cs | 6 +++++- MC6809/MC6809.UnitTest/JsrTests.cs | 7 +++++-- MC6809/MC6809.UnitTest/MC6809.UnitTest.csproj | 1 + .../Properties/AssemblyInfo.cs | 4 ++++ MC6809/MC6809.UnitTest/RtsTests.cs | 7 +++++-- MC6809/MC6809.UnitTest/SbcTests.cs | 6 +++++- MC6809/MC6809.UnitTest/SubTests.cs | 6 +++++- MC6809/MC6809.UnitTest/stylecop.json | 19 +++++++++++++++++++ 24 files changed, 131 insertions(+), 46 deletions(-) create mode 100644 MC6809/MC6809.UnitTest/stylecop.json diff --git a/EightBit/Register16.cs b/EightBit/Register16.cs index 358596d..fa3b013 100644 --- a/EightBit/Register16.cs +++ b/EightBit/Register16.cs @@ -65,26 +65,10 @@ namespace EightBit public ref byte High => ref this.high; - public static Register16 operator ++(Register16 value) => Increment(value); - - public static Register16 operator --(Register16 value) => Decrement(value); - public static bool operator ==(Register16 left, Register16 right) => left.Equals(right); public static bool operator !=(Register16 left, Register16 right) => !(left == right); - public static Register16 Increment(Register16 value) - { - ++value.Word; - return value; - } - - public static Register16 Decrement(Register16 value) - { - --value.Word; - return value; - } - public override bool Equals(object obj) { var rhs = obj as Register16; diff --git a/MC6809/MC6809.Test/Properties/AssemblyInfo.cs b/MC6809/MC6809.Test/Properties/AssemblyInfo.cs index 792e99e..6fc0516 100644 --- a/MC6809/MC6809.Test/Properties/AssemblyInfo.cs +++ b/MC6809/MC6809.Test/Properties/AssemblyInfo.cs @@ -1,5 +1,8 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/MC6809/MC6809.UnitTest/AbxTests.cs b/MC6809/MC6809.UnitTest/AbxTests.cs index 0d8c26b..1d4d779 100644 --- a/MC6809/MC6809.UnitTest/AbxTests.cs +++ b/MC6809/MC6809.UnitTest/AbxTests.cs @@ -1,4 +1,8 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/MC6809/MC6809.UnitTest/AdcTests.cs b/MC6809/MC6809.UnitTest/AdcTests.cs index ca1c461..f5d71fa 100644 --- a/MC6809/MC6809.UnitTest/AdcTests.cs +++ b/MC6809/MC6809.UnitTest/AdcTests.cs @@ -1,4 +1,8 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/MC6809/MC6809.UnitTest/AddTests.cs b/MC6809/MC6809.UnitTest/AddTests.cs index 029465a..5e8f8e1 100644 --- a/MC6809/MC6809.UnitTest/AddTests.cs +++ b/MC6809/MC6809.UnitTest/AddTests.cs @@ -1,4 +1,8 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/MC6809/MC6809.UnitTest/AndTests.cs b/MC6809/MC6809.UnitTest/AndTests.cs index 51b43ad..e9cdfda 100644 --- a/MC6809/MC6809.UnitTest/AndTests.cs +++ b/MC6809/MC6809.UnitTest/AndTests.cs @@ -1,4 +1,8 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/MC6809/MC6809.UnitTest/AslTests.cs b/MC6809/MC6809.UnitTest/AslTests.cs index d39667b..5ed96ee 100644 --- a/MC6809/MC6809.UnitTest/AslTests.cs +++ b/MC6809/MC6809.UnitTest/AslTests.cs @@ -1,4 +1,8 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/MC6809/MC6809.UnitTest/AsrTests.cs b/MC6809/MC6809.UnitTest/AsrTests.cs index f2eef0d..e97b1ca 100644 --- a/MC6809/MC6809.UnitTest/AsrTests.cs +++ b/MC6809/MC6809.UnitTest/AsrTests.cs @@ -1,4 +1,8 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/MC6809/MC6809.UnitTest/BgtTests.cs b/MC6809/MC6809.UnitTest/BgtTests.cs index a4073f1..68ea0d4 100644 --- a/MC6809/MC6809.UnitTest/BgtTests.cs +++ b/MC6809/MC6809.UnitTest/BgtTests.cs @@ -1,4 +1,8 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -14,10 +18,10 @@ this.board.Poke(0, 0x2e); // BGT this.board.Poke(1, 0x03); - this.board.Poke(2, 0x86); // LDA #1 + this.board.Poke(2, 0x86); // LDA #1 this.board.Poke(3, 0x01); this.board.Poke(4, 0x12); // NOP - this.board.Poke(5, 0x86); // LDA #2 + this.board.Poke(5, 0x86); // LDA #2 this.board.Poke(6, 0x02); this.board.Poke(7, 0x12); // NOP } diff --git a/MC6809/MC6809.UnitTest/BhiTests.cs b/MC6809/MC6809.UnitTest/BhiTests.cs index d8fd938..8d12032 100644 --- a/MC6809/MC6809.UnitTest/BhiTests.cs +++ b/MC6809/MC6809.UnitTest/BhiTests.cs @@ -1,4 +1,8 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -14,12 +18,12 @@ this.board.Poke(0, 0x22); // BHI this.board.Poke(1, 0x03); - this.board.Poke(2, 0x86); // LDA #1 + this.board.Poke(2, 0x86); // LDA #1 this.board.Poke(3, 0x01); this.board.Poke(4, 0x12); // NOP - this.board.Poke(5, 0x86); // LDA #2 + this.board.Poke(5, 0x86); // LDA #2 this.board.Poke(6, 0x02); - this.board.Poke(7, 0x12); // NOP + this.board.Poke(7, 0x12); // NOP } [TestInitialize] diff --git a/MC6809/MC6809.UnitTest/BitTests.cs b/MC6809/MC6809.UnitTest/BitTests.cs index 16998f5..902c0ab 100644 --- a/MC6809/MC6809.UnitTest/BitTests.cs +++ b/MC6809/MC6809.UnitTest/BitTests.cs @@ -1,4 +1,8 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/MC6809/MC6809.UnitTest/BleTests.cs b/MC6809/MC6809.UnitTest/BleTests.cs index 8ed512f..d2a3168 100644 --- a/MC6809/MC6809.UnitTest/BleTests.cs +++ b/MC6809/MC6809.UnitTest/BleTests.cs @@ -1,4 +1,8 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -14,10 +18,10 @@ this.board.Poke(0, 0x2f); // BLE this.board.Poke(1, 0x03); - this.board.Poke(2, 0x86); // LDA #1 + this.board.Poke(2, 0x86); // LDA #1 this.board.Poke(3, 0x01); this.board.Poke(4, 0x12); // NOP - this.board.Poke(5, 0x86); // LDA #2 + this.board.Poke(5, 0x86); // LDA #2 this.board.Poke(6, 0x02); this.board.Poke(7, 0x12); // NOP } diff --git a/MC6809/MC6809.UnitTest/Board.cs b/MC6809/MC6809.UnitTest/Board.cs index 6c1cc40..40e3e07 100644 --- a/MC6809/MC6809.UnitTest/Board.cs +++ b/MC6809/MC6809.UnitTest/Board.cs @@ -1,4 +1,8 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { public sealed class Board : EightBit.Bus { diff --git a/MC6809/MC6809.UnitTest/ClrTests.cs b/MC6809/MC6809.UnitTest/ClrTests.cs index 30cb809..f7b3533 100644 --- a/MC6809/MC6809.UnitTest/ClrTests.cs +++ b/MC6809/MC6809.UnitTest/ClrTests.cs @@ -1,4 +1,8 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/MC6809/MC6809.UnitTest/CmpTests.cs b/MC6809/MC6809.UnitTest/CmpTests.cs index 56398e8..2f1c17e 100644 --- a/MC6809/MC6809.UnitTest/CmpTests.cs +++ b/MC6809/MC6809.UnitTest/CmpTests.cs @@ -1,4 +1,8 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/MC6809/MC6809.UnitTest/DecTests.cs b/MC6809/MC6809.UnitTest/DecTests.cs index 58c6b3b..97a96d4 100644 --- a/MC6809/MC6809.UnitTest/DecTests.cs +++ b/MC6809/MC6809.UnitTest/DecTests.cs @@ -1,4 +1,8 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/MC6809/MC6809.UnitTest/IncTests.cs b/MC6809/MC6809.UnitTest/IncTests.cs index b5e71a4..b92cf36 100644 --- a/MC6809/MC6809.UnitTest/IncTests.cs +++ b/MC6809/MC6809.UnitTest/IncTests.cs @@ -1,4 +1,8 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/MC6809/MC6809.UnitTest/JsrTests.cs b/MC6809/MC6809.UnitTest/JsrTests.cs index 0015f6f..bd06403 100644 --- a/MC6809/MC6809.UnitTest/JsrTests.cs +++ b/MC6809/MC6809.UnitTest/JsrTests.cs @@ -1,9 +1,12 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { using Microsoft.VisualStudio.TestTools.UnitTesting; // https://github.com/sorenroug/osnine-java/blob/master/core/src/test/java/org/roug/osnine/BranchAndJumpTest.java - [TestClass] public class JsrTests { diff --git a/MC6809/MC6809.UnitTest/MC6809.UnitTest.csproj b/MC6809/MC6809.UnitTest/MC6809.UnitTest.csproj index 90bd5f5..bb1cc09 100644 --- a/MC6809/MC6809.UnitTest/MC6809.UnitTest.csproj +++ b/MC6809/MC6809.UnitTest/MC6809.UnitTest.csproj @@ -84,6 +84,7 @@ + diff --git a/MC6809/MC6809.UnitTest/Properties/AssemblyInfo.cs b/MC6809/MC6809.UnitTest/Properties/AssemblyInfo.cs index 2affe5e..7217ec4 100644 --- a/MC6809/MC6809.UnitTest/Properties/AssemblyInfo.cs +++ b/MC6809/MC6809.UnitTest/Properties/AssemblyInfo.cs @@ -1,3 +1,7 @@ +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/MC6809/MC6809.UnitTest/RtsTests.cs b/MC6809/MC6809.UnitTest/RtsTests.cs index b59a4d1..e2d9b3c 100644 --- a/MC6809/MC6809.UnitTest/RtsTests.cs +++ b/MC6809/MC6809.UnitTest/RtsTests.cs @@ -1,9 +1,12 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { using Microsoft.VisualStudio.TestTools.UnitTesting; // https://github.com/sorenroug/osnine-java/blob/master/core/src/test/java/org/roug/osnine/BranchAndJumpTest.java - [TestClass] public class RtsTests { diff --git a/MC6809/MC6809.UnitTest/SbcTests.cs b/MC6809/MC6809.UnitTest/SbcTests.cs index 9334a0f..02a7f26 100644 --- a/MC6809/MC6809.UnitTest/SbcTests.cs +++ b/MC6809/MC6809.UnitTest/SbcTests.cs @@ -1,4 +1,8 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/MC6809/MC6809.UnitTest/SubTests.cs b/MC6809/MC6809.UnitTest/SubTests.cs index 8f87b38..5aead4c 100644 --- a/MC6809/MC6809.UnitTest/SubTests.cs +++ b/MC6809/MC6809.UnitTest/SubTests.cs @@ -1,4 +1,8 @@ -namespace EightBit +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace EightBit { using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/MC6809/MC6809.UnitTest/stylecop.json b/MC6809/MC6809.UnitTest/stylecop.json new file mode 100644 index 0000000..3af08b4 --- /dev/null +++ b/MC6809/MC6809.UnitTest/stylecop.json @@ -0,0 +1,19 @@ +{ + // ACTION REQUIRED: This file was automatically added to your project, but it + // will not take effect until additional steps are taken to enable it. See the + // following page for additional information: + // + // https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/EnableConfiguration.md + + "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", + "settings": { + "documentationRules": { + "documentInterfaces": false, + "documentExposedElements": false, + "documentInternalElements": false, + "documentPrivateElements": false, + "documentPrivateFields": false, + "companyName": "Adrian Conlon" + } + } +}