Test a basic C++ Hello World program which prints "Hello World!" to the console using std::cout.
(self)
| 21 | class 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. |