[ruby] add a few tests for std::wstring
This commit is contained in:
parent
904bc2ad52
commit
bfe7204576
3 changed files with 27 additions and 0 deletions
|
|
@ -19,6 +19,7 @@ CPP_TEST_CASES = \
|
||||||
li_std_queue \
|
li_std_queue \
|
||||||
li_std_set \
|
li_std_set \
|
||||||
li_std_stack \
|
li_std_stack \
|
||||||
|
li_std_wstring \
|
||||||
primitive_types \
|
primitive_types \
|
||||||
ruby_keywords \
|
ruby_keywords \
|
||||||
ruby_minherit_shared_ptr \
|
ruby_minherit_shared_ptr \
|
||||||
|
|
|
||||||
22
Examples/test-suite/ruby/li_std_wstring_runme.rb
Normal file
22
Examples/test-suite/ruby/li_std_wstring_runme.rb
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
require 'swig_assert'
|
||||||
|
require 'li_std_wstring'
|
||||||
|
|
||||||
|
x = "h"
|
||||||
|
|
||||||
|
swig_assert_equal("Li_std_wstring.test_value(x)", "x", binding)
|
||||||
|
|
||||||
|
|
||||||
|
x = "abc"
|
||||||
|
|
||||||
|
swig_assert_equal("Li_std_wstring.test_value(x)", "x", binding)
|
||||||
|
|
||||||
|
x = "hello"
|
||||||
|
|
||||||
|
swig_assert_equal("Li_std_wstring.test_const_reference(x)", "x", binding)
|
||||||
|
|
||||||
|
a = Li_std_wstring::A.new(x)
|
||||||
|
|
||||||
|
swig_assert_equal("Li_std_wstring.test_value(a)", "x", binding)
|
||||||
|
|
||||||
|
swig_assert_equal("Li_std_wstring.test_value(x)", "x", binding)
|
||||||
|
|
@ -55,6 +55,10 @@ SWIGINTERNINLINE VALUE
|
||||||
|
|
||||||
#if !defined(SWIG_STD_WSTRING)
|
#if !defined(SWIG_STD_WSTRING)
|
||||||
|
|
||||||
|
%traits_swigtype(std::basic_string<wchar_t>);
|
||||||
|
%fragment(SWIG_Traits_frag(std::basic_string<wchar_t>));
|
||||||
|
|
||||||
|
|
||||||
%fragment(SWIG_AsPtr_frag(std::basic_string<wchar_t>),"header",
|
%fragment(SWIG_AsPtr_frag(std::basic_string<wchar_t>),"header",
|
||||||
fragment="SWIG_AsWCharPtrAndSize") {
|
fragment="SWIG_AsWCharPtrAndSize") {
|
||||||
SWIGINTERN int
|
SWIGINTERN int
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue