docstr: Test PyUnicode_AsUCS4()
docstr_tok: ["Test","PyUnicode_AsUCS4","(",")"]
code: def test_asucs4(self):
      """Test PyUnicode_AsUCS4()"""
      from _testcapi import unicode_asucs4
  
      for s in [
          "abc",
          "\xa1\xa2",
          "\u4f60\u597d",
          "a\U0001f600",
          "a\ud800b\udfffc",
          "\ud834\udd1e",
      ]:
          l = len(s)
          self.assertEqual(unicode_asucs4(s, l, 1), s + "\0")
          self.assertEqual(unicode_asucs4(s, l, 0), s + "\uffff")
          self.assertEqual(unicode_asucs4(s, l + 1, 1), s + "\0\uffff")
          self.assertEqual(unicode_asucs4(s, l + 1, 0), s + "\0\uffff")
          self.assertRaises(SystemError, unicode_asucs4, s, l - 1, 1)
          self.assertRaises(SystemError, unicode_asucs4, s, l - 2, 0)
          s = "\0".join([s, s])
          self.assertEqual(unicode_asucs4(s, len(s), 1), s + "\0")
          self.assertEqual(unicode_asucs4(s, len(s), 0), s + "\uffff")
  
imports: import unittest
  import sys
  from test import support
  from test.support import import_helper
label_desc: Use image node_id 20 for calling the CAPITest obj's underlying member method code with example usage: obj.test_asucs4() without return types