www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 776] New: Unittest section inside a template does not alway execute.

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=776

           Summary: Unittest section inside a template does not alway
                    execute.
           Product: D
           Version: 0.178
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: pchapin ecet.vtc.edu


Consider the following two file program:

----> main.d <----

import other;

int main( )
{
  Foo!(int) my_foo = new Foo!(int);
  return( 0 );
}

----> other.d <----

class Foo(T) {
  unittest {
    assert( 1 == 0 );
  }
};

When compiled with 'dmd -unittest main.d other.d' the program compiles and
links without error. However, the unit test does not execute (or at least the
assertion does not fire). Moving the class template Foo(T) into main.d and
throwing away other.d *does* cause the assertion to fire.


-- 
Dec 30 2006
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=776






Added to DStress as
http://dsrtess.kuehne.cn/compile/u/unittest_10_A.d
http://dsrtess.kuehne.cn/compile/u/unittest_10_B.d
http://dsrtess.kuehne.cn/compile/u/unittest_10_C.d
http://dsrtess.kuehne.cn/norun/u/unittest_10_D.d
http://dsrtess.kuehne.cn/norun/u/unittest_10_E.d
http://dsrtess.kuehne.cn/norun/u/unittest_10_F.d
http://dsrtess.kuehne.cn/norun/u/unittest_10_G.d
http://dsrtess.kuehne.cn/norun/u/unittest_10_H.d


-- 
Dec 31 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=776


thomas-dloop kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         OS/Version|Windows                     |All
         Resolution|                            |FIXED





fixed in DMD-1.005


-- 
Apr 27 2007