Mercurial > projects > dstress
view run/d/delete_12_D.d @ 1091:9dcac8d4e97f
post DMD-0.163 review
author | thomask |
---|---|
date | Fri, 21 Jul 2006 11:15:26 +0000 |
parents | b3da1b510a19 |
children | b8c0195059d9 |
line wrap: on
line source
// $HeadURL$ // $Date$ // $Author$ // @author@ Nick <Nick_member@pathlink.com> // @date@ 2006-02-15 // @uri@ news:dsv036$qlt$1@digitaldaemon.com module dstress.run.d.delete_12_D; int status; class Foo{ int i; new(size_t sz){ void* p; p = (new byte[sz]).ptr; if(status++ != 1){ assert(0); } return p; } delete(void* p){ if(status++ != 2){ assert(0); } } } void test(){ auto Foo f = new Foo(); delete f; } int main(){ if(status++ != 0){ assert(0); } test(); if(status++ != 3){ assert(0); } return 0; }