|
| 1 | +# Copyright 2014-2016 Insight Software Consortium. |
| 2 | +# Copyright 2004-2009 Roman Yakovenko. |
| 3 | +# Distributed under the Boost Software License, Version 1.0. |
| 4 | +# See http://www.boost.org/LICENSE_1_0.txt |
| 5 | + |
| 6 | +import unittest |
| 7 | +import parser_test_case |
| 8 | + |
| 9 | +from pygccxml import parser |
| 10 | +from pygccxml import declarations |
| 11 | + |
| 12 | + |
| 13 | +class Test(parser_test_case.parser_test_case_t): |
| 14 | + |
| 15 | + def __init__(self, *args): |
| 16 | + parser_test_case.parser_test_case_t.__init__(self, *args) |
| 17 | + self.header = "test_stream.hpp" |
| 18 | + self.config.cflags = "-std=c++11" |
| 19 | + |
| 20 | + def test_stream_non_copyable(self): |
| 21 | + """ |
| 22 | + Test find_noncopyable_vars |
| 23 | +
|
| 24 | + See #71 |
| 25 | +
|
| 26 | + find_noncopyable_vars is throwing: |
| 27 | + RuntimeError: maximum recursion depth exceeded while |
| 28 | + calling a Python object |
| 29 | + """ |
| 30 | + decls = parser.parse([self.header], self.config) |
| 31 | + global_ns = declarations.get_global_namespace(decls) |
| 32 | + |
| 33 | + test_ns = global_ns.namespace('Test2') |
| 34 | + cls = test_ns.class_('FileStreamDataStream') |
| 35 | + declarations.type_traits_classes.find_noncopyable_vars(cls) |
| 36 | + |
| 37 | +def create_suite(): |
| 38 | + suite = unittest.TestSuite() |
| 39 | + suite.addTest(unittest.makeSuite(Test)) |
| 40 | + return suite |
| 41 | + |
| 42 | + |
| 43 | +def run_suite(): |
| 44 | + unittest.TextTestRunner(verbosity=2).run(create_suite()) |
| 45 | + |
| 46 | +if __name__ == "__main__": |
| 47 | + run_suite() |
0 commit comments