view run/d/delete_12_D.d @ 1615:8d5c55d163fd

Fix some outdated tests that used auto to mean scope.
author Christian Kamm <kamm incasoftware de>
date Sun, 12 Jul 2009 16:44:52 +0200
parents b8c0195059d9
children
line wrap: on
line source

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

// @author@	Nick <Nick_member@pathlink.com>
// @date@	2006-02-15
// @uri@	http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=6267

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(){
	scope Foo f = new Foo();
	delete f;
}

int main(){
	if(status++ != 0){
		assert(0);
	}

	test();

	if(status++ != 3){
		assert(0);
	}

	return 0;
}