enum attribute check added in

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7186 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-05-12 20:40:38 +00:00
commit 53def140aa

View file

@ -11,8 +11,7 @@ public class runme
// cstype typemap attributechecks // cstype typemap attributechecks
// //
// Global function cstype typemap attributes check // Global function cstype typemap attributes check
csharp_attributes csharpattributes = new csharp_attributes(); Type globaltype = typeof(csharp_attributes);
Type globaltype = csharpattributes.GetType();
{ {
MethodInfo member = (MethodInfo)globaltype.GetMember("GlobalFunction")[0]; MethodInfo member = (MethodInfo)globaltype.GetMember("GlobalFunction")[0];
if (Attribute.GetCustomAttribute(member, typeof(IntOutAttribute)) == null) if (Attribute.GetCustomAttribute(member, typeof(IntOutAttribute)) == null)
@ -32,8 +31,7 @@ public class runme
} }
// Non-static method cstype typemap attributes check // Non-static method cstype typemap attributes check
Stations testClass = new Stations(20); Type type = typeof(Stations);
Type type = testClass.GetType();
{ {
MethodInfo member = (MethodInfo)type.GetMember("Reading")[0]; MethodInfo member = (MethodInfo)type.GetMember("Reading")[0];
if (Attribute.GetCustomAttribute(member, typeof(IntOutAttribute)) == null) if (Attribute.GetCustomAttribute(member, typeof(IntOutAttribute)) == null)
@ -72,8 +70,7 @@ public class runme
// imtype typemap attributechecks // imtype typemap attributechecks
// //
// Global function imtype typemap attributes check // Global function imtype typemap attributes check
csharp_attributesPINVOKE csPinvoke = new csharp_attributesPINVOKE(); Type imclasstype = typeof(csharp_attributesPINVOKE);
Type imclasstype = csPinvoke.GetType();
{ {
MethodInfo member = (MethodInfo)imclasstype.GetMember("GlobalFunction")[0]; MethodInfo member = (MethodInfo)imclasstype.GetMember("GlobalFunction")[0];
if (Attribute.GetCustomAttribute(member, typeof(IntegerOutAttribute)) == null) if (Attribute.GetCustomAttribute(member, typeof(IntegerOutAttribute)) == null)
@ -113,8 +110,7 @@ public class runme
// //
// attributes feature // attributes feature
// //
MoreStations moreStations = new MoreStations(); Type moretype = typeof(MoreStations);
Type moretype = moreStations.GetType();
// Constructor attributes feature check // Constructor attributes feature check
{ {
@ -177,14 +173,11 @@ public class runme
} }
// Enum csattribute typemap // Enum csattribute typemap
{ {
/* TODO Type cymrutype = typeof(Cymru);
Cymru cymru = new Cymru();
Type cymrutype = Cymru.GetType();
Object[] attribs = cymrutype.GetCustomAttributes(true); Object[] attribs = cymrutype.GetCustomAttributes(true);
Eurostar3Attribute tgv = (Eurostar3Attribute)attribs[0]; Eurostar3Attribute tgv = (Eurostar3Attribute)attribs[0];
if (tgv == null) if (tgv == null)
throw new Exception("No attribute for Cymru"); throw new Exception("No attribute for Cymru");
*/
} }
} }
} }