From 4a27a2e95aa1a2312ad17404d7ab236b2fa6f1b7 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Tue, 9 Oct 2012 15:43:10 +0200 Subject: Fix #150: Add "frames-per-second" property Right now, there is only information for the DIMAX camera about the actual inherent system delay. For all other cameras fps = 1. / t_exp. --- test/test-mock.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/test-mock.c') diff --git a/test/test-mock.c b/test/test-mock.c index 711364d..17af329 100644 --- a/test/test-mock.c +++ b/test/test-mock.c @@ -148,6 +148,26 @@ test_base_properties (Fixture *fixture, gconstpointer data) g_free (properties); } +static void +test_fps_property (Fixture *fixture, gconstpointer data) +{ + gdouble frames_per_second; + gdouble exposure_time = 0.5; + + g_object_set (G_OBJECT (fixture->camera), + "exposure-time", exposure_time, + NULL); + g_object_get (G_OBJECT (fixture->camera), + "frames-per-second", &frames_per_second, + NULL); + + /* + * The mock camera does not override the "frames-per-second" property, so we + * check the implementation from the base camera. + */ + g_assert_cmpfloat (frames_per_second, ==, 1.0 / exposure_time); +} + static void test_binnings_properties (Fixture *fixture, gconstpointer data) { @@ -189,6 +209,7 @@ int main (int argc, char *argv[]) g_test_add ("/properties/base", Fixture, NULL, fixture_setup, test_base_properties, fixture_teardown); g_test_add ("/properties/recording", Fixture, NULL, fixture_setup, test_recording_property, fixture_teardown); g_test_add ("/properties/binnings", Fixture, NULL, fixture_setup, test_binnings_properties, fixture_teardown); + g_test_add ("/properties/frames-per-second", Fixture, NULL, fixture_setup, test_fps_property, fixture_teardown); g_test_add ("/signal", Fixture, NULL, fixture_setup, test_signal, fixture_teardown); return g_test_run (); -- cgit v1.2.3