Add test for wchar_t members to li_std_string.i
This commit is contained in:
parent
beb1d8498d
commit
6db3ab0d05
3 changed files with 18 additions and 0 deletions
|
|
@ -75,6 +75,13 @@ public class runme
|
|||
check_equal(li_std_wstring.test_ccvalue(x), "abc");
|
||||
check_equal(li_std_wstring.test_wchar_overload(x), "abc");
|
||||
|
||||
// Member variables
|
||||
var s = new wchar_test_struct();
|
||||
s.wchar_t_member = h;
|
||||
check_equal(s.wchar_t_member, h);
|
||||
s.wchar_t_ptr_member = x;
|
||||
check_equal(s.wchar_t_ptr_member, "abc");
|
||||
|
||||
{
|
||||
// Unicode strings
|
||||
string[] test_strings = {
|
||||
|
|
|
|||
|
|
@ -70,6 +70,11 @@ size_t size_wstring(const std::wstring& s) {
|
|||
return s.size();
|
||||
}
|
||||
|
||||
struct wchar_test_struct {
|
||||
wchar_t wchar_t_member;
|
||||
wchar_t* wchar_t_ptr_member;
|
||||
};
|
||||
|
||||
%}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -54,6 +54,12 @@ check_equal(li_std_wstring.test_value(x), x)
|
|||
check_equal(li_std_wstring.test_ccvalue(x), "abc")
|
||||
check_equal(li_std_wstring.test_wchar_overload(x), "abc")
|
||||
|
||||
ts = li_std_wstring.wchar_test_struct()
|
||||
ts.wchar_t_member = h
|
||||
check_equal(ts.wchar_t_member, h)
|
||||
ts.wchar_t_ptr_member = s
|
||||
check_equal(ts.wchar_t_ptr_member, s)
|
||||
|
||||
################### Python specific
|
||||
|
||||
# Byte strings only converted in Python 2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue