Skip to content

Commit

Permalink
Remove stack tracing from unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
speps committed Mar 20, 2018
1 parent 76fc448 commit b8a2bc8
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions TessBed/UnitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public class TestPool : IPool
{
private IDictionary<Type, int> _newCount = new Dictionary<Type, int>();
private IDictionary<Type, int> _freeCount = new Dictionary<Type, int>();
private IDictionary<object, string> _stacks = new Dictionary<object, string>();

public override T Get<T>()
{
Expand All @@ -47,7 +46,6 @@ public override T Get<T>()
_newCount[typeof(T)]++;
var obj = new T();
obj.Init(this);
_stacks[obj] = System.Environment.StackTrace;
return obj;
}

Expand All @@ -62,7 +60,6 @@ public override void Return<T>(T obj)
return;
}
obj.Reset(this);
_stacks.Remove(obj);
if (!_freeCount.ContainsKey(typeof(T)))
{
_freeCount.Add(typeof(T), 0);
Expand All @@ -76,10 +73,6 @@ public override void Return<T>(T obj)

public void AssertCounts()
{
foreach (var stack in _stacks)
{
System.Diagnostics.Debug.WriteLine("Not freed: {0}, allocated from\n{1}", stack.Key.GetType().Name, stack.Value);
}
foreach (var type in _newCount)
{
Assert.AreEqual(type.Value, _freeCount[type.Key], type.Key.ToString());
Expand Down

0 comments on commit b8a2bc8

Please sign in to comment.