Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
remove _inUnitTest flag
Browse files Browse the repository at this point in the history
- it was used to suppress stderr message during unit test
  • Loading branch information
MartinNowak committed Dec 22, 2012
1 parent 34a947b commit 0e148e9
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/rt/minfo.d
Expand Up @@ -366,21 +366,13 @@ struct StackRec

void onCycleError(StackRec[] stack)
{
string msg = "Aborting";
version (unittest)
{
if (_inUnitTest)
goto Lerror;
}

msg ~= ": Cycle detected between modules with ctors/dtors:\n";
string msg = "Aborting: Cycle detected between modules with ctors/dtors:\n";
foreach (e; stack)
{
msg ~= e.mod.name;
msg ~= " -> ";
}
msg ~= stack[0].mod.name;
Lerror:
throw new Exception(msg);
}

Expand Down Expand Up @@ -498,14 +490,8 @@ private void sortCtorsImpl(ref ModuleGroup mgroup, StackRec[] stack)
}
}

version (unittest)
bool _inUnitTest;

unittest
{
_inUnitTest = true;
scope (exit) _inUnitTest = false;

static void assertThrown(T : Throwable, E)(lazy E expr)
{
try
Expand Down

0 comments on commit 0e148e9

Please sign in to comment.