Skip to content

1838 Use Python buffer protocol when converting Python objects to .NET arrays #2372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove bytearray to char test
Currently not handled by the buffer copying mechanism anyway
  • Loading branch information
chickenservice committed May 5, 2024
commit 2e2866dc7b47c52001f81c2baba28d975f6a39da
13 changes: 0 additions & 13 deletions src/embed_tests/TestConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,19 +251,6 @@ public void TestConvertBytearrayToManaged()
Assert.AreEqual(testValue, convertedValue);
}

[Test]
public void TestConvertCharArrayToManaged()
{
var testValue = new char[] { 't', 'e', 's', 't' };
using var str = PythonEngine.Eval("'test'.encode('ascii')");

object convertedValue;
var converted = Converter.ToManaged(str, typeof(char[]), out convertedValue, false);

Assert.IsTrue(converted);
Assert.AreEqual(testValue, convertedValue);
}

[Test]
[TestCaseSource(typeof(Arrays))]
public void TestConvertArrayToManaged(string arrayType, Type t, object expected)
Expand Down
Loading