Skip to content

Commit

Permalink
Merge changes from v0.2.5.x back into master branch prior to release …
Browse files Browse the repository at this point in the history
…of version 1.0.
  • Loading branch information
cpsusie committed Aug 18, 2021
1 parent cd14b7e commit 0146464
Show file tree
Hide file tree
Showing 61 changed files with 1,115 additions and 2,069 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,4 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/
/DotNetVault/packages.config
7 changes: 7 additions & 0 deletions CafeBabeGame/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[*.cs]

# DotNetVault_EarlyDisposeJustification: Justification for early dispose of LockedResourceObject
dotnet_diagnostic.DotNetVault_EarlyDisposeJustification.severity = error

# DotNetVault_ReportWhiteLists: Report on location of Whitelist files
dotnet_diagnostic.DotNetVault_ReportWhiteLists.severity = error
4 changes: 2 additions & 2 deletions CafeBabeGame/CafeBabeGame/CafeBabeGame.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DotNetVault" Version="0.2.5.7-alpha" />
<PackageReference Include="HighPrecisionTimeStamps" Version="0.1.0" />
<PackageReference Include="DotNetVault" Version="0.9.9-alpha" />
<PackageReference Include="HighPrecisionTimeStamps" Version="1.0.0" />
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
</ItemGroup>

Expand Down
2 changes: 2 additions & 0 deletions CafeBabeGame/CafeBabeGame/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

namespace CafeBabeGame
{
//Hi mom
//[ReportWhiteListLocations]
class Program
{
private static readonly IDeadBeefCafeGameFactory GameFactory = new DeadBeefCafeGameFactorySource().FactoryInstance;
Expand Down
5 changes: 3 additions & 2 deletions Clorton Game/ClortonGameDemo/ClortonGameDemo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DotNetVault" Version="0.2.5.3" />
<PackageReference Include="HighPrecisionTimeStamps" Version="0.0.1-alpha" />
<PackageReference Include="DotNetVault" Version="0.9.9-alpha" />
<PackageReference Include="HighPrecisionTimeStamps" Version="1.0.0" />
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
</ItemGroup>

</Project>
3 changes: 2 additions & 1 deletion Clorton Game/ClortonGameDemo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
using System.Threading;
using DotNetVault.ClortonGame;
using DotNetVault.Vaults;
using HpTimesStamps;
using HpTimeStamps;

namespace ClortonGameDemo
{
//[ReportWhiteListLocations]
class Program
{
private static IClortonGameFactory GameFactory { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions Clorton Game/ClortonGameDemo/TimeStampProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ sealed class HpTimeStampProvider : TimeStampProvider
public static HpTimeStampProvider CreateInstance()
=> new HpTimeStampProvider();

public override DateTime Now => HpTimesStamps.TimeStampSource.Now;
public override DateTime Now => HpTimeStamps.TimeStampSource.Now;
public override void Calibrate() =>
HpTimesStamps.TimeStampSource.Calibrate();
HpTimeStamps.TimeStampSource.Calibrate();

private HpTimeStampProvider() { }
}
Expand Down
4 changes: 2 additions & 2 deletions ConsoleStressTest/ConsoleStressTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DotNetVault" Version="0.2.5.7-alpha" />
<PackageReference Include="HighPrecisionTimeStamps" Version="0.1.0" />
<PackageReference Include="DotNetVault" Version="0.9.9-alpha" />
<PackageReference Include="HighPrecisionTimeStamps" Version="1.0.0" />
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
</ItemGroup>

Expand Down
1 change: 1 addition & 0 deletions ConsoleStressTest/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace ConsoleStressTest
{
//[ReportWhiteListLocations]
class Program
{
static Program() => TheResultText = new LocklessWriteOnce<string>();
Expand Down
Binary file added DotNetVault Description latest.docx
Binary file not shown.
Binary file not shown.
Binary file modified DotNetVault Description.pdf
Binary file not shown.
25 changes: 24 additions & 1 deletion DotNetVault.Test/AnalyzerYetAgainUnitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,18 @@ public class UnitTest : CodeFixVerifier
public void ValidateEmpty()
{
var test = @"";

VerifyCSharpDiagnostic(test);
}

[TestMethod]
public void ValidateWhiteListsReported()
{
var test = ResourceFiles.ReportWhiteListTestCases.ReportOnWhiteListsTestCase;
VerifyCSharpDiagnostic(test, col => col.Count() == 1,
dx => dx.Id == DotNetVaultAnalyzer.DotNetVault_ReportWhiteLists &&
dx.Severity == DiagnosticSeverity.Warning && !dx.IsSuppressed);
}

[TestMethod]
public void Bug76TestCase1()
{
Expand Down Expand Up @@ -584,6 +593,20 @@ public void AnalyzerNotHeldAgainstUnitTests()
VerifyCSharpDiagnostic(test);
}

[TestMethod]
public void NullableEnumNotHeldAgainstTest_1()
{
var test = ResourceFiles.Issue8TestCases.Issue8_TestCases;
VerifyCSharpDiagnostic(test);
}

[TestMethod]
public void ReadOnlyUnmanagedFieldWithWritableMembersOk()
{
var test = ResourceFiles.Issue8TestCases.Issue8TestCase2Similar;
VerifyCSharpDiagnostic(test);
}

[TestMethod]
public void EventArgsOkTest()
{
Expand Down
23 changes: 22 additions & 1 deletion DotNetVault.Test/DotNetVault.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
<Compile Remove="TestCases\ImmutableCollectionIsVaultSafe.cs" />
<Compile Remove="TestCases\ImmutableStructIsVaultSafe.cs" />
<Compile Remove="TestCases\ImmutableStructIsVsUnmanaged.cs" />
<Compile Remove="TestCases\Issue8TestCase2Similar.cs" />
<Compile Remove="TestCases\Issue8_TestCases.cs" />
<Compile Remove="TestCases\MethodInvokeSyntaxTests.cs" />
<Compile Remove="TestCases\MethodInvokeSyntaxTests_2.cs" />
<Compile Remove="TestCases\NdiMixedWithNotInlineNotOkCaseThree.cs" />
Expand All @@ -69,6 +71,7 @@
<Compile Remove="TestCases\QueryTestCases.cs" />
<Compile Remove="TestCases\RefStructAttributeTestsOk.cs" />
<Compile Remove="TestCases\RefStructAttrNotOkCase1.cs" />
<Compile Remove="TestCases\ReportOnWhiteListsTestCase.cs" />
<Compile Remove="TestCases\RoRegularNotARefStructCase2.cs" />
<Compile Remove="TestCases\SbAndUriBNotVaultSafe.cs" />
<Compile Remove="TestCases\ShouldTriggerDiagnosticBecauseNoUsing.cs" />
Expand All @@ -94,7 +97,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="HighPrecisionTimeStamps" Version="0.1.0" />
<PackageReference Include="HighPrecisionTimeStamps" Version="1.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down Expand Up @@ -142,6 +145,11 @@
<AutoGen>True</AutoGen>
<DependentUpon>EarlyReleaseTestCases.resx</DependentUpon>
</Compile>
<Compile Update="ResourceFiles\Issue8TestCases.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Issue8TestCases.resx</DependentUpon>
</Compile>
<Compile Update="ResourceFiles\NdiTestCases.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
Expand All @@ -157,6 +165,11 @@
<AutoGen>True</AutoGen>
<DependentUpon>RefStructAttributeTestCases.resx</DependentUpon>
</Compile>
<Compile Update="ResourceFiles\ReportWhiteListTestCases.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>ReportWhiteListTestCases.resx</DependentUpon>
</Compile>
<Compile Update="ResourceFiles\UsingMandatoryTestCases.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
Expand Down Expand Up @@ -233,6 +246,10 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>EarlyReleaseTestCases.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="ResourceFiles\Issue8TestCases.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Issue8TestCases.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="ResourceFiles\NdiTestCases.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>NdiTestCases.Designer.cs</LastGenOutput>
Expand All @@ -245,6 +262,10 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>RefStructAttributeTestCases.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="ResourceFiles\ReportWhiteListTestCases.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>ReportWhiteListTestCases.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="ResourceFiles\UsingMandatoryTestCases.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>UsingMandatoryTestCases.Designer.cs</LastGenOutput>
Expand Down
129 changes: 129 additions & 0 deletions DotNetVault.Test/ResourceFiles/Issue8TestCases.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0146464

Please sign in to comment.