mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 15:53:55 -04:00
express: Fix PointerToArray comparison operator
This commit is contained in:
parent
b2462c1d8c
commit
c81c506df3
@ -77,6 +77,12 @@ protected:
|
||||
|
||||
PUBLISHED:
|
||||
INLINE ~PointerToArrayBase();
|
||||
|
||||
#ifdef CPPPARSER
|
||||
// These are implemented in PointerToVoid, but expose them here.
|
||||
INLINE bool operator == (const PointerToArrayBase<Element> &other) const;
|
||||
INLINE bool operator != (const PointerToArrayBase<Element> &other) const;
|
||||
#endif
|
||||
};
|
||||
|
||||
#include "pointerToArrayBase.I"
|
||||
|
@ -1,3 +1,26 @@
|
||||
def test_pta_float_compare():
|
||||
from panda3d.core import PTA_float, CPTA_float
|
||||
|
||||
# Two null PTAs
|
||||
assert PTA_float() == PTA_float()
|
||||
assert not (PTA_float() != PTA_float())
|
||||
|
||||
# Two non-null PTAs
|
||||
assert PTA_float([1]) != PTA_float([1])
|
||||
assert not (PTA_float([1]) == PTA_float([1]))
|
||||
|
||||
# A copy of a PTA
|
||||
pta = PTA_float([1])
|
||||
assert pta == PTA_float(pta)
|
||||
assert not (pta != PTA_float(pta))
|
||||
|
||||
# A const copy of a PTA
|
||||
pta = PTA_float([1])
|
||||
cpta = CPTA_float(pta)
|
||||
assert pta == cpta
|
||||
assert not (pta != cpta)
|
||||
|
||||
|
||||
def test_pta_float_pickle():
|
||||
from panda3d.core import PTA_float
|
||||
from direct.stdpy.pickle import dumps, loads, HIGHEST_PROTOCOL
|
||||
|
Loading…
x
Reference in New Issue
Block a user