Skip to content

Commit 0a06f9b

Browse files
committed
Mark assembly as not-a-test-proj and deal with copilation issues
1 parent 1872454 commit 0a06f9b

17 files changed

Lines changed: 31 additions & 30 deletions

src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Microsoft.Diagnostics.DataContractReader.Abstractions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework>
4+
<TargetFramework>$(NetMinimum)</TargetFramework>
55
<RootNamespace>Microsoft.Diagnostics.DataContractReader</RootNamespace>
66
<Nullable>enable</Nullable>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Microsoft.Diagnostics.DataContractReader.Contracts.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework>
4+
<TargetFramework>$(NetMinimum)</TargetFramework>
55
<RootNamespace>Microsoft.Diagnostics.DataContractReader</RootNamespace>
66
<Nullable>enable</Nullable>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Microsoft.Diagnostics.DataContractReader.Legacy.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework>
4+
<TargetFramework>$(NetMinimum)</TargetFramework>
55
<RootNamespace>Microsoft.Diagnostics.DataContractReader.Legacy</RootNamespace>
66
<Nullable>enable</Nullable>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader/Microsoft.Diagnostics.DataContractReader.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework>
4+
<TargetFramework>$(NetMinimum)</TargetFramework>
55
<RootNamespace>Microsoft.Diagnostics.DataContractReader</RootNamespace>
66
<Nullable>enable</Nullable>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

src/native/managed/cdac/tests/DumpTests/Microsoft.Diagnostics.DataContractReader.DumpTests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
</ItemGroup>
2626

2727
<ItemGroup>
28-
<Compile Include="$(LibrariesProjectRoot)Common\src\System\HResults.cs" Link="Common\System\HResults.cs" />
29-
<Compile Include="..\TestHelpers.cs" Link="TestHelpers.cs" />
28+
<Compile Include="$(LibrariesProjectRoot)Common\src\System\HResults.cs" Link="Common\System\HResults.cs" />
29+
<Compile Include="..\Microsoft.Diagnostics.DataContractReader.Tests\TestHelpers.cs" Link="TestHelpers.cs" />
3030
</ItemGroup>
3131

3232
<ItemGroup>

src/native/managed/cdac/tests/Microsoft.Diagnostics.Internal.RuntimeMemoryMocks/ExecutionManager/NibbleMapTestBuilder.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public override void AllocateCodeChunk(TargetCodePointer codeStart, uint codeSiz
101101
uint index = (uint) (pos >>> Log2NibblesPerDword);
102102
uint mask = ~(HighestNibbleMask >>> (int)((pos & NibblesPerDwordMask) << Log2NibbleSize));
103103

104-
value = value << Pos2ShiftCount(pos);
104+
value <<= Pos2ShiftCount(pos);
105105

106106
Span<byte> entry = NibbleMapFragment.Data.AsSpan((int)(index * sizeof(uint)), sizeof(uint));
107107
uint oldValue = TestPlaceholderTarget.ReadFromSpan<uint>(entry, Arch.IsLittleEndian);
@@ -143,7 +143,7 @@ public override void AllocateCodeChunk(TargetCodePointer codeStart, uint codeSiz
143143
uint index = (uint) (pos >>> Log2NibblesPerDword);
144144
uint mask = ~(HighestNibbleMask >>> (int)((pos & NibblesPerDwordMask) << Log2NibbleSize));
145145

146-
value = value << Pos2ShiftCount(pos);
146+
value <<= Pos2ShiftCount(pos);
147147

148148
Span<byte> entry = NibbleMapFragment.Data.AsSpan((int)(index * sizeof(uint)), sizeof(uint));
149149
uint oldValue = TestPlaceholderTarget.ReadFromSpan<uint>(entry, Arch.IsLittleEndian);
@@ -159,11 +159,11 @@ public override void AllocateCodeChunk(TargetCodePointer codeStart, uint codeSiz
159159
ulong firstByteAfterMethod = delta + (uint)codeSize;
160160
uint encodedPointer = NibbleMapConstantLookup.EncodePointer((uint)delta);
161161
index++;
162-
while((index + 1) * 256 <= firstByteAfterMethod)
162+
while ((index + 1) * 256 <= firstByteAfterMethod)
163163
{
164164
entry = NibbleMapFragment.Data.AsSpan((int)(index * sizeof(uint)), sizeof(uint));
165165
oldValue = TestPlaceholderTarget.ReadFromSpan<uint>(entry, Arch.IsLittleEndian);
166-
if(oldValue != 0)
166+
if (oldValue != 0)
167167
{
168168
throw new InvalidOperationException("Overwriting existing offset");
169169
}

src/native/managed/cdac/tests/Microsoft.Diagnostics.Internal.RuntimeMemoryMocks/Microsoft.Diagnostics.Internal.RuntimeMemoryMocks.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework>
4+
<TargetFramework>$(NetMinimum)</TargetFramework>
55
<RootNamespace>Microsoft.Diagnostics.Internal.RuntimeMemoryMocks</RootNamespace>
66
<Nullable>annotations</Nullable>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
8-
<IsTestProject>true</IsTestProject>
98
<!-- Do not produce a public package. This ships as part of the runtime -->
109
<IsShipping>false</IsShipping>
1110
<IsPackable>true</IsPackable>

src/native/managed/cdac/tests/Microsoft.Diagnostics.Internal.RuntimeMemoryMocks/MockDescriptors/MockDescriptors.CodeVersions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ public TargetPointer AddMethodDescVersioningState(TargetPointer nativeCodeVersio
117117

118118
public TargetPointer AddNativeCodeVersionNode()
119119
{
120-
Target.TypeInfo info = Types[DataType.NativeCodeVersionNode];
121120
MockMemorySpace.HeapFragment fragment = _codeVersionsAllocator.Allocate((ulong)Types[DataType.NativeCodeVersionNode].Size, "NativeCodeVersionNode");
122121
Builder.AddHeapFragment(fragment);
123122
return fragment.Address;
@@ -180,7 +179,7 @@ public TargetPointer AddILCodeVersionNode(TargetPointer prevNodeAddress, TargetN
180179
Builder.TargetTestHelpers.WritePointer(fragment.Data.AsSpan().Slice(info.Fields[nameof(Data.ILCodeVersionNode.Next)].Offset), TargetPointer.Null);
181180

182181
// set the previous node next pointer to the new node
183-
if(prevNodeAddress != TargetPointer.Null)
182+
if (prevNodeAddress != TargetPointer.Null)
184183
{
185184
Span<byte> prevNode = Builder.BorrowAddressRange(prevNodeAddress, fragment.Data.Length);
186185
Builder.TargetTestHelpers.WritePointer(prevNode.Slice(info.Fields[nameof(Data.ILCodeVersionNode.Next)].Offset), fragment.Address);

src/native/managed/cdac/tests/Microsoft.Diagnostics.Internal.RuntimeMemoryMocks/MockDescriptors/MockDescriptors.ExecutionManager.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class ExecutionManager
2121
{
2222
public const ulong ExecutionManagerCodeRangeMapAddress = 0x000a_fff0;
2323

24-
const int RealCodeHeaderSize = 0x30; // must be big enough for the offsets of RealCodeHeader size in ExecutionManagerTestTarget, below
24+
private const int RealCodeHeaderSize = 0x30; // must be big enough for the offsets of RealCodeHeader size in ExecutionManagerTestTarget, below
2525

2626
public struct AllocationRange
2727
{
@@ -48,9 +48,9 @@ public struct AllocationRange
4848
};
4949
public class RangeSectionMapTestBuilder
5050
{
51-
const ulong DefaultTopLevelAddress = 0x0000_1000u; // arbitrary
52-
const int EntriesPerMapLevel = 256; // for now its fixed at 256, see codeman.h RangeSectionMap::entriesPerMapLevel
53-
const int BitsPerLevel = 8;
51+
private const ulong DefaultTopLevelAddress = 0x0000_1000u; // arbitrary
52+
private const int EntriesPerMapLevel = 256; // for now its fixed at 256, see codeman.h RangeSectionMap::entriesPerMapLevel
53+
private const int BitsPerLevel = 8;
5454

5555
private readonly TargetPointer _topLevelAddress;
5656
private readonly MockMemorySpace.Builder _builder;
@@ -148,7 +148,7 @@ private RangeSectionMap.Cursor GetOrAddLevelSlot(TargetCodePointer address, Rang
148148

149149
// ensures that the maps for all the levels for the given address are allocated.
150150
// returns the address of the slot in the last level that corresponds to the given address
151-
RangeSectionMap.Cursor EnsureLevelsForAddress(TargetCodePointer address, bool collectible = false)
151+
private RangeSectionMap.Cursor EnsureLevelsForAddress(TargetCodePointer address, bool collectible = false)
152152
{
153153
int topIndex = EffectiveBitsForLevel(address, _levels);
154154
RangeSectionMap.Cursor cursor = new RangeSectionMap.Cursor(TopLevel, _levels, topIndex);

src/native/managed/cdac/tests/Microsoft.Diagnostics.Internal.RuntimeMemoryMocks/MockDescriptors/MockDescriptors.HashMap.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class HashMap
2323
DataType = DataType.HashMap,
2424
Fields =
2525
[
26-
new (nameof(Data.HashMap.Buckets), DataType.pointer),
26+
new(nameof(Data.HashMap.Buckets), DataType.pointer),
2727
]
2828
};
2929

0 commit comments

Comments
 (0)