当前位置: 首页>>代码示例>>Python>>正文


Python testcase.get_lib_path函数代码示例

本文整理汇总了Python中testcase.get_lib_path函数的典型用法代码示例。如果您正苦于以下问题:Python get_lib_path函数的具体用法?Python get_lib_path怎么用?Python get_lib_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_lib_path函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_argument625

    def test_argument625(self):
        path = get_lib_path()
        self._test("""Hoge = StructClass.new(\"Hoge\")
Hoge.define_fields([])
lib = load_lib(\"{path}\")
f = lib.load_func(\"print_struct2\", [[\'pointer, Hoge]])
f(nil)""".format(**locals()), "(nil)")
开发者ID:SumiTomohiko,项目名称:Yog,代码行数:7,代码来源:test_ffi.py

示例2: test_argument510

    def test_argument510(self):
        path = get_lib_path()
        self._test("""
lib = load_lib(\"%(path)s\")
f = lib.load_func(\"print_uchar\", [\'uchar])
f(0)
""" % locals(), "0")
开发者ID:SumiTomohiko,项目名称:Yog,代码行数:7,代码来源:test_ffi.py

示例3: test_argument560

    def test_argument560(self):
        path = get_lib_path()
        self._test("""
lib = load_lib(\"%(path)s\")
f = lib.load_func(\"print_char\", [\'char])
f(-128)
""" % locals(), "-128")
开发者ID:SumiTomohiko,项目名称:Yog,代码行数:7,代码来源:test_ffi.py

示例4: test_argument330

    def test_argument330(self):
        path = get_lib_path()
        self._test("""
lib = load_lib(\"%(path)s\")
f = lib.load_func(\"print_int32\", [\'int32])
f(2147483647)
""" % locals(), "2147483647")
开发者ID:SumiTomohiko,项目名称:Yog,代码行数:7,代码来源:test_ffi.py

示例5: test_argument480

    def test_argument480(self):
        path = get_lib_path()
        self._test("""
lib = load_lib(\"%(path)s\")
f = lib.load_func(\"print_double\", [\'double])
f(3.14)
""" % locals(), "3.14")
开发者ID:SumiTomohiko,项目名称:Yog,代码行数:7,代码来源:test_ffi.py

示例6: test_argument180

    def test_argument180(self):
        path = get_lib_path()
        self._test("""
lib = load_lib(\"%(path)s\")
f = lib.load_func(\"print_int16\", [\'int16])
f(32767)
""" % locals(), "32767")
开发者ID:SumiTomohiko,项目名称:Yog,代码行数:7,代码来源:test_ffi.py

示例7: test_argument230

    def test_argument230(self):
        path = get_lib_path()
        self._test("""
lib = load_lib(\"%(path)s\")
f = lib.load_func(\"print_uint32\", [\'uint32])
f(4294967295)
""" % locals(), "4294967295")
开发者ID:SumiTomohiko,项目名称:Yog,代码行数:7,代码来源:test_ffi.py

示例8: test_return110

    def test_return110(self):
        path = get_lib_path()
        self._test("""
lib = load_lib(\"%(path)s\")
f = lib.load_func(\"return_uint64_1\", [], \'uint64)
print(f())
""" % locals(), "1073741824")
开发者ID:SumiTomohiko,项目名称:Yog,代码行数:7,代码来源:test_ffi.py

示例9: test_return190

    def test_return190(self):
        path = get_lib_path()
        self._test("""
lib = load_lib(\"%(path)s\")
f = lib.load_func(\"return_int64_7\", [], \'int64)
print(f())
""" % locals(), "4611686018427387904")
开发者ID:SumiTomohiko,项目名称:Yog,代码行数:7,代码来源:test_ffi.py

示例10: test_argument430

    def test_argument430(self):
        path = get_lib_path()
        self._test("""
lib = load_lib(\"%(path)s\")
f = lib.load_func(\"print_int64\", [\'int64])
f(9223372036854775807)
""" % locals(), "9223372036854775807")
开发者ID:SumiTomohiko,项目名称:Yog,代码行数:7,代码来源:test_ffi.py

示例11: test_argument380

    def test_argument380(self):
        path = get_lib_path()
        self._test("""
lib = load_lib(\"%(path)s\")
f = lib.load_func(\"print_uint64\", [\'uint64])
f(18446744073709551615)
""" % locals(), "18446744073709551615")
开发者ID:SumiTomohiko,项目名称:Yog,代码行数:7,代码来源:test_ffi.py

示例12: do_simple_array_test

    def do_simple_array_test(self, base):
        header = self.get_exact_path(base + ".h")
        src = """from test_h2yog import Foo
foo = Foo.new()
foo.bar[0] = 42
print(foo.bar[0])"""
        self.do_test([header], get_lib_path("empty"), src, "42")
开发者ID:SumiTomohiko,项目名称:Yog,代码行数:7,代码来源:test_h2yog.py

示例13: test_argument640

    def test_argument640(self):
        path = get_lib_path()
        self._test("""
lib = load_lib(\"%(path)s\")
f = lib.load_func(\"print_pointer\", [\'pointer])
f(42)
""" % locals(), "0x2a")
开发者ID:SumiTomohiko,项目名称:Yog,代码行数:7,代码来源:test_ffi.py

示例14: test_argument660

    def test_argument660(self):
        path = get_lib_path()
        self._test("""
lib = load_lib(\"%(path)s\")
f = lib.load_func(\"print_string\", [[\'string, ENCODINGS[\"ascii\"]]])
f(\"foo\")
""" % locals(), "foo")
开发者ID:SumiTomohiko,项目名称:Yog,代码行数:7,代码来源:test_ffi.py

示例15: do_struct_test

    def do_struct_test(self, header, value="42"):
        so = get_lib_path("empty")
        src = """from test_h2yog import Foo
foo = Foo.new()
foo.bar = {value}
print(foo.bar)""".format(**locals())
        self.do_test([self.get_exact_path(header)], so, src, value)
开发者ID:SumiTomohiko,项目名称:Yog,代码行数:7,代码来源:test_h2yog.py


注:本文中的testcase.get_lib_path函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。