示例#1
0
    def test02NULLPtrPassing(self):
        """Allow the programmer to pass NULL in certain cases"""

        nullptr = ROOT.nullptr

        self.assertNotEqual(nullptr, 0)
        self.assertRaises(TypeError, TGraphErrors, 0, 0, 0)

        g = TGraphErrors(0, nullptr, nullptr)
        self.assertEqual(round(g.GetMean(), 8), 0.0)
示例#2
0
   def test02NULLPtrPassing( self ):
      """Allow the programmer to pass NULL in certain cases"""
      
      nullptr = ROOT.nullptr

      self.assertNotEqual( nullptr, 0 )
      if os.environ.get('LEGACY_PYROOT') == 'True':
         # In new Cppyy, TGraphErrors(0,0,0) is accepted.
         # I.e. it is allowed to pass 0 when the argument is of pointer type.
         self.assertRaises( TypeError, TGraphErrors, 0, 0, 0 )

      g = TGraphErrors( 0, nullptr, nullptr )
      self.assertEqual( round( g.GetMean(), 8 ), 0.0 )