Skip to content

Commit

Permalink
Remove console writes
Browse files Browse the repository at this point in the history
  • Loading branch information
buyaa-n committed May 18, 2022
1 parent 639ee95 commit 5891a41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -510,21 +510,21 @@ private void MergeWithGlobalListInOrder(T[] list)
}

int length = list.Length;
int cachedCount = cachedMembers.Length;
int freeSlotIndex = length;

T[] newCache = list;
Array.Resize(ref newCache, cachedCount + length);

for (int cachedIndex = 0; cachedIndex < cachedCount; cachedIndex++)
// When all members are requested there should be no element in cache that not found within all members list.
// But somehow in very rare case such element found in cache and not appending that to the all members list
// causing random test failure, must be related to the bug commented on row 597
Array.Resize(ref newCache, length + 1);

foreach (T cachedMemberInfo in cachedMembers)
{
T cachedMemberInfo = cachedMembers[cachedIndex];
bool foundInList = false;

if (cachedMemberInfo == null)
break;

for (int i = 0; i < length; i++)
for (int i = 0; i < list.Length; i++)
{
T newMemberInfo = list[i];

Expand All @@ -539,8 +539,7 @@ private void MergeWithGlobalListInOrder(T[] list)

if (!foundInList)
{
Volatile.Write(ref newCache[freeSlotIndex], cachedMemberInfo);
freeSlotIndex++;
newCache[length] = cachedMemberInfo;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ public static void TypeGetMethodsReturnsInDeclaredOrderTest()
Assert.NotNull(method2);
Assert.NotNull(mInterface2);
MethodInfo[] methods = t.GetMethods();
Console.WriteLine("Methods");
for (int i = 0; i < methods.Length; i++)
{
Console.WriteLine("{0} {1} ", methods[i].Name, methods[i].MetadataToken);
}
Assert.Equal("Method1", methods[0].Name);
Assert.Equal(method2, methods[1]);
Assert.Equal("add_Event1", methods[2].Name);
Expand All @@ -89,11 +84,6 @@ public static void TypeGetMemberByNameReturnsInDeclaredOrderTest()
MemberInfo[] methods = t.GetMember("Method3");
Assert.NotNull(method3Int);
Assert.NotNull(method3String);
Console.WriteLine("Method3 overloads");
for (int i = 0; i < methods.Length; i++)
{
Console.WriteLine("{0} {1} ", methods[i].Name, methods[i].MetadataToken);
}
Assert.Equal(0, ((MethodInfo)methods[0]).GetParameters().Length);
Assert.Equal(method3String, methods[1]);
Assert.Equal(method3Int, methods[2]);
Expand All @@ -106,11 +96,6 @@ public static void TypeGetConstructorsReturnsInDeclaredOrderTest()
ConstructorInfo constuctor3 = t.GetConstructor(new Type[] { typeof(string) });
Assert.NotNull(constuctor3);
ConstructorInfo[] constuctors = t.GetConstructors();
Console.WriteLine("constuctors");
for (int i = 0; i < constuctors.Length; i++)
{
Console.WriteLine("{0} {1} ", constuctors[i].Name, constuctors[i].MetadataToken);
}
Assert.Equal(typeof(int), constuctors[0].GetParameters()[0].ParameterType);
Assert.Equal(0, constuctors[1].GetParameters().Length);
Assert.Equal(constuctor3, constuctors[2]);
Expand All @@ -123,11 +108,6 @@ public static void TypeGetEventsReturnsInDeclaredOrderTest()
EventInfo event2 = t.GetEvent("Event2");
Assert.NotNull(event2);
EventInfo[] events = t.GetEvents();
Console.WriteLine("Events");
for (int i = 0; i < events.Length; i++)
{
Console.WriteLine("{0} {1} ", events[i].Name, events[i].MetadataToken);
}
Assert.Equal("Event1", events[0].Name);
Assert.Equal(event2, events[1]);
Assert.Equal("Event3", events[2].Name);
Expand All @@ -142,11 +122,6 @@ public static void TypeGetPropertiesReturnsInDeclaredOrderTest()
Assert.NotNull(propertyBase);
Assert.NotNull(property3);
PropertyInfo[] properties = t.GetProperties();
Console.WriteLine("Properties");
for (int i = 0; i < properties.Length; i++)
{
Console.WriteLine("{0} {1} ", properties[i].Name, properties[i].MetadataToken);
}
Assert.Equal("Property1", properties[0].Name);
Assert.Equal("Property2", properties[1].Name);
Assert.Equal(property3, properties[2]);
Expand All @@ -160,11 +135,6 @@ public static void TypeGetFieldsReturnsInDeclaredOrderTest()
FieldInfo field3 = t.GetField("field3");
Assert.NotNull(field3);
FieldInfo[] fields = t.GetFields();
Console.WriteLine("Fields");
for (int i = 0; i < fields.Length; i++)
{
Console.WriteLine("{0} {1} ", fields[i].Name, fields[i].MetadataToken);
}
Assert.Equal("field1", fields[0].Name);
Assert.Equal("field2", fields[1].Name);
Assert.Equal(field3, fields[2]);
Expand Down

0 comments on commit 5891a41

Please sign in to comment.