view run/destructor_03.d @ 1612:1f76d5b2f458

Fix typo in testcase run/typeid_79
author Christian Kamm <kamm incasoftware de>
date Sun, 10 May 2009 11:55:53 +0200
parents 6e4063f99377
children 7b7967dd4203
line wrap: on
line source

// $HeadURL$
// $Date$
// $Author$

// @author@	Ilya Zaitseff <sark7@mail333.com>
// @date@	2004-08-06
// @uri@	news:opscahl7ddaaezs2@ilya.tec.amursk.ru
// @uri@	http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=1284

module dstress.run.destructor_03;

int status;

class MyClass{
	this(){
		status++;
	}
	
	~this(){
		status--;
		throw new Exception("E2");
	}
}

int main(){
	try{
		auto MyClass m = new MyClass();
		assert(status == 1);
		delete m;
	}catch(Exception e){
		assert(status == 0);
		status--;
	}
	
	assert( status == -1 );
	return 0;
}