From e5b75debed8ac03203288d8afed4d82b15740539 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Sat, 19 Apr 2025 09:50:18 +0800 Subject: [PATCH] add test for destroy camera --- thermion_dart/test/camera_tests.dart | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/thermion_dart/test/camera_tests.dart b/thermion_dart/test/camera_tests.dart index 5e41a41f..fef5e853 100644 --- a/thermion_dart/test/camera_tests.dart +++ b/thermion_dart/test/camera_tests.dart @@ -9,19 +9,25 @@ void main() async { final testHelper = TestHelper("camera"); await testHelper.setup(); group('camera', () { + test('create/destroy camera', () async { + await testHelper.withViewer((viewer) async { + final camera = await viewer.createCamera(); + await camera.destroy(); + }); + }); + test('model matrix', () async { await testHelper.withViewer((viewer) async { final camera = await viewer.getActiveCamera(); await camera.setModelMatrix(Matrix4.translation(Vector3.all(4.0))); var matrix = await camera.getModelMatrix(); - + await camera.lookAt(Vector3(2.0, 2.0, 2.0)); matrix = await camera.getModelMatrix(); var position = await camera.getPosition(); expect(position.x, 2.0); expect(position.y, 2.0); expect(position.z, 2.0); - }); });