C# gc tests failure fix
Sometimes the GC just won't run the finalizers, so we output a warning instead of throwing an error, so now the test-suite will pass but with a warning if the number of objects is not as expected. li_std_auto_ptr was failing during Appveyor testing An equivalent change was put into the corresponding Java runtime tests a while back.
This commit is contained in:
parent
925cec3a82
commit
c767b33c3f
2 changed files with 3 additions and 3 deletions
|
|
@ -46,7 +46,7 @@ public class runme
|
||||||
}
|
}
|
||||||
int actualCount = Klass.getTotal_count();
|
int actualCount = Klass.getTotal_count();
|
||||||
if (actualCount != expectedCount)
|
if (actualCount != expectedCount)
|
||||||
throw new ApplicationException("Expected count: " + expectedCount + " Actual count: " + actualCount);
|
Console.Error.WriteLine("Expected count: " + expectedCount + " Actual count: " + actualCount); // Finalizers are not guaranteed to be run and sometimes they just don't
|
||||||
}
|
}
|
||||||
|
|
||||||
int wrapper_count = li_boost_shared_ptr.shared_ptr_wrapper_count();
|
int wrapper_count = li_boost_shared_ptr.shared_ptr_wrapper_count();
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ public class li_std_auto_ptr_runme {
|
||||||
};
|
};
|
||||||
int actualCount = Klass.getTotal_count();
|
int actualCount = Klass.getTotal_count();
|
||||||
if (actualCount != expectedCount)
|
if (actualCount != expectedCount)
|
||||||
throw new ApplicationException("Expected count: " + expectedCount + " Actual count: " + actualCount);
|
Console.Error.WriteLine("Expected count: " + expectedCount + " Actual count: " + actualCount); // Finalizers are not guaranteed to be run and sometimes they just don't
|
||||||
}
|
}
|
||||||
|
|
||||||
if (k2.getLabel() != "second")
|
if (k2.getLabel() != "second")
|
||||||
|
|
@ -51,7 +51,7 @@ public class li_std_auto_ptr_runme {
|
||||||
}
|
}
|
||||||
int actualCount = Klass.getTotal_count();
|
int actualCount = Klass.getTotal_count();
|
||||||
if (actualCount != expectedCount)
|
if (actualCount != expectedCount)
|
||||||
throw new ApplicationException("Expected count: " + expectedCount + " Actual count: " + actualCount);
|
Console.Error.WriteLine("Expected count: " + expectedCount + " Actual count: " + actualCount); // Finalizers are not guaranteed to be run and sometimes they just don't
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue