Simplest testcase: unittest{} void main() { __unittest1(); } I'm honestly not sure if this is supposed to be legal code. But DMD 2.046 accepts and runs it without problems. Regards
Oops, sorry, told a while lie. The program compiles + runs when you pass the compiler flag -unittest, but ICEs when you don't. Regards
Patch to make SEGV an error: --- dmd.orig/expression.c 2010年11月08日 10:32:15.492440000 +0000 +++ dmd/expression.c 2010年11月08日 10:39:28.404440000 +0000 @@ -2324,6 +2324,11 @@ if (!f->originalType && f->scope) // semantic not yet run f->semantic(f->scope); + if (f->isUnitTestDeclaration()) + { + error("cannot call unittest function '%s'", toChars()); + return new ErrorExp(); + } if (!f->type->deco) { error("forward reference to %s", toChars()); Regards
http://www.dsource.org/projects/dmd/changeset/779
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル