Thread overview
[Issue 776] New: Unittest section inside a template does not alway execute.
Dec 30, 2006
d-bugmail
Dec 31, 2006
d-bugmail
Apr 27, 2007
d-bugmail
December 30, 2006
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.


-- 

December 31, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=776





------- Comment #1 from thomas-dloop@kuehne.cn  2006-12-31 08:47 -------
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


-- 

April 27, 2007
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




------- Comment #2 from thomas-dloop@kuehne.cn  2007-04-27 12:27 -------
fixed in DMD-1.005


--