[D] Ported r12557 (char enum values).

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12630 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
David Nadlinger 2011-04-10 16:10:42 +00:00
commit f9def91f30
3 changed files with 57 additions and 0 deletions

View file

@ -3,6 +3,7 @@ module enum_thorough_runme;
import enum_thorough.enum_thorough;
import enum_thorough.AnonStruct;
import enum_thorough.colour;
import enum_thorough.DifferentTypes;
import enum_thorough.FirStruct;
import enum_thorough.HairStruct;
import enum_thorough.IgnoreTest;
@ -421,4 +422,26 @@ void main() {
if (cast(int)repeatTest(repeat.llast) != 3) throw new Exception("repeatTest 5 failed");
if (cast(int)repeatTest(repeat.end) != 3) throw new Exception("repeatTest 6 failed");
}
// different types
{
if (cast(int)differentTypesTest(DifferentTypes.typeint) != 10) throw new Exception("differentTypes 1 failed");
if (cast(int)differentTypesTest(DifferentTypes.typeboolfalse) != 0) throw new Exception("differentTypes 2 failed");
if (cast(int)differentTypesTest(DifferentTypes.typebooltrue) != 1) throw new Exception("differentTypes 3 failed");
if (cast(int)differentTypesTest(DifferentTypes.typebooltwo) != 2) throw new Exception("differentTypes 4 failed");
if (cast(int)differentTypesTest(DifferentTypes.typechar) != 'C') throw new Exception("differentTypes 5 failed");
if (cast(int)differentTypesTest(DifferentTypes.typedefaultint) != 'D') throw new Exception("differentTypes 6 failed");
int global_enum = global_typeint;
if (cast(int)globalDifferentTypesTest(global_enum) != 10) throw new Exception("global differentTypes 1 failed");
global_enum = global_typeboolfalse;
if (cast(int)globalDifferentTypesTest(global_enum) != 0) throw new Exception("global differentTypes 2 failed");
global_enum = global_typebooltrue;
if (cast(int)globalDifferentTypesTest(global_enum) != 1) throw new Exception("global differentTypes 3 failed");
global_enum = global_typebooltwo;
if (cast(int)globalDifferentTypesTest(global_enum) != 2) throw new Exception("global differentTypes 4 failed");
global_enum = global_typechar;
if (cast(int)globalDifferentTypesTest(global_enum) != 'C') throw new Exception("global differentTypes 5 failed");
global_enum = global_typedefaultint;
if (cast(int)globalDifferentTypesTest(global_enum) != 'D') throw new Exception("global differentTypes 6 failed");
}
}