Example #1
0
li_std_wstring.test_const_pointer(None)

try:
    li_std_wstring.test_value(None)
    raise RuntimeError("NULL check failed")
except TypeError as e:
    pass

try:
    li_std_wstring.test_reference(None)
    raise RuntimeError("NULL check failed")
except ValueError as e:
    if "invalid null reference" not in str(e):
        raise RuntimeError("Missing text {}".format(e))
try:
    li_std_wstring.test_const_reference(None)
    raise RuntimeError("NULL check failed")
except ValueError as e:
    if "invalid null reference" not in str(e):
        raise RuntimeError("Missing text {}".format(e))

x = "hello"
check_equal(li_std_wstring.test_const_reference(x), x)

s = "abc"
if not li_std_wstring.test_equal_abc(s):
    raise RuntimeError("Not equal {}".format(s))

try:
    li_std_wstring.test_throw
except RuntimeError as e:
Example #2
0
if li_std_wstring.test_wcvalue(x) != x:
    print li_std_wstring.test_wcvalue(x)
    raise RuntimeError, "bad string mapping"

x = u"hello"
if li_std_wstring.test_ccvalue(x) != x:
    raise RuntimeError, "bad string mapping"

if li_std_wstring.test_cvalue(x) != x:
    raise RuntimeError, "bad string mapping"

if li_std_wstring.test_value(x) != x:
    print x, li_std_wstring.test_value(x)
    raise RuntimeError, "bad string mapping"

if li_std_wstring.test_const_reference(x) != x:
    raise RuntimeError, "bad string mapping"

s = li_std_wstring.wstring(u"he")
s = s + u"llo"

if s != x:
    print s, x
    raise RuntimeError, "bad string mapping"

if s[1:4] != x[1:4]:
    raise RuntimeError, "bad string mapping"

if li_std_wstring.test_value(s) != x:
    raise RuntimeError, "bad string mapping"
if li_std_wstring.test_wcvalue(x) != x:
  print li_std_wstring.test_wcvalue(x)
  raise RuntimeError, "bad string mapping"

x=u"hello"
if li_std_wstring.test_ccvalue(x) != x:
  raise RuntimeError, "bad string mapping"

if li_std_wstring.test_cvalue(x) != x:
  raise RuntimeError, "bad string mapping"

if li_std_wstring.test_value(x) != x:
  print x, li_std_wstring.test_value(x)
  raise RuntimeError, "bad string mapping"

if li_std_wstring.test_const_reference(x) != x:
  raise RuntimeError, "bad string mapping"


s = li_std_wstring.wstring(u"he")
s = s + u"llo"

if s != x:
  print s, x
  raise RuntimeError, "bad string mapping"

if s[1:4] != x[1:4]:
  raise RuntimeError, "bad string mapping"

if li_std_wstring.test_value(s) != x:
  raise RuntimeError, "bad string mapping"