mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 08:15:18 -04:00
tests: add unit tests for ShaderInput comparison (#827)
This commit is contained in:
parent
fe1ecd5e79
commit
b60c3e6c7e
44
tests/pgraph/test_shaderinput.py
Normal file
44
tests/pgraph/test_shaderinput.py
Normal file
@ -0,0 +1,44 @@
|
||||
from panda3d.core import ShaderInput, Vec4
|
||||
|
||||
|
||||
def test_shaderinput_vector_compare():
|
||||
i0 = ShaderInput('a', Vec4(0, 0, 0, 0))
|
||||
i1 = ShaderInput('a', Vec4(1e-9, 0, 0, 0))
|
||||
i2 = ShaderInput('a', Vec4(1e-8, 0, 0, 0))
|
||||
i3 = ShaderInput('a', Vec4(2, 0, 0, 0))
|
||||
|
||||
assert i0 == i0
|
||||
assert i1 == i1
|
||||
assert i2 == i2
|
||||
assert i3 == i3
|
||||
|
||||
assert i0 != i1
|
||||
assert i0 != i2
|
||||
assert i0 != i3
|
||||
assert i1 != i2
|
||||
assert i2 != i3
|
||||
assert i1 != i3
|
||||
|
||||
assert not i0 < i0
|
||||
assert not i1 < i1
|
||||
assert not i2 < i2
|
||||
assert not i3 < i3
|
||||
|
||||
assert i0 < i1
|
||||
assert i0 < i2
|
||||
assert i0 < i3
|
||||
assert i1 < i2
|
||||
assert i2 < i3
|
||||
assert i1 < i3
|
||||
|
||||
assert not i0 > i0
|
||||
assert not i1 > i1
|
||||
assert not i2 > i2
|
||||
assert not i3 > i3
|
||||
|
||||
assert i3 > i1
|
||||
assert i2 > i1
|
||||
assert i3 > i2
|
||||
assert i1 > i0
|
||||
assert i2 > i0
|
||||
assert i3 > i0
|
Loading…
x
Reference in New Issue
Block a user