Skip to content

Commit f21b003

Browse files
authored
[tests] *Actually* test char behavior (#1354)
Context: 90ac202 Commit 90ac202 noted two non-blittable types, System.Boolean and System.Char, and attempted to update the unit tests to mention *both* of them, largely for completeness. Unfortunately, the `CharValue` fields were still boolean, meaning System.Char output wasn't actually tested! Update `tests/generator-Tests` so that `CharValue` is a `char`.
1 parent 90ac202 commit f21b003

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

tests/generator-Tests/expected.ji/NonStaticFields/NonStaticField.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<field deprecated="not deprecated" final="true" name="Value" static="false" transient="false" type="int" type-generic-aware="int" visibility="public" volatile="false">
1111
</field>
1212
<field deprecated="not deprecated" final="false" name="BooleanValue" static="false" transient="false" type="boolean" type-generic-aware="int" visibility="public" volatile="false" />
13-
<field deprecated="not deprecated" final="false" name="CharValue" static="false" transient="false" type="boolean" type-generic-aware="int" visibility="public" volatile="false" />
13+
<field deprecated="not deprecated" final="false" name="CharValue" static="false" transient="false" type="char" type-generic-aware="int" visibility="public" volatile="false" />
1414
</class>
1515
</package>
1616
</api>

tests/generator-Tests/expected.ji/NonStaticFields/Xamarin.Test.SomeObject.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ public bool BooleanValue {
5757

5858

5959
// Metadata.xml XPath field reference: path="/api/package[@name='xamarin.test']/class[@name='SomeObject']/field[@name='CharValue']"
60-
public bool CharValue {
60+
public char CharValue {
6161
get {
62-
const string __id = "CharValue.Z";
62+
const string __id = "CharValue.C";
6363

64-
var __v = _members.InstanceFields.GetBooleanValue (__id, this);
64+
var __v = _members.InstanceFields.GetCharValue (__id, this);
6565
return __v;
6666
}
6767
set {
68-
const string __id = "CharValue.Z";
68+
const string __id = "CharValue.C";
6969

7070
try {
7171
_members.InstanceFields.SetValue (__id, this, value);

tests/generator-Tests/expected.ji/StaticFields/StaticField.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<field deprecated="not deprecated" final="false" name="Value2" static="true" transient="false" type="int" type-generic-aware="int" visibility="public" volatile="false">
1313
</field>
1414
<field deprecated="not deprecated" final="false" name="BooleanValue" static="true" transient="false" type="boolean" type-generic-aware="int" visibility="public" volatile="false" />
15-
<field deprecated="not deprecated" final="false" name="CharValue" static="true" transient="false" type="boolean" type-generic-aware="int" visibility="public" volatile="false" />
15+
<field deprecated="not deprecated" final="false" name="CharValue" static="true" transient="false" type="char" type-generic-aware="int" visibility="public" volatile="false" />
1616
</class>
1717
</package>
1818
</api>

tests/generator-Tests/expected.ji/StaticFields/Xamarin.Test.SomeObject.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ public static bool BooleanValue {
6868

6969

7070
// Metadata.xml XPath field reference: path="/api/package[@name='xamarin.test']/class[@name='SomeObject']/field[@name='CharValue']"
71-
public static bool CharValue {
71+
public static char CharValue {
7272
get {
73-
const string __id = "CharValue.Z";
73+
const string __id = "CharValue.C";
7474

75-
var __v = _members.StaticFields.GetBooleanValue (__id);
75+
var __v = _members.StaticFields.GetCharValue (__id);
7676
return __v;
7777
}
7878
set {
79-
const string __id = "CharValue.Z";
79+
const string __id = "CharValue.C";
8080

8181
try {
8282
_members.StaticFields.SetValue (__id, value);

tests/generator-Tests/expected.xaji/NonStaticFields/Xamarin.Test.SomeObject.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ public bool BooleanValue {
6161

6262
// Metadata.xml XPath field reference: path="/api/package[@name='xamarin.test']/class[@name='SomeObject']/field[@name='CharValue']"
6363
[Register ("CharValue")]
64-
public bool CharValue {
64+
public char CharValue {
6565
get {
66-
const string __id = "CharValue.Z";
66+
const string __id = "CharValue.C";
6767

68-
var __v = _members.InstanceFields.GetBooleanValue (__id, this);
68+
var __v = _members.InstanceFields.GetCharValue (__id, this);
6969
return __v;
7070
}
7171
set {
72-
const string __id = "CharValue.Z";
72+
const string __id = "CharValue.C";
7373

7474
try {
7575
_members.InstanceFields.SetValue (__id, this, value);

tests/generator-Tests/expected.xaji/StaticFields/Xamarin.Test.SomeObject.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ public static bool BooleanValue {
7373

7474
// Metadata.xml XPath field reference: path="/api/package[@name='xamarin.test']/class[@name='SomeObject']/field[@name='CharValue']"
7575
[Register ("CharValue")]
76-
public static bool CharValue {
76+
public static char CharValue {
7777
get {
78-
const string __id = "CharValue.Z";
78+
const string __id = "CharValue.C";
7979

80-
var __v = _members.StaticFields.GetBooleanValue (__id);
80+
var __v = _members.StaticFields.GetCharValue (__id);
8181
return __v;
8282
}
8383
set {
84-
const string __id = "CharValue.Z";
84+
const string __id = "CharValue.C";
8585

8686
try {
8787
_members.StaticFields.SetValue (__id, value);

0 commit comments

Comments
 (0)