Beispiel #1
0
    def test14OpaquePointerPassing(self):
        """Test passing around of opaque pointers"""

        import ROOT

        s = TString("Hello World!")
        co = AsCObject(s)

        ad = addressof(s)

        self.assert_(s == BindObject(co, s.__class__))
        self.assert_(s == BindObject(co, "TString"))
        self.assert_(s == BindObject(ad, s.__class__))
        self.assert_(s == BindObject(ad, "TString"))
Beispiel #2
0
    def test14OpaquePointerPassing(self):
        """Test passing around of opaque pointers"""

        import ROOT

        s = TString("Hello World!")
        co = AsCObject(s)

        if self.exp_pyroot:
            # In new Cppyy, addressof returns an integer/long
            ad = AddressOf(s)
        else:
            ad = AddressOf(s)[0]

        self.assert_(s == BindObject(co, s.__class__))
        self.assert_(s == BindObject(co, "TString"))
        self.assert_(s == BindObject(ad, s.__class__))
        self.assert_(s == BindObject(ad, "TString"))