Correct a few more style/correctness issues.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon 2019-05-06 11:02:20 +01:00
parent 3d0e4250a0
commit 72932cf462
24 changed files with 131 additions and 46 deletions

View File

@ -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;

View File

@ -1,5 +1,8 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// <copyright file="AssemblyInfo.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following

View File

@ -1,4 +1,8 @@
namespace EightBit
// <copyright file="AbxTests.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
{
using Microsoft.VisualStudio.TestTools.UnitTesting;

View File

@ -1,4 +1,8 @@
namespace EightBit
// <copyright file="AdcTests.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
{
using Microsoft.VisualStudio.TestTools.UnitTesting;

View File

@ -1,4 +1,8 @@
namespace EightBit
// <copyright file="AddTests.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
{
using Microsoft.VisualStudio.TestTools.UnitTesting;

View File

@ -1,4 +1,8 @@
namespace EightBit
// <copyright file="AndTests.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
{
using Microsoft.VisualStudio.TestTools.UnitTesting;

View File

@ -1,4 +1,8 @@
namespace EightBit
// <copyright file="AslTests.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
{
using Microsoft.VisualStudio.TestTools.UnitTesting;

View File

@ -1,4 +1,8 @@
namespace EightBit
// <copyright file="AsrTests.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
{
using Microsoft.VisualStudio.TestTools.UnitTesting;

View File

@ -1,4 +1,8 @@
namespace EightBit
// <copyright file="BgtTests.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
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
}

View File

@ -1,4 +1,8 @@
namespace EightBit
// <copyright file="BhiTests.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
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]

View File

@ -1,4 +1,8 @@
namespace EightBit
// <copyright file="BitTests.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
{
using Microsoft.VisualStudio.TestTools.UnitTesting;

View File

@ -1,4 +1,8 @@
namespace EightBit
// <copyright file="BleTests.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
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
}

View File

@ -1,4 +1,8 @@
namespace EightBit
// <copyright file="Board.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
{
public sealed class Board : EightBit.Bus
{

View File

@ -1,4 +1,8 @@
namespace EightBit
// <copyright file="ClrTests.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
{
using Microsoft.VisualStudio.TestTools.UnitTesting;

View File

@ -1,4 +1,8 @@
namespace EightBit
// <copyright file="CmpTests.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
{
using Microsoft.VisualStudio.TestTools.UnitTesting;

View File

@ -1,4 +1,8 @@
namespace EightBit
// <copyright file="DecTests.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
{
using Microsoft.VisualStudio.TestTools.UnitTesting;

View File

@ -1,4 +1,8 @@
namespace EightBit
// <copyright file="IncTests.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
{
using Microsoft.VisualStudio.TestTools.UnitTesting;

View File

@ -1,9 +1,12 @@
namespace EightBit
// <copyright file="JsrTests.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
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
{

View File

@ -84,6 +84,7 @@
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<AdditionalFiles Include="stylecop.json" />
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />

View File

@ -1,3 +1,7 @@
// <copyright file="AssemblyInfo.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View File

@ -1,9 +1,12 @@
namespace EightBit
// <copyright file="RtsTests.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
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
{

View File

@ -1,4 +1,8 @@
namespace EightBit
// <copyright file="SbcTests.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
{
using Microsoft.VisualStudio.TestTools.UnitTesting;

View File

@ -1,4 +1,8 @@
namespace EightBit
// <copyright file="SubTests.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
{
using Microsoft.VisualStudio.TestTools.UnitTesting;

View File

@ -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"
}
}
}