mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
directPhaseSensor_test.cpp
Go to the documentation of this file.
1/** \file directPhaseSensor_test.cpp
2 * \brief Tests for simulated direct phase sensors.
3 */
4#include "../../../catch2/catch.hpp"
5
8
9/// \cond
10// Compile every defined non-template member of a representative CPU specialization.
11template class mx::AO::sim::directPhaseSensor<double, mx::AO::sim::ccdDetector<double>>;
12/// \endcond
13
14/** \defgroup directPhaseSensor_unit_tests directPhaseSensor Unit Tests
15 * \ingroup ao_sim_unit_tests
16 */
17
18namespace unitTest::ao_sim_directPhaseSensor_test
19{
20
21/** \brief Verifies that the directPhaseSensor detector-dimension setters preserve both dimensions.
22 *
23 * \ingroup directPhaseSensor_unit_tests
24 */
25TEST_CASE( "directPhaseSensor detector dimensions remain synchronized", "[ao::sim::directPhaseSensor]" )
26{
27 mx::AO::sim::directPhaseSensor<double, mx::AO::sim::ccdDetector<double>> sensor;
28
29 sensor.detSize( 4, 5 );
30 REQUIRE( sensor.detRows() == 4 );
31 REQUIRE( sensor.detCols() == 5 );
32
33 sensor.detRows( 6 );
34 REQUIRE( sensor.detRows() == 6 );
35 REQUIRE( sensor.detCols() == 5 );
36
37 sensor.detCols( 7 );
38 REQUIRE( sensor.detRows() == 6 );
39 REQUIRE( sensor.detCols() == 7 );
40}
41
42} // namespace unitTest::ao_sim_directPhaseSensor_test
Provides a class to simulate a CCD.
Declaration and definition of a direct phase sensor.
TEST_CASE("directPhaseSensor detector dimensions remain synchronized", "[ao::sim::directPhaseSensor]")
Verifies that the directPhaseSensor detector-dimension setters preserve both dimensions.