Skip to content

Commit

Permalink
In ilasm/tests:
Browse files Browse the repository at this point in the history
2005-12-14  Ankit Jain  <jankit@novell.com>

	* dotted-names.il: Add test for class with no explicit namespace.

In ilasm/codegen:
2005-12-14  Ankit Jain  <jankit@novell.com>

	* TypeDef.cs (TypeDef.ctor): name_space can be null.


svn path=/trunk/mcs/; revision=54348
  • Loading branch information
radical committed Dec 14, 2005
1 parent ec6a49b commit 112c395
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 11 deletions.
4 changes: 4 additions & 0 deletions mcs/ilasm/codegen/ChangeLog
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,7 @@
2005-12-14 Ankit Jain <jankit@novell.com>

* TypeDef.cs (TypeDef.ctor): name_space can be null.

2005-12-13 Ankit Jain <jankit@novell.com> 2005-12-13 Ankit Jain <jankit@novell.com>


* TypeDef.cs (TypeDef.ctor): Ensure that 'name' contains only the last part * TypeDef.cs (TypeDef.ctor): Ensure that 'name' contains only the last part
Expand Down
20 changes: 12 additions & 8 deletions mcs/ilasm/codegen/TypeDef.cs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -72,14 +72,18 @@ public TypeDef (PEAPI.TypeAttr attr, string name_space, string name,
is_value_class = false; is_value_class = false;
is_enum_class = false; is_enum_class = false;


int lastdot = name.LastIndexOf ('.');
if (lastdot >= 0) { int lastdot = name.LastIndexOf ('.');
this.name_space = name_space + "." + name.Substring (0, lastdot); if (lastdot >= 0) {
this.name = name.Substring (lastdot + 1); if (name_space == null || name_space == "")
} else { this.name_space = name.Substring (0, lastdot);
this.name_space = name_space; else
this.name = name; this.name_space = name_space + "." + name.Substring (0, lastdot);
} this.name = name.Substring (lastdot + 1);
} else {
this.name_space = name_space;
this.name = name;
}
} }


public string Name { public string Name {
Expand Down
4 changes: 4 additions & 0 deletions mcs/ilasm/tests/ChangeLog
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,7 @@
2005-12-14 Ankit Jain <jankit@novell.com>

* dotted-names.il: Add test for class with no explicit namespace.

2005-12-13 Ankit Jain <jankit@novell.com> 2005-12-13 Ankit Jain <jankit@novell.com>


* dotted-names.il: New. Test for dotted names in namespace, class. * dotted-names.il: New. Test for dotted names in namespace, class.
Expand Down
17 changes: 14 additions & 3 deletions mcs/ilasm/tests/dotted-names.il
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,14 @@
//Tests dotted names (namespace, class names) //Tests dotted names (namespace, class names)
//It should emit namespace = A.B.C and type name = D //It should emit namespace = A.B.C and type name = D
//For E.F, namespace = E, name = F


//.assembly extern mscorlib .assembly extern mscorlib
//{ {
//} }

.assembly Output
{
}


.module Output .module Output


Expand All @@ -15,3 +20,9 @@
} }


} }

.class public auto autochar sealed beforefieldinit E.F
extends [mscorlib]System.Object
{
}

0 comments on commit 112c395

Please sign in to comment.