Tests that simple POD classes can be constructed using C++11 brace initialization
()
| 393 | |
| 394 | |
| 395 | def test_brace_initialization(): |
| 396 | """Tests that simple POD classes can be constructed using C++11 brace initialization""" |
| 397 | a = m.BraceInitialization(123, "test") |
| 398 | assert a.field1 == 123 |
| 399 | assert a.field2 == "test" |
| 400 | |
| 401 | # Tests that a non-simple class doesn't get brace initialization (if the |
| 402 | # class defines an initializer_list constructor, in particular, it would |
| 403 | # win over the expected constructor). |
| 404 | b = m.NoBraceInitialization([123, 456]) |
| 405 | assert b.vec == [123, 456] |
| 406 | |
| 407 | |
| 408 | @pytest.mark.xfail("env.PYPY or env.GRAALPY") |
nothing calls this directly
no test coverage detected