From bf02f562175050e86214a4298df1b17ac5a975d2 Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Tue, 12 Aug 2025 15:04:25 -0400 Subject: [PATCH] [tests] *Actually* test `char` behavior Context: 90ac202e9a82bd13b9e160686bd14b5a5ddca0e9 Commit 90ac202e 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`. --- .../expected.ji/NonStaticFields/NonStaticField.xml | 2 +- .../NonStaticFields/Xamarin.Test.SomeObject.cs | 8 ++++---- .../expected.ji/StaticFields/StaticField.xml | 2 +- .../expected.ji/StaticFields/Xamarin.Test.SomeObject.cs | 8 ++++---- .../NonStaticFields/Xamarin.Test.SomeObject.cs | 8 ++++---- .../expected.xaji/StaticFields/Xamarin.Test.SomeObject.cs | 8 ++++---- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/generator-Tests/expected.ji/NonStaticFields/NonStaticField.xml b/tests/generator-Tests/expected.ji/NonStaticFields/NonStaticField.xml index 20083ca1b..29e293914 100644 --- a/tests/generator-Tests/expected.ji/NonStaticFields/NonStaticField.xml +++ b/tests/generator-Tests/expected.ji/NonStaticFields/NonStaticField.xml @@ -10,7 +10,7 @@ - + diff --git a/tests/generator-Tests/expected.ji/NonStaticFields/Xamarin.Test.SomeObject.cs b/tests/generator-Tests/expected.ji/NonStaticFields/Xamarin.Test.SomeObject.cs index ec63804a3..0edd8c70f 100644 --- a/tests/generator-Tests/expected.ji/NonStaticFields/Xamarin.Test.SomeObject.cs +++ b/tests/generator-Tests/expected.ji/NonStaticFields/Xamarin.Test.SomeObject.cs @@ -57,15 +57,15 @@ public bool BooleanValue { // Metadata.xml XPath field reference: path="/api/package[@name='xamarin.test']/class[@name='SomeObject']/field[@name='CharValue']" - public bool CharValue { + public char CharValue { get { - const string __id = "CharValue.Z"; + const string __id = "CharValue.C"; - var __v = _members.InstanceFields.GetBooleanValue (__id, this); + var __v = _members.InstanceFields.GetCharValue (__id, this); return __v; } set { - const string __id = "CharValue.Z"; + const string __id = "CharValue.C"; try { _members.InstanceFields.SetValue (__id, this, value); diff --git a/tests/generator-Tests/expected.ji/StaticFields/StaticField.xml b/tests/generator-Tests/expected.ji/StaticFields/StaticField.xml index 186a4660c..fb810c114 100644 --- a/tests/generator-Tests/expected.ji/StaticFields/StaticField.xml +++ b/tests/generator-Tests/expected.ji/StaticFields/StaticField.xml @@ -12,7 +12,7 @@ - + diff --git a/tests/generator-Tests/expected.ji/StaticFields/Xamarin.Test.SomeObject.cs b/tests/generator-Tests/expected.ji/StaticFields/Xamarin.Test.SomeObject.cs index 3b0169b78..8d567d71e 100644 --- a/tests/generator-Tests/expected.ji/StaticFields/Xamarin.Test.SomeObject.cs +++ b/tests/generator-Tests/expected.ji/StaticFields/Xamarin.Test.SomeObject.cs @@ -68,15 +68,15 @@ public static bool BooleanValue { // Metadata.xml XPath field reference: path="/api/package[@name='xamarin.test']/class[@name='SomeObject']/field[@name='CharValue']" - public static bool CharValue { + public static char CharValue { get { - const string __id = "CharValue.Z"; + const string __id = "CharValue.C"; - var __v = _members.StaticFields.GetBooleanValue (__id); + var __v = _members.StaticFields.GetCharValue (__id); return __v; } set { - const string __id = "CharValue.Z"; + const string __id = "CharValue.C"; try { _members.StaticFields.SetValue (__id, value); diff --git a/tests/generator-Tests/expected.xaji/NonStaticFields/Xamarin.Test.SomeObject.cs b/tests/generator-Tests/expected.xaji/NonStaticFields/Xamarin.Test.SomeObject.cs index f4988e1ce..3fa463e60 100644 --- a/tests/generator-Tests/expected.xaji/NonStaticFields/Xamarin.Test.SomeObject.cs +++ b/tests/generator-Tests/expected.xaji/NonStaticFields/Xamarin.Test.SomeObject.cs @@ -61,15 +61,15 @@ public bool BooleanValue { // Metadata.xml XPath field reference: path="/api/package[@name='xamarin.test']/class[@name='SomeObject']/field[@name='CharValue']" [Register ("CharValue")] - public bool CharValue { + public char CharValue { get { - const string __id = "CharValue.Z"; + const string __id = "CharValue.C"; - var __v = _members.InstanceFields.GetBooleanValue (__id, this); + var __v = _members.InstanceFields.GetCharValue (__id, this); return __v; } set { - const string __id = "CharValue.Z"; + const string __id = "CharValue.C"; try { _members.InstanceFields.SetValue (__id, this, value); diff --git a/tests/generator-Tests/expected.xaji/StaticFields/Xamarin.Test.SomeObject.cs b/tests/generator-Tests/expected.xaji/StaticFields/Xamarin.Test.SomeObject.cs index 5fd889924..261590db7 100644 --- a/tests/generator-Tests/expected.xaji/StaticFields/Xamarin.Test.SomeObject.cs +++ b/tests/generator-Tests/expected.xaji/StaticFields/Xamarin.Test.SomeObject.cs @@ -73,15 +73,15 @@ public static bool BooleanValue { // Metadata.xml XPath field reference: path="/api/package[@name='xamarin.test']/class[@name='SomeObject']/field[@name='CharValue']" [Register ("CharValue")] - public static bool CharValue { + public static char CharValue { get { - const string __id = "CharValue.Z"; + const string __id = "CharValue.C"; - var __v = _members.StaticFields.GetBooleanValue (__id); + var __v = _members.StaticFields.GetCharValue (__id); return __v; } set { - const string __id = "CharValue.Z"; + const string __id = "CharValue.C"; try { _members.StaticFields.SetValue (__id, value);