From e74666299f9b68e6d2cd6a9c76e8d14b4ea9e2f1 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Sun, 18 Feb 2024 17:26:35 -0500 Subject: [PATCH] Add allocation test for cvnp --- subprojects/robotpy-cscore/tests/test_cv.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/subprojects/robotpy-cscore/tests/test_cv.py b/subprojects/robotpy-cscore/tests/test_cv.py index 3e780545..d63d0cba 100644 --- a/subprojects/robotpy-cscore/tests/test_cv.py +++ b/subprojects/robotpy-cscore/tests/test_cv.py @@ -7,3 +7,12 @@ def test_empty_img(): sink = cs.CvSink("something") _, rimg = sink.grabFrame(img) assert (rimg == img).all() + + +def test_nonempty_img(): + img = np.zeros(shape=(480, 640, 3), dtype=np.uint8) + img2 = np.zeros(shape=(480, 640, 3), dtype=np.uint8) + sink = cs.CvSink("something") + _, img = sink.grabFrame(img) + _, img = sink.grabFrame(img) + assert (img == img2).all()