Skip to content

Commit 58b00dc

Browse files
authored
Fixing more unit tests (#142)
1 parent da9c46e commit 58b00dc

File tree

7 files changed

+125
-63
lines changed

7 files changed

+125
-63
lines changed

Tests/NFUnitTestSystemLib/UnitTestParseTests.cs

Lines changed: 77 additions & 57 deletions
Large diffs are not rendered by default.

Tests/NFUnitTestSystemLib/UnitTestTypeTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ public void Number_ToString_Test()
9494

9595
Assert.Equal("NaN", ((float)0f / 0f).ToString());
9696
Assert.Equal("Infinity", ((float)1f / 0f).ToString());
97-
Assert.Equal("-Infinity", ((float)-1f / 0f).ToString());
97+
Assert.Equal("-Infinity", ((float)(-1f / 0f)).ToString(),"float negative infinity test");
9898

9999
Assert.Equal("NaN", ((double)0f / 0f).ToString());
100100
Assert.Equal("Infinity", ((double)1f / 0f).ToString());
101-
Assert.Equal("-Infinity", ((double)-1f / 0f).ToString());
101+
Assert.Equal("-Infinity", double.NegativeInfinity.ToString(), "double negative infinity"); // ((double)1f / -0f).ToString());
102102

103103

104104
Assert.Equal("Da1x", (1).ToString("Da1x"));

nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@
221221
<Compile Include="..\nanoFramework.CoreLibrary\System\Void.cs" Link="System\Void.cs" />
222222
<Compile Include="..\nanoFramework.CoreLibrary\System\WeakReference.cs" Link="System\WeakReference.cs" />
223223
<Compile Include="..\nanoFramework.CoreLibrary\System\SpanByte.cs" Link="System\SpanByte.cs" />
224+
<Compile Include="..\nanoFramework.CoreLibrary\System\FormatException.cs" Link="System\FormatException.cs" />
224225
</ItemGroup>
225226
<ItemGroup>
226227
<NFMDP_PE_ExcludeClassByName Include="System.AttributeTargets">
@@ -396,7 +397,7 @@
396397
<None Include="..\nanoFramework.CoreLibrary\key.snk" />
397398
<None Include="packages.config" />
398399
</ItemGroup>
399-
<ItemGroup>
400+
<ItemGroup>
400401
<Folder Include="System\" />
401402
</ItemGroup>
402403
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets')" />
@@ -412,4 +413,4 @@
412413
</PropertyGroup>
413414
<Error Condition="!Exists('..\packages\Nerdbank.GitVersioning.3.4.194\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Nerdbank.GitVersioning.3.4.194\build\Nerdbank.GitVersioning.targets'))" />
414415
</Target>
415-
</Project>
416+
</Project>

nanoFramework.CoreLibrary/CoreLibrary.nfproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
<Compile Include="System\EventHandler.cs" />
108108
<Compile Include="System\Exception.cs" />
109109
<Compile Include="System\FlagsAttribute.cs" />
110+
<Compile Include="System\FormatException.cs" />
110111
<Compile Include="System\GC.cs" />
111112
<Compile Include="System\Globalization\CultureInfo.cs" />
112113
<Compile Include="System\Globalization\DateTimeFormat.cs" />

nanoFramework.CoreLibrary/System/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
[assembly: AssemblyProduct(".NET nanoFramework mscorlib")]
1414
[assembly: AssemblyCopyright("Copyright (c) .NET Foundation and Contributors")]
1515

16-
[assembly: AssemblyNativeVersion("100.5.0.9")]
16+
[assembly: AssemblyNativeVersion("100.5.0.10")]
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//
2+
// Copyright (c) .NET Foundation and Contributors
3+
// Portions Copyright (c) Microsoft Corporation. All rights reserved.
4+
// See LICENSE file in the project root for full license information.
5+
//
6+
namespace System
7+
{
8+
/// <summary>
9+
/// The exception that is thrown for invalid casting or explicit conversion.
10+
/// </summary>
11+
[Serializable]
12+
public class FormatException : SystemException
13+
{
14+
/// <summary>
15+
/// Initializes a new instance of the FormatException class.
16+
/// </summary>
17+
public FormatException()
18+
{
19+
}
20+
21+
/// <summary>
22+
/// Initializes a new instance of the FormatException class with a specified error message.
23+
/// </summary>
24+
/// <param name="message">The message that describes the error. </param>
25+
public FormatException(String message)
26+
: base(message)
27+
{
28+
}
29+
30+
/// <summary>
31+
/// Initializes a new instance of the FormatException class with a specified error message and a reference to the inner exception that is the cause of this exception.
32+
/// </summary>
33+
/// <param name="message">The error message that explains the reason for the exception. </param>
34+
/// <param name="innerException">The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. </param>
35+
public FormatException(String message, Exception innerException)
36+
: base(message, innerException)
37+
{
38+
}
39+
}
40+
}

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "1.10.4-preview.{height}",
3+
"version": "1.10.5-preview.{height}",
44
"assemblyVersion": {
55
"precision": "revision"
66
},

0 commit comments

Comments
 (0)