view run/destructor_03.d @ 70:5f98d4a33d49

1) review of all test cases with unexpected results (except encoding and html/xml) 2) updated todo
author thomask
date Sat, 23 Oct 2004 22:47:47 +0000
parents 33a25c1e1cfc
children a33ad7189d21
line wrap: on
line source

// @author@	Ilya Zaitseff <sark7@mail333.com>
// @date@	2004-08-06
// @uri@	news://opscahl7ddaaezs2@ilya.tec.amursk.ru
// @url@	nttp://digitalmars.com/digitalmars.D.bugs: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;
}