From 8e35d79602e69290dadebbffa9ca911328c36f82 Mon Sep 17 00:00:00 2001 From: Matthijs ter Woord Date: Fri, 2 Oct 2015 19:39:56 +0200 Subject: [PATCH] Reading almost fixed. --- .../Cosmos.Compiler.Tests.Bcl.csproj | 1 + Tests/Cosmos.Compiler.Tests.Bcl/Kernel.cs | 1 + .../System/DelegatesTest.cs | 6 ++-- .../System/StringTest.cs | 16 ++++++++++ Tests/Cosmos.Kernel.Tests.Fat/Kernel.cs | 27 +++++++++-------- Tests/Cosmos.TestRunner/Program.cs | 30 ++++++++++--------- source/Cosmos.Common/.editorconfig | 2 ++ source/Cosmos.Common/Cosmos.Common.csproj | 7 +++++ .../Cosmos.Common/Extensions/ByteConverter.cs | 7 +++++ .../Properties/AssemblyInfo.cs | 1 + .../CustomImplementation/System/ObjectImpl.cs | 2 ++ .../Cosmos.System.Plugs/System/IO/FileImpl.cs | 8 +++-- .../Cosmos.System.Plugs/System/IO/PathImpl.cs | 15 ++++++++-- .../FileSystem/FAT/FatFileSystem.cs | 18 +++++------ source/Cosmos.System/FileSystem/FatHelpers.cs | 5 ++++ .../FileSystem/VFS/VFSManager.cs | 5 ++-- source/Cosmos.System/SentinelVFS.cs | 7 +++++ 17 files changed, 113 insertions(+), 45 deletions(-) create mode 100644 Tests/Cosmos.Compiler.Tests.Bcl/System/StringTest.cs create mode 100644 source/Cosmos.Common/.editorconfig diff --git a/Tests/Cosmos.Compiler.Tests.Bcl/Cosmos.Compiler.Tests.Bcl.csproj b/Tests/Cosmos.Compiler.Tests.Bcl/Cosmos.Compiler.Tests.Bcl.csproj index da5b0cd84..a23c7aced 100644 --- a/Tests/Cosmos.Compiler.Tests.Bcl/Cosmos.Compiler.Tests.Bcl.csproj +++ b/Tests/Cosmos.Compiler.Tests.Bcl/Cosmos.Compiler.Tests.Bcl.csproj @@ -46,6 +46,7 @@ + diff --git a/Tests/Cosmos.Compiler.Tests.Bcl/Kernel.cs b/Tests/Cosmos.Compiler.Tests.Bcl/Kernel.cs index 2d932c702..722902bda 100644 --- a/Tests/Cosmos.Compiler.Tests.Bcl/Kernel.cs +++ b/Tests/Cosmos.Compiler.Tests.Bcl/Kernel.cs @@ -15,6 +15,7 @@ namespace Cosmos.Compiler.Tests.Bcl protected override void Run() { + System.StringTest.Execute(); System.Collections.Generic.ListTest.Execute(); System.Collections.Generic.QueueTest.Execute(); System.DelegatesTest.Execute(); diff --git a/Tests/Cosmos.Compiler.Tests.Bcl/System/DelegatesTest.cs b/Tests/Cosmos.Compiler.Tests.Bcl/System/DelegatesTest.cs index 5bfba9fe3..8760825c6 100644 --- a/Tests/Cosmos.Compiler.Tests.Bcl/System/DelegatesTest.cs +++ b/Tests/Cosmos.Compiler.Tests.Bcl/System/DelegatesTest.cs @@ -19,7 +19,7 @@ namespace Cosmos.Compiler.Tests.Bcl.System { mCount += 2; } - + public static void Execute() { TestDelegateWithoutArguments(); @@ -49,7 +49,7 @@ namespace Cosmos.Compiler.Tests.Bcl.System { mCount += number; } - + private static void TestDelegateWithArguments() { mCount = 0; @@ -64,4 +64,4 @@ namespace Cosmos.Compiler.Tests.Bcl.System Assert.AreEqual(3, mCount, "After calling delegate second time, Count != 3"); } } -} \ No newline at end of file +} diff --git a/Tests/Cosmos.Compiler.Tests.Bcl/System/StringTest.cs b/Tests/Cosmos.Compiler.Tests.Bcl/System/StringTest.cs new file mode 100644 index 000000000..e36319480 --- /dev/null +++ b/Tests/Cosmos.Compiler.Tests.Bcl/System/StringTest.cs @@ -0,0 +1,16 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using Cosmos.TestRunner; + +namespace Cosmos.Compiler.Tests.Bcl.System +{ + public static class StringTest + { + public static void Execute() + { + Assert.IsTrue(("a" + "b") == "ab", "concatting 2 string using + doesn't work"); + Assert.IsTrue(("a" + 'b') == "ab", "concatting 1 string and 1 character doesn't work"); + } + } +} diff --git a/Tests/Cosmos.Kernel.Tests.Fat/Kernel.cs b/Tests/Cosmos.Kernel.Tests.Fat/Kernel.cs index 49af7fe65..9f6aec7aa 100644 --- a/Tests/Cosmos.Kernel.Tests.Fat/Kernel.cs +++ b/Tests/Cosmos.Kernel.Tests.Fat/Kernel.cs @@ -25,21 +25,22 @@ namespace Cosmos.Kernel.Tests.Fat protected override void Run() { mDebugger.Send("Run"); - var xRoot = Path.GetPathRoot(@"0:\test"); - bool xTest = Directory.Exists("0:\\test"); - Console.WriteLine("After test"); - Assert.IsTrue(xTest, "Folder does not exist!"); + //var xRoot = Path.GetPathRoot(@"0:\test"); + //bool xTest = Directory.Exists("0:\\test"); + //Console.WriteLine("After test"); + //Assert.IsTrue(xTest, "Folder does not exist!"); - Console.WriteLine("Folder exists!"); - xTest = Directory.Exists("0:\\test\\DirInTest"); - Assert.IsTrue(xTest, "Subfolder doesn't exist!"); + //Console.WriteLine("Folder exists!"); + //xTest = Directory.Exists("0:\\test\\DirInTest"); + //Assert.IsTrue(xTest, "Subfolder doesn't exist!"); - xTest = File.Exists(@"0:\KudzU.txt"); - Assert.IsTrue(xTest, @"\Kudzu.txt not found!"); + //var xTest = File.Exists(@"0:\Kudzu.txt"); + //Assert.IsTrue(xTest, @"\Kudzu.txt not found!"); - Console.WriteLine("Kudzu.txt found!"); - Console.Write("File contents of Kudzu.txt: "); - Console.WriteLine(File.ReadAllText(@"0:\Kudzu.txt")); + mDebugger.Send("File contents of Kudzu.txt: "); + var xContents = File.ReadAllText(@"0:\Kudzu.txt"); + mDebugger.Send("Contents retrieved"); + mDebugger.Send(xContents); // File.WriteAllText(@"0:\Kudzu.txt", "Test FAT write."); // Console.WriteLine(File.ReadAllText(@"0:\Kudzu.txt")); @@ -57,4 +58,4 @@ namespace Cosmos.Kernel.Tests.Fat } } -} \ No newline at end of file +} diff --git a/Tests/Cosmos.TestRunner/Program.cs b/Tests/Cosmos.TestRunner/Program.cs index 2c340615f..7b8f01ab4 100644 --- a/Tests/Cosmos.TestRunner/Program.cs +++ b/Tests/Cosmos.TestRunner/Program.cs @@ -19,27 +19,29 @@ namespace Cosmos.TestRunner.Console DefaultEngineConfiguration.Apply(xEngine); - var xOutputXml = new OutputHandlerXml(); - xEngine.OutputHandler = new MultiplexingOutputHandler( - xOutputXml, - new OutputHandlerFullConsole()); + //var xOutputXml = new OutputHandlerXml(); + //xEngine.OutputHandler = new MultiplexingOutputHandler( + // xOutputXml, + // new OutputHandlerFullConsole()); + + xEngine.OutputHandler = new OutputHandlerFullConsole(); xEngine.Execute(); global::System.Console.WriteLine("Do you want to save test run details?"); global::System.Console.Write("Type yes, or nothing to just exit: "); var xResult = global::System.Console.ReadLine(); - if (xResult != null && xResult.Trim().Equals("yes", StringComparison.OrdinalIgnoreCase)) - { - var xSaveDialog = new SaveFileDialog(); - xSaveDialog.Filter = "XML documents|*.xml"; - if (xSaveDialog.ShowDialog() != DialogResult.OK) - { - return; - } + //if (xResult != null && xResult.Trim().Equals("yes", StringComparison.OrdinalIgnoreCase)) + //{ + // var xSaveDialog = new SaveFileDialog(); + // xSaveDialog.Filter = "XML documents|*.xml"; + // if (xSaveDialog.ShowDialog() != DialogResult.OK) + // { + // return; + // } - xOutputXml.SaveToFile(xSaveDialog.FileName); - } + // xOutputXml.SaveToFile(xSaveDialog.FileName); + //} } } } diff --git a/source/Cosmos.Common/.editorconfig b/source/Cosmos.Common/.editorconfig new file mode 100644 index 000000000..b0b9cee45 --- /dev/null +++ b/source/Cosmos.Common/.editorconfig @@ -0,0 +1,2 @@ +[Extensions/ByteConverter.cs] +indent_size = 2 diff --git a/source/Cosmos.Common/Cosmos.Common.csproj b/source/Cosmos.Common/Cosmos.Common.csproj index 1e4c1926f..ce5504f8b 100644 --- a/source/Cosmos.Common/Cosmos.Common.csproj +++ b/source/Cosmos.Common/Cosmos.Common.csproj @@ -85,8 +85,15 @@ + + + + {61607F1E-58F9-41CF-972F-128384F3E115} + Cosmos.Debug.Kernel + +