From 537745666c9b37889fb56298aa30ccb7c62f068c 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 (cherry picked from commit f2c4e0b269d1bf1bdef9fe6f336c41570053b3b5) --- 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__':