forked from CosmosOS/Cosmos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed keyboard interrupt, generics, and double.
- Loading branch information
1 parent
31e5c09
commit ef92828
Showing
19 changed files
with
528 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Reflection; | ||
using System.Resources; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("Package Name")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("Company")] | ||
[assembly: AssemblyProduct("Package Name")] | ||
[assembly: AssemblyCopyright("")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
[assembly: ComVisible(false)] | ||
[assembly: CLSCompliant(false)] | ||
[assembly: NeutralResourcesLanguage("en-US")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Revision and Build Numbers | ||
// by using the '*' as shown below: | ||
|
||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] | ||
|
||
|
||
|
63 changes: 63 additions & 0 deletions
63
Tests/Cosmos.Compiler.Tests.MethodTests/Cosmos.Compiler.Tests.MethodTests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> | ||
<ProductVersion>9.0.30729</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{FE8B9F39-7C96-4866-9A18-386735895CEE}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Cosmos.Compiler.Tests.MethodTests</RootNamespace> | ||
<AssemblyName>Cosmos.Compiler.Tests.MethodTests</AssemblyName> | ||
<FileAlignment>512</FileAlignment> | ||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> | ||
<DebugSymbols>true</DebugSymbols> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<DebugType>full</DebugType> | ||
<PlatformTarget>x86</PlatformTarget> | ||
<ErrorReport>prompt</ErrorReport> | ||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<Optimize>true</Optimize> | ||
<DebugType>pdbonly</DebugType> | ||
<PlatformTarget>x86</PlatformTarget> | ||
<ErrorReport>prompt</ErrorReport> | ||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="Cosmos.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983, processorArchitecture=MSIL" /> | ||
<Reference Include="Cosmos.HAL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983, processorArchitecture=MSIL" /> | ||
<Reference Include="Cosmos.System, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983, processorArchitecture=MSIL" /> | ||
<Reference Include="Cosmos.Debug.Kernel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983, processorArchitecture=MSIL" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="ReturnTests.cs" /> | ||
<Compile Include="Kernel.cs" /> | ||
<Compile Include="AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Cosmos.TestRunner.TestController\Cosmos.TestRunner.TestController.csproj"> | ||
<Project>{E6D3B644-C487-472D-A978-C1A82D0C099B}</Project> | ||
<Name>Cosmos.TestRunner.TestController</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
71 changes: 71 additions & 0 deletions
71
Tests/Cosmos.Compiler.Tests.MethodTests/Cosmos.Compiler.Tests.MethodTestsBoot.Cosmos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{0fee977d-ae52-4381-b513-71c5c1982ed4}</ProjectGuid> | ||
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging> | ||
<Name>Cosmos.Compiler.Tests.MethodTestsBoot</Name> | ||
<BinFormat>elf</BinFormat> | ||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> | ||
<Profile>Bochs</Profile> | ||
<!-- Looks like this was a mispelled attribute. Replaced by DebugEnabled below. | ||
<DebugEnable>true</DebugEnable> | ||
--> | ||
<DebugEnabled>true</DebugEnabled> | ||
<DebugMode>Source</DebugMode> | ||
<TraceMode>User</TraceMode> | ||
<EnableGDB>False</EnableGDB> | ||
<StartCosmosGDB>false</StartCosmosGDB> | ||
<VMWareEdition>Player</VMWareEdition> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<Name>Cosmos.Compiler.Tests.MethodTestsBoot</Name> | ||
<Description>Use Bochs emulator to deploy and debug.</Description> | ||
<Deployment>ISO</Deployment> | ||
<Launch>Bochs</Launch> | ||
<VisualStudioDebugPort>Pipe: Cosmos\Serial</VisualStudioDebugPort> | ||
<VMware_Name>Cosmos.Compiler.Tests.MethodTestsBoot</VMware_Name> | ||
<VMware_Description>Use VMware Player or Workstation to deploy and debug.</VMware_Description> | ||
<VMware_Deployment>ISO</VMware_Deployment> | ||
<VMware_Launch>VMware</VMware_Launch> | ||
<VMware_DebugEnabled>true</VMware_DebugEnabled> | ||
<VMware_DebugMode>Source</VMware_DebugMode> | ||
<VMware_VisualStudioDebugPort>Pipe: Cosmos\Serial</VMware_VisualStudioDebugPort> | ||
<VMware_VMwareEdition>Player</VMware_VMwareEdition> | ||
<VMware_OutputPath>bin\Debug\</VMware_OutputPath> | ||
<VMware_EnableGDB>False</VMware_EnableGDB> | ||
<VMware_StartCosmosGDB>false</VMware_StartCosmosGDB> | ||
<Bochs_Name>Cosmos.Compiler.Tests.MethodTestsBoot</Bochs_Name> | ||
<Bochs_Description>Use Bochs emulator to deploy and debug.</Bochs_Description> | ||
<Bochs_Deployment>ISO</Bochs_Deployment> | ||
<Bochs_Launch>Bochs</Bochs_Launch> | ||
<Bochs_DebugEnabled>true</Bochs_DebugEnabled> | ||
<Bochs_DebugMode>Source</Bochs_DebugMode> | ||
<Bochs_VisualStudioDebugPort>Pipe: Cosmos\Serial</Bochs_VisualStudioDebugPort> | ||
<Bochs_VMwareEdition>Player</Bochs_VMwareEdition> | ||
<Bochs_OutputPath>bin\Debug\</Bochs_OutputPath> | ||
<Bochs_EnableGDB>False</Bochs_EnableGDB> | ||
<Bochs_StartCosmosGDB>false</Bochs_StartCosmosGDB> | ||
<TraceAssemblies>Cosmos</TraceAssemblies> | ||
<Bochs_TraceAssemblies>Cosmos</Bochs_TraceAssemblies> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include=".\Cosmos.Compiler.Tests.MethodTests.csproj"> | ||
<Name>Cosmos.Compiler.Tests.MethodTests</Name> | ||
<Project>{fe8b9f39-7c96-4866-9a18-386735895cee}</Project> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Reference Include="Cosmos.Core.Plugs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" /> | ||
<Reference Include="Cosmos.System.Plugs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" /> | ||
<Reference Include="Cosmos.Debug.Kernel.Plugs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" /> | ||
</ItemGroup> | ||
<!--<ItemGroup> | ||
<Content Include="Cosmos.bxrc"> | ||
<SubType>Content</SubType> | ||
</Content> | ||
</ItemGroup>--> | ||
<Import Project="$(MSBuildExtensionsPath)\Cosmos\Cosmos.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Cosmos.TestRunner; | ||
using Sys = Cosmos.System; | ||
|
||
namespace Cosmos.Compiler.Tests.MethodTests | ||
{ | ||
public class Kernel : Sys.Kernel | ||
{ | ||
protected override void BeforeRun() | ||
{ | ||
Console.WriteLine("Cosmos booted successfully. Type a line of text to get it echoed back."); | ||
} | ||
|
||
protected override void Run() | ||
{ | ||
try | ||
{ | ||
ReturnTests.Execute(); | ||
TestController.Completed(); | ||
} | ||
catch (Exception E) | ||
{ | ||
Console.WriteLine("Exception"); | ||
Console.WriteLine(E.ToString()); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
using Cosmos.TestRunner; | ||
|
||
namespace Cosmos.Compiler.Tests.MethodTests | ||
{ | ||
public static class ReturnTests | ||
{ | ||
public static void Execute() | ||
{ | ||
int a = 0x1FFFFFFF; | ||
Assert.IsTrue(a == TestInt(a), "Int return value failed."); | ||
Assert.IsTrue(a == TestRefInt(ref a), "Int& return value failed."); | ||
|
||
uint b = 0x1FFFFFFF; | ||
Assert.IsTrue(b == TestUInt(b), "UInt return value failed."); | ||
Assert.IsTrue(b == TestRefUInt(ref b), "UInt& return value failed."); | ||
|
||
long c = 0x1FFFFFFF0FFFFFFF; | ||
Assert.IsTrue(c == TestLong(c), "Long return value failed."); | ||
Assert.IsTrue(c == TestRefLong(ref c), "Long& return value failed."); | ||
|
||
ulong d = 0x0FFFFFFF1FFFFFFF; | ||
Assert.IsTrue(d == TestULong(d), "ULong return value failed."); | ||
Assert.IsTrue(d == TestRefULong(ref d), "ULong& return value failed."); | ||
|
||
float e = 42.42f; | ||
Assert.IsTrue(e == TestSingle(e), "Single return value failed."); | ||
Assert.IsTrue(e == TestRefSingle(ref e), "Single& return value failed."); | ||
|
||
double f = 42.42; | ||
Assert.IsTrue(f == TestDouble(f), "Double return value failed."); | ||
Assert.IsTrue(f == TestRefDouble(ref f), "Double& return value failed."); | ||
|
||
string h = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | ||
Assert.IsTrue(h == TestString(h), "String return value failed."); | ||
Assert.IsTrue(h == TestRefString(ref h), "String& return value failed."); | ||
|
||
char i = 'A'; | ||
Assert.IsTrue(i == TestChar(i), "Char return value failed."); | ||
Assert.IsTrue(i == TestRefChar(ref i), "Char& return value failed."); | ||
} | ||
|
||
private static int TestRefInt(ref int a) | ||
{ | ||
int b = a; | ||
return b; | ||
} | ||
|
||
private static uint TestRefUInt(ref uint a) | ||
{ | ||
uint b = a; | ||
return b; | ||
} | ||
|
||
private static long TestRefLong(ref long a) | ||
{ | ||
long b = a; | ||
return b; | ||
} | ||
|
||
private static ulong TestRefULong(ref ulong a) | ||
{ | ||
ulong b = a; | ||
return b; | ||
} | ||
|
||
private static float TestRefSingle(ref float a) | ||
{ | ||
float b = a; | ||
return b; | ||
} | ||
|
||
private static double TestRefDouble(ref double a) | ||
{ | ||
double b = a; | ||
return b; | ||
} | ||
|
||
private static string TestRefString(ref string a) | ||
{ | ||
string b = a; | ||
return b; | ||
} | ||
|
||
private static char TestRefChar(ref char a) | ||
{ | ||
char b = a; | ||
return b; | ||
} | ||
|
||
private static int TestInt(int a) | ||
{ | ||
int b = a; | ||
return b; | ||
} | ||
|
||
private static uint TestUInt(uint a) | ||
{ | ||
uint b = a; | ||
return b; | ||
} | ||
|
||
private static long TestLong(long a) | ||
{ | ||
long b = a; | ||
return b; | ||
} | ||
|
||
private static ulong TestULong(ulong a) | ||
{ | ||
ulong b = a; | ||
return b; | ||
} | ||
|
||
private static float TestSingle(float a) | ||
{ | ||
float b = a; | ||
return b; | ||
} | ||
|
||
private static double TestDouble(double a) | ||
{ | ||
double b = a; | ||
return b; | ||
} | ||
|
||
private static string TestString(string a) | ||
{ | ||
string b = a; | ||
return b; | ||
} | ||
|
||
private static char TestChar(char a) | ||
{ | ||
char b = a; | ||
return b; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.