Browse Source

tests: add test for setting near distance to infinitiy

rdb 7 years ago
parent
commit
71e18eb960
1 changed files with 5 additions and 0 deletions
  1. 5 0
      tests/display/test_depth_buffer.py

+ 5 - 0
tests/display/test_depth_buffer.py

@@ -113,6 +113,11 @@ def test_depth_far_inf(depth_region):
     assert 0.99 > render_depth_pixel(depth_region, 10.0, near=1, far=inf, clear=1.0)
 
 
+def test_depth_near_inf(depth_region):
+    inf = float("inf")
+    assert 0.01 < render_depth_pixel(depth_region, 10.0, near=inf, far=1, clear=0.0)
+
+
 def test_depth_clipping(depth_region):
     # Get the actual depth resulting from the clear value.
     clr = render_depth_pixel(depth_region, None, near=1, far=10, clear=0.5)