# HG changeset patch # User Christian Kamm # Date 1247409892 -7200 # Node ID 8d5c55d163fd2db1b2ab971555d46957cc26466c # Parent 709f6451b315dba2d704be49df969b99ec399518 Fix some outdated tests that used auto to mean scope. diff -r 709f6451b315 -r 8d5c55d163fd run/a/auto_13_A.d --- a/run/a/auto_13_A.d Mon May 25 20:07:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -// $HeadURL$ -// $Date$ -// $Author$ - -// @author@ Chris Sauls -// @date@ 2005-12-10 -// @uri@ news:dneava$evs$1@digitaldaemon.com -// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=705 - -module dstress.run.a.auto_13_A; - -int[] status; - -class Class { - int id; - - this (int id) { - this.id = id; - status ~= id; - } - - ~this () { - status ~= -id; - } -} - -template Template (int id) { - auto Class c = new Class(id); -} - -int main () { - if(status.length != 0){ - assert(0); - } - - { - mixin Template!(1); - } - - if(status.length != 2){ - assert(0); - } - if(status[0] != 1){ - assert(0); - } - if(status[1] != -1){ - assert(0); - } - - { - mixin Template!(2); - } - - if(status.length != 4){ - assert(0); - } - if(status[0] != 1){ - assert(0); - } - if(status[1] != -1){ - assert(0); - } - if(status[2] != 2){ - assert(0); - } - if(status[3] != -2){ - assert(0); - } - - return 0; -} - diff -r 709f6451b315 -r 8d5c55d163fd run/a/auto_13_B.d --- a/run/a/auto_13_B.d Mon May 25 20:07:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -// $HeadURL$ -// $Date$ -// $Author$ - -// @author@ Chris Sauls -// @date@ 2005-12-10 -// @uri@ news:dneava$evs$1@digitaldaemon.com -// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=705 - -module dstress.run.a.auto_13_B; - -int[] status; - -class Class { - int id; - - this (int id) { - this.id = id; - status ~= id; - } - - ~this () { - status ~= -id; - } -} - -int main () { - if(status.length != 0){ - assert(0); - } - - { - auto Class c = new Class(1); - } - - if(status.length != 2){ - assert(0); - } - if(status[0] != 1){ - assert(0); - } - if(status[1] != -1){ - assert(0); - } - - { - auto Class c = new Class(2); - } - - if(status.length != 4){ - assert(0); - } - if(status[0] != 1){ - assert(0); - } - if(status[1] != -1){ - assert(0); - } - if(status[2] != 2){ - assert(0); - } - if(status[3] != -2){ - assert(0); - } - - return 0; -} - diff -r 709f6451b315 -r 8d5c55d163fd run/a/auto_14_A.d --- a/run/a/auto_14_A.d Mon May 25 20:07:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -// $HeadURL$ -// $Date$ -// $Author$ - -// @author@ Sean Kelly -// @date@ 2006-01-24 -// @uri@ news:dr5uqg$2hn7$1@digitaldaemon.com -// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=704 - -module dstress.run.a.auto_14_A; - -bool hadDtor = false; - -auto class MyClass{ - this(){ - throw new Exception("dummy"); - } - - ~this(){ - hadDtor = true; - throw new Exception("should never throw"); - } -} - -int main(){ - try{ - auto MyClass c; - c = new MyClass(); - }catch{ - if(!hadDtor){ - return 0; - }else{ - assert(0); - } - } - - assert(0); -} diff -r 709f6451b315 -r 8d5c55d163fd run/a/auto_14_B.d --- a/run/a/auto_14_B.d Mon May 25 20:07:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -// $HeadURL$ -// $Date$ -// $Author$ - -// @author@ Sean Kelly -// @date@ 2006-01-24 -// @uri@ news:dr5uqg$2hn7$1@digitaldaemon.com -// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=704 - -module dstress.run.a.auto_14_B; - -bool hadDtor = false; - -class MyClass{ - this(){ - throw new Exception("dummy"); - } - - ~this(){ - hadDtor = true; - throw new Exception("should never throw"); - } -} - -int main(){ - - try{ - auto MyClass c; - c = new MyClass(); - }catch{ - if(!hadDtor){ - return 0; - }else{ - assert(0); - } - } - - assert(0); -} diff -r 709f6451b315 -r 8d5c55d163fd run/a/auto_16_A.d --- a/run/a/auto_16_A.d Mon May 25 20:07:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -// $HeadURL$ -// $Date$ -// $Author$ - -// @author@ yama -// @date@ 2006-02-26 -// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=6373 - -module dstress.run.a.auto_16_A; - -class C{ - string toString(){ - return "hallo bug"; - } -} - -int main(){ - auto C c; - version(all){ - c = new C(); - } - - if(c.toString() != "hallo bug"){ - assert(0); - } - - return 0; -} - - - diff -r 709f6451b315 -r 8d5c55d163fd run/a/auto_16_B.d --- a/run/a/auto_16_B.d Mon May 25 20:07:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -// $HeadURL$ -// $Date$ -// $Author$ - -// @author@ yama -// @date@ 2006-02-26 -// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=6373 - -// __DSTRESS_DFLAGS__ -version=always - -module dstress.run.a.auto_16_B; - -class C{ - string toString(){ - return "hallo bug"; - } -} - -int main(){ - version(always){ - auto C c; - c = new C(); - } - - if(c.toString() != "hallo bug"){ - assert(0); - } - - return 0; -} - - - diff -r 709f6451b315 -r 8d5c55d163fd run/a/auto_16_C.d --- a/run/a/auto_16_C.d Mon May 25 20:07:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -// $HeadURL$ -// $Date$ -// $Author$ - -// @author@ yama -// @date@ 2006-02-26 -// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=6373 - -// __DSTRESS_DFLAGS__ -version=always - -module dstress.run.a.auto_16_C; - -auto class C{ - string toString(){ - return "hallo bug"; - } -} - -int main(){ - auto C c; - version(always){ - c = new C(); - } - - if(c.toString() != "hallo bug"){ - assert(0); - } - - return 0; -} - - - diff -r 709f6451b315 -r 8d5c55d163fd run/a/auto_16_D.d --- a/run/a/auto_16_D.d Mon May 25 20:07:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -// $HeadURL$ -// $Date$ -// $Author$ - -// @author@ yama -// @date@ 2006-02-26 -// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=6373 - -// __DSTRESS_DFLAGS__ -version=always - -module dstress.run.a.auto_16_D; - -auto class C{ - string toString(){ - return "hallo bug"; - } -} - -int main(){ - version(always){ - auto C c; - c = new C(); - } - - if(c.toString() != "hallo bug"){ - assert(0); - } - - return 0; -} - - - diff -r 709f6451b315 -r 8d5c55d163fd run/a/auto_16_E.d --- a/run/a/auto_16_E.d Mon May 25 20:07:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -// $HeadURL$ -// $Date$ -// $Author$ - -// @author@ yama -// @date@ 2006-02-26 -// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=6373 - -// __DSTRESS_DFLAGS__ -version=always - -module dstress.run.a.auto_16_E; - -class C{ - string toString(){ - return "hallo bug"; - } -} - -int main(){ - version(always){ - auto C c; - c = new C(); - } - - version(always){ - if(c.toString() != "hallo bug"){ - assert(0); - } - } - - return 0; -} - - - diff -r 709f6451b315 -r 8d5c55d163fd run/a/auto_16_F.d --- a/run/a/auto_16_F.d Mon May 25 20:07:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -// $HeadURL$ -// $Date$ -// $Author$ - -// @author@ yama -// @date@ 2006-02-26 -// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=6373 - -// __DSTRESS_DFLAGS__ -version=always - -module dstress.run.a.auto_16_F; - -class C{ - string toString(){ - return "hallo bug"; - } -} - -int main(){ - version(always){ - auto C c; - c = new C(); - } - - if((new C()).toString() != "hallo bug"){ - assert(0); - } - - version(always){ - if(c.toString() != "hallo bug"){ - assert(0); - } - } - - return 0; -} - - - diff -r 709f6451b315 -r 8d5c55d163fd run/auto_01.d --- a/run/auto_01.d Mon May 25 20:07:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -// $HeadURL$ -// $Date$ -// $Author$ - -// @author@ Sean Kelly -// @date@ 2004-09-11 -// @uri@ news:chtj6t$24bm$1@digitaldaemon.com -// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=1821 - -module dstress.run.auto_01; - -auto class AutoClass{ - this(){ - throw new Exception("error msg"); - } - ~this(){ - throw new Exception("should never throw"); - } -} - -int main(){ - try{ - auto AutoClass ac = new AutoClass(); - }catch{ - return 0; - } - assert(0); -} diff -r 709f6451b315 -r 8d5c55d163fd run/auto_02.d --- a/run/auto_02.d Mon May 25 20:07:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -// $HeadURL$ -// $Date$ -// $Author$ - -// @author@ Sean Kelly -// @date@ 2004-09-11 - -module dstress.run.auto_02; - -int status; - -auto class AutoClass{ - void bad(){ - throw new Exception("error msg"); - } - - ~this(){ - if(status == 0){ - status--; - }else{ - status = -100; - } - } -} - -void test(){ - try{ - auto AutoClass ac = new AutoClass(); - ac.bad(); - }catch{ - if(status == -1){ - status = 20; - } - } - - if(status != 20){ - throw new Exception("dtor not called"); - } -} - -int main(){ - assert(status == 0); - - test(); - - if(status == 20){ - return 0; - } -} diff -r 709f6451b315 -r 8d5c55d163fd run/auto_03.d --- a/run/auto_03.d Mon May 25 20:07:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -// $HeadURL$ -// $Date$ -// $Author$ - -// @author@ Sean Kelly -// @date@ 2004-09-11 -// @uri@ news:chtj6t$24bm$1@digitaldaemon.com -// @uri@ nntp://digitalmars.com/digitalmars.D.bugs/1821 -// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1035 - -module dstress.run.auto_03; - -int status; - -auto class AutoClass{ - ~this(){ - if(0 != status){ - assert(0); - } - status--; - throw new Exception("error msg"); - } -} - -void test(){ - if(0 != status){ - assert(0); - } - auto AutoClass ac = new AutoClass(); -} - -int main(){ - try{ - test(); - }catch{ - } - - if(status==-1){ - return 0; - } - assert(0); -} diff -r 709f6451b315 -r 8d5c55d163fd run/auto_04.d --- a/run/auto_04.d Mon May 25 20:07:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -// $HeadURL$ -// $Date$ -// $Author$ - -// @author@ Sean Kelly -// @date@ 2004-09-11 -// @uri@ news:chtj6t$24bm$1@digitaldaemon.com -// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=1821 - -module dstress.run.auto_04; - -int status; - -auto class AutoClass{ - this(){ - if(0 != status){ - assert(0); - } - status+=2; - } - ~this(){ - if(2 != status){ - assert(0); - } - status--; - throw new Exception("error msg"); - } -} - -void check(){ - auto AutoClass ac = new AutoClass(); - throw new Exception("check error"); -} - -int main(){ - if(0 != status){ assert(0); } - try{ - check(); - }catch{ - if(1 != status){ assert(0); } - status-=5; - } - - if(status==-4){ - return 0; - } - assert(0); -} diff -r 709f6451b315 -r 8d5c55d163fd run/auto_06.d --- a/run/auto_06.d Mon May 25 20:07:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -// $HeadURL$ -// $Date$ -// $Author$ - -module dstress.run.auto_06; - -int status; - -auto class A{ - int cond; - - this(int cond){ - this.cond=cond; - } - - ~this(){ - if(cond != status){ - assert(0); - } - status--; - } -} - -void test(){ - auto A a = new A(-1); - auto A b = new A(0); -} - -int main(){ - test(); - - if(status==-2){ - return 0; - } -} diff -r 709f6451b315 -r 8d5c55d163fd run/auto_07.d --- a/run/auto_07.d Mon May 25 20:07:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -// $HeadURL$ -// $Date$ -// $Author$ - -// @author@ Sean Kelly -// @date@ 2005-04-14 -// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=3645 - -module dstress.run.auto_07; - -int status; - -auto class Parent{ -} - -auto class Child : Parent{ - this(){ - if(0 != status){ - assert(0); - } - status=1; - } - - ~this(){ - if(1 != status){ - assert(0); - } - status=2; - } -} - -void test(){ - auto Parent o = new Child(); - if(1 != status){ - assert(0); - } -} - -int main(){ - test(); - - if(status==2){ - return 0; - } - - assert(0); -} - diff -r 709f6451b315 -r 8d5c55d163fd run/auto_08.d --- a/run/auto_08.d Mon May 25 20:07:04 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -// $HeadURL$ -// $Date$ -// $Author$ - -// @author@ Sean Kelly -// @date@ 2005-04-14 -// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=3645 - -module dstress.run.auto_08; - -int status; - -auto class Parent{ -} - -auto class Child : Parent{ - this(){ - if(0 != status){ - assert(0); - } - status=1; - } - - ~this(){ - if(1 != status){ - assert(0); - } - status=2; - } -} - -void test(){ - auto Child o = new Child(); - if(1 != status){ - assert(0); - } -} - -int main(){ - test(); - - if(status==2){ - return 0; - } - assert(0); -} - diff -r 709f6451b315 -r 8d5c55d163fd run/d/delete_12_A.d --- a/run/d/delete_12_A.d Mon May 25 20:07:04 2009 +0200 +++ b/run/d/delete_12_A.d Sun Jul 12 16:44:52 2009 +0200 @@ -31,7 +31,7 @@ } void test(){ - auto Foo f = new Foo(); + scope Foo f = new Foo(); } int main(){ diff -r 709f6451b315 -r 8d5c55d163fd run/d/delete_12_B.d --- a/run/d/delete_12_B.d Mon May 25 20:07:04 2009 +0200 +++ b/run/d/delete_12_B.d Sun Jul 12 16:44:52 2009 +0200 @@ -33,7 +33,7 @@ } void test(){ - auto Foo f = new Foo(); + scope Foo f = new Foo(); } int main(){ diff -r 709f6451b315 -r 8d5c55d163fd run/d/delete_12_D.d --- a/run/d/delete_12_D.d Mon May 25 20:07:04 2009 +0200 +++ b/run/d/delete_12_D.d Sun Jul 12 16:44:52 2009 +0200 @@ -33,7 +33,7 @@ } void test(){ - auto Foo f = new Foo(); + scope Foo f = new Foo(); delete f; } diff -r 709f6451b315 -r 8d5c55d163fd run/s/scope_20_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/scope_20_A.d Sun Jul 12 16:44:52 2009 +0200 @@ -0,0 +1,72 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Chris Sauls +// @date@ 2005-12-10 +// @uri@ news:dneava$evs$1@digitaldaemon.com +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=705 + +module dstress.run.s.scope_20_A; + +int[] status; + +class Class { + int id; + + this (int id) { + this.id = id; + status ~= id; + } + + ~this () { + status ~= -id; + } +} + +template Template (int id) { + scope Class c = new Class(id); +} + +int main () { + if(status.length != 0){ + assert(0); + } + + { + mixin Template!(1); + } + + if(status.length != 2){ + assert(0); + } + if(status[0] != 1){ + assert(0); + } + if(status[1] != -1){ + assert(0); + } + + { + mixin Template!(2); + } + + if(status.length != 4){ + assert(0); + } + if(status[0] != 1){ + assert(0); + } + if(status[1] != -1){ + assert(0); + } + if(status[2] != 2){ + assert(0); + } + if(status[3] != -2){ + assert(0); + } + + return 0; +} + diff -r 709f6451b315 -r 8d5c55d163fd run/s/scope_20_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/scope_20_B.d Sun Jul 12 16:44:52 2009 +0200 @@ -0,0 +1,68 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Chris Sauls +// @date@ 2005-12-10 +// @uri@ news:dneava$evs$1@digitaldaemon.com +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=705 + +module dstress.run.s.scope_20_B; + +int[] status; + +class Class { + int id; + + this (int id) { + this.id = id; + status ~= id; + } + + ~this () { + status ~= -id; + } +} + +int main () { + if(status.length != 0){ + assert(0); + } + + { + scope Class c = new Class(1); + } + + if(status.length != 2){ + assert(0); + } + if(status[0] != 1){ + assert(0); + } + if(status[1] != -1){ + assert(0); + } + + { + scope Class c = new Class(2); + } + + if(status.length != 4){ + assert(0); + } + if(status[0] != 1){ + assert(0); + } + if(status[1] != -1){ + assert(0); + } + if(status[2] != 2){ + assert(0); + } + if(status[3] != -2){ + assert(0); + } + + return 0; +} + diff -r 709f6451b315 -r 8d5c55d163fd run/s/scope_21_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/scope_21_A.d Sun Jul 12 16:44:52 2009 +0200 @@ -0,0 +1,38 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Sean Kelly +// @date@ 2006-01-24 +// @uri@ news:dr5uqg$2hn7$1@digitaldaemon.com +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=704 + +module dstress.run.s.scope_21_A; + +bool hadDtor = false; + +scope class MyClass{ + this(){ + throw new Exception("dummy"); + } + + ~this(){ + hadDtor = true; + throw new Exception("should never throw"); + } +} + +int main(){ + try{ + scope MyClass c; + c = new MyClass(); + }catch{ + if(!hadDtor){ + return 0; + }else{ + assert(0); + } + } + + assert(0); +} diff -r 709f6451b315 -r 8d5c55d163fd run/s/scope_21_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/scope_21_B.d Sun Jul 12 16:44:52 2009 +0200 @@ -0,0 +1,39 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Sean Kelly +// @date@ 2006-01-24 +// @uri@ news:dr5uqg$2hn7$1@digitaldaemon.com +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=704 + +module dstress.run.s.scope_21_B; + +bool hadDtor = false; + +class MyClass{ + this(){ + throw new Exception("dummy"); + } + + ~this(){ + hadDtor = true; + throw new Exception("should never throw"); + } +} + +int main(){ + + try{ + scope MyClass c; + c = new MyClass(); + }catch{ + if(!hadDtor){ + return 0; + }else{ + assert(0); + } + } + + assert(0); +} diff -r 709f6451b315 -r 8d5c55d163fd run/s/scope_22_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/scope_22_A.d Sun Jul 12 16:44:52 2009 +0200 @@ -0,0 +1,31 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ yama +// @date@ 2006-02-26 +// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=6373 + +module dstress.run.s.scope_22_A; + +class C{ + char[] toString(){ + return "hallo bug"; + } +} + +int main(){ + scope C c; + version(all){ + c = new C(); + } + + if(c.toString() != "hallo bug"){ + assert(0); + } + + return 0; +} + + + diff -r 709f6451b315 -r 8d5c55d163fd run/s/scope_22_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/scope_22_B.d Sun Jul 12 16:44:52 2009 +0200 @@ -0,0 +1,33 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ yama +// @date@ 2006-02-26 +// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=6373 + +// __DSTRESS_DFLAGS__ -version=always + +module dstress.run.s.scope_22_B; + +class C{ + char[] toString(){ + return "hallo bug"; + } +} + +int main(){ + version(always){ + scope C c; + c = new C(); + } + + if(c.toString() != "hallo bug"){ + assert(0); + } + + return 0; +} + + + diff -r 709f6451b315 -r 8d5c55d163fd run/s/scope_22_C.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/scope_22_C.d Sun Jul 12 16:44:52 2009 +0200 @@ -0,0 +1,33 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ yama +// @date@ 2006-02-26 +// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=6373 + +// __DSTRESS_DFLAGS__ -version=always + +module dstress.run.s.scope_22_C; + +scope class C{ + char[] toString(){ + return "hallo bug"; + } +} + +int main(){ + scope C c; + version(always){ + c = new C(); + } + + if(c.toString() != "hallo bug"){ + assert(0); + } + + return 0; +} + + + diff -r 709f6451b315 -r 8d5c55d163fd run/s/scope_22_D.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/scope_22_D.d Sun Jul 12 16:44:52 2009 +0200 @@ -0,0 +1,33 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ yama +// @date@ 2006-02-26 +// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=6373 + +// __DSTRESS_DFLAGS__ -version=always + +module dstress.run.s.scope_22_D; + +scope class C{ + char[] toString(){ + return "hallo bug"; + } +} + +int main(){ + version(always){ + scope C c; + c = new C(); + } + + if(c.toString() != "hallo bug"){ + assert(0); + } + + return 0; +} + + + diff -r 709f6451b315 -r 8d5c55d163fd run/s/scope_22_E.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/scope_22_E.d Sun Jul 12 16:44:52 2009 +0200 @@ -0,0 +1,35 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ yama +// @date@ 2006-02-26 +// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=6373 + +// __DSTRESS_DFLAGS__ -version=always + +module dstress.run.s.scope_22_E; + +class C{ + char[] toString(){ + return "hallo bug"; + } +} + +int main(){ + version(always){ + scope C c; + c = new C(); + } + + version(always){ + if(c.toString() != "hallo bug"){ + assert(0); + } + } + + return 0; +} + + + diff -r 709f6451b315 -r 8d5c55d163fd run/s/scope_22_F.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/scope_22_F.d Sun Jul 12 16:44:52 2009 +0200 @@ -0,0 +1,39 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ yama +// @date@ 2006-02-26 +// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=6373 + +// __DSTRESS_DFLAGS__ -version=always + +module dstress.run.s.scope_22_F; + +class C{ + char[] toString(){ + return "hallo bug"; + } +} + +int main(){ + version(always){ + scope C c; + c = new C(); + } + + if((new C()).toString() != "hallo bug"){ + assert(0); + } + + version(always){ + if(c.toString() != "hallo bug"){ + assert(0); + } + } + + return 0; +} + + + diff -r 709f6451b315 -r 8d5c55d163fd run/scope_01.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/scope_01.d Sun Jul 12 16:44:52 2009 +0200 @@ -0,0 +1,28 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Sean Kelly +// @date@ 2004-09-11 +// @uri@ news:chtj6t$24bm$1@digitaldaemon.com +// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=1821 + +module dstress.run.scope_01; + +scope class ScopeClass{ + this(){ + throw new Exception("error msg"); + } + ~this(){ + throw new Exception("should never throw"); + } +} + +int main(){ + try{ + scope ScopeClass ac = new ScopeClass(); + }catch{ + return 0; + } + assert(0); +} diff -r 709f6451b315 -r 8d5c55d163fd run/scope_02.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/scope_02.d Sun Jul 12 16:44:52 2009 +0200 @@ -0,0 +1,49 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Sean Kelly +// @date@ 2004-09-11 + +module dstress.run.scope_02; + +int status; + +scope class ScopeClass{ + void bad(){ + throw new Exception("error msg"); + } + + ~this(){ + if(status == 0){ + status--; + }else{ + status = -100; + } + } +} + +void test(){ + try{ + scope ScopeClass ac = new ScopeClass(); + ac.bad(); + }catch{ + if(status == -1){ + status = 20; + } + } + + if(status != 20){ + throw new Exception("dtor not called"); + } +} + +int main(){ + assert(status == 0); + + test(); + + if(status == 20){ + return 0; + } +} diff -r 709f6451b315 -r 8d5c55d163fd run/scope_03.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/scope_03.d Sun Jul 12 16:44:52 2009 +0200 @@ -0,0 +1,42 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Sean Kelly +// @date@ 2004-09-11 +// @uri@ news:chtj6t$24bm$1@digitaldaemon.com +// @uri@ nntp://digitalmars.com/digitalmars.D.bugs/1821 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1035 + +module dstress.run.scope_03; + +int status; + +scope class ScopeClass{ + ~this(){ + if(0 != status){ + assert(0); + } + status--; + throw new Exception("error msg"); + } +} + +void test(){ + if(0 != status){ + assert(0); + } + scope ScopeClass ac = new ScopeClass(); +} + +int main(){ + try{ + test(); + }catch{ + } + + if(status==-1){ + return 0; + } + assert(0); +} diff -r 709f6451b315 -r 8d5c55d163fd run/scope_04.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/scope_04.d Sun Jul 12 16:44:52 2009 +0200 @@ -0,0 +1,48 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Sean Kelly +// @date@ 2004-09-11 +// @uri@ news:chtj6t$24bm$1@digitaldaemon.com +// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=1821 + +module dstress.run.scope_04; + +int status; + +scope class ScopeClass{ + this(){ + if(0 != status){ + assert(0); + } + status+=2; + } + ~this(){ + if(2 != status){ + assert(0); + } + status--; + throw new Exception("error msg"); + } +} + +void check(){ + scope ScopeClass ac = new ScopeClass(); + throw new Exception("check error"); +} + +int main(){ + if(0 != status){ assert(0); } + try{ + check(); + }catch{ + if(1 != status){ assert(0); } + status-=5; + } + + if(status==-4){ + return 0; + } + assert(0); +} diff -r 709f6451b315 -r 8d5c55d163fd run/scope_06.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/scope_06.d Sun Jul 12 16:44:52 2009 +0200 @@ -0,0 +1,35 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +module dstress.run.scope_06; + +int status; + +scope class A{ + int cond; + + this(int cond){ + this.cond=cond; + } + + ~this(){ + if(cond != status){ + assert(0); + } + status--; + } +} + +void test(){ + scope A a = new A(-1); + scope A b = new A(0); +} + +int main(){ + test(); + + if(status==-2){ + return 0; + } +} diff -r 709f6451b315 -r 8d5c55d163fd run/scope_07.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/scope_07.d Sun Jul 12 16:44:52 2009 +0200 @@ -0,0 +1,48 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Sean Kelly +// @date@ 2005-04-14 +// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=3645 + +module dstress.run.scope_07; + +int status; + +scope class Parent{ +} + +scope class Child : Parent{ + this(){ + if(0 != status){ + assert(0); + } + status=1; + } + + ~this(){ + if(1 != status){ + assert(0); + } + status=2; + } +} + +void test(){ + scope Parent o = new Child(); + if(1 != status){ + assert(0); + } +} + +int main(){ + test(); + + if(status==2){ + return 0; + } + + assert(0); +} + diff -r 709f6451b315 -r 8d5c55d163fd run/scope_08.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/scope_08.d Sun Jul 12 16:44:52 2009 +0200 @@ -0,0 +1,47 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Sean Kelly +// @date@ 2005-04-14 +// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=3645 + +module dstress.run.scope_08; + +int status; + +scope class Parent{ +} + +scope class Child : Parent{ + this(){ + if(0 != status){ + assert(0); + } + status=1; + } + + ~this(){ + if(1 != status){ + assert(0); + } + status=2; + } +} + +void test(){ + scope Child o = new Child(); + if(1 != status){ + assert(0); + } +} + +int main(){ + test(); + + if(status==2){ + return 0; + } + assert(0); +} +