Entry (main) method inside a class?

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Mon Mar 19 04:39:06 PDT 2007


Thomas Kuehne wrote:
> 
> Frits van Bommel schrieb am 2007-03-18:
>> And some unit tests in flectioned.d fail:
>> ---
>> $ gdmd -L--allow-multiple-definition -fall-sources -unittest -oftest 
>> test.d cn/kuehne/flectioned.d cn/kuehne/unittest_walker.d
>> /usr/bin/ld: Warning: size of symbol `_moduleUnitTests' changed from 
>> 1084 in unittest_walker.o to 58 in 
>> /home/urxae/opt/gdc/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.1.1/../../../../lib64/libgphobos.a(moduleinit.o)
>> $ ./test
>> [snip]
>> testing cn.kuehne.flectioned.TracedException.__unittest21 ... FAILED: 
>> (std.asserterror.AssertError) AssertError Failure 
>> cn/kuehne/flectioned.d(991)
> Strange, this unittest succeds if it is put in a seperate file!?

No, still fails if I put it in test.d (and qualify some of the names of 
static members).

>> testing cn.kuehne.flectioned.Trace.__unittest18 ... FAILED: 
>> (std.asserterror.AssertError) AssertError Failure 
>> cn/kuehne/flectioned.d(654)
>> testing cn.kuehne.flectioned.Trace.__unittest19 ... FAILED: 
>> (std.asserterror.AssertError) AssertError Failure 
>> cn/kuehne/flectioned.d(654)
>> testing cn.kuehne.flectioned.TracedException.__unittest22 ... FAILED: 
>> (std.asserterror.AssertError) AssertError Failure 
>> cn/kuehne/flectioned.d(654)
>> testing cn.kuehne.flectioned.Trace.__unittest17 ... FAILED: 
>> (std.asserterror.AssertError) AssertError Failure 
>> cn/kuehne/flectioned.d(654)
> Removed this test because it may hide the real problems.

If I comment that assert out, cn.kuehne.flectioned.Trace.__unittest20 
(which seems to be the test for Trace.findSymbol, the function whose 
postcondition contains that assertion) fails with a segfault.

However, the first test, that I copied to test.d, now succeeds...
(Even though that wasn't the assertion that failed for that test)



More information about the Digitalmars-d mailing list