From c0d10604228bcd4d4b344241956625e9283b08c1 Mon Sep 17 00:00:00 2001 From: Danilo Piparo Date: Fri, 20 Nov 2026 17:21:38 +0100 Subject: [PATCH] [test] Add test for #17157 --- roottest/python/cpp/PyROOT_advancedtests.py | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/roottest/python/cpp/PyROOT_advancedtests.py b/roottest/python/cpp/PyROOT_advancedtests.py index 83388699aa067..f0973e9e8ce8c 100644 --- a/roottest/python/cpp/PyROOT_advancedtests.py +++ b/roottest/python/cpp/PyROOT_advancedtests.py @@ -26,6 +26,7 @@ 'Cpp10StandardExceptions', 'Cpp12NamespaceLazyFunctions', 'Cpp14CopyConstructorOrdering', + 'Cpp15StdComplex' ] gROOT.LoadMacro( "AdvancedCpp.C+" ) @@ -221,6 +222,27 @@ def test3NoUserCCtor( self ): self.assertEqual( m3.m_d1, m2.m_d1 ) self.assertEqual( m3.m_d2, m2.m_d2 ) +# Tests #17157 +class Cpp15StdComplex( MyTestCase ): + def testSum( self ): + """Behaviour of std complex in operations""" + import cppyy + c = cppyy.gbl.std.complex['double'](1, 1) + try: + s = 1 + c + except NotImplementedError: + pass + + try: + s = 1. + c + except NotImplementedError: + pass + + try: + s = c + 1. + except NotImplementedError: + pass + ## actual test run if __name__ == '__main__':