MCPcopy Index your code
hub / github.com/qilingframework/qiling / test_cpp_helloworld

Method test_cpp_helloworld

tests/test_windows_cpp_x8664.py:23–36  ·  view source on GitHub ↗

Test a basic C++ Hello World program which prints "Hello World!" to the console using std::cout.

(self)

Source from the content-addressed store, hash-verified

21class CppTests_x8664(unittest.TestCase):
22
23 def test_cpp_helloworld(self):
24 """ Test a basic C++ Hello World program which prints "Hello World!"
25 to the console using std::cout.
26 """
27 ql = Qiling(["../examples/rootfs/x8664_windows/bin/except/CppHelloWorld.exe"], "../examples/rootfs/x8664_windows/", verbose=QL_VERBOSE.DEFAULT)
28
29 ql.os.stdout = pipe.SimpleStringBuffer()
30
31 ql.run()
32
33 conout = ql.os.stdout.read()
34 self.assertEqual(conout, b"Hello World!\x0d\x0a")
35
36 del ql
37
38 def test_cpp_types(self):
39 """ This program tests several C++ type-related runtime features.

Callers

nothing calls this directly

Calls 3

runMethod · 0.95
QilingClass · 0.90
readMethod · 0.45

Tested by

no test coverage detected