File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ public:
1414 CPPUNIT_TEST ( testOldConstructor );
1515 CPPUNIT_TEST ( testIterators );
1616 CPPUNIT_TEST ( testAppend );
17+ CPPUNIT_TEST ( testNSteps );
1718 CPPUNIT_TEST_SUITE_END ();
1819
1920public :
@@ -117,6 +118,25 @@ public:
117118 for (int i = 0 ; i < 3 ; ++ i )
118119 CPPUNIT_ASSERT_EQUAL (params1 .get_step_value ("b" , i ), Real (i + 3 ));
119120 }
121+
122+ void testNSteps ()
123+ {
124+ LOG_UNIT_TEST ;
125+
126+ // A default-constructed RBparameters object has 1 step by definition
127+ RBParameters params ;
128+ CPPUNIT_ASSERT_EQUAL (params .n_steps (), static_cast < unsigned int > (1 ));
129+
130+ // Set the number of steps to use in the no-parameters case
131+ params .set_n_steps (10 );
132+ CPPUNIT_ASSERT_EQUAL (params .n_steps (), static_cast < unsigned int > (10 ));
133+
134+ // Define multiple steps for a single parameter. Now we no longer
135+ // use the set_n_steps() value, since we have actual steps.
136+ params .push_back_value ("a" , 1. );
137+ params .push_back_value ("a" , 2. );
138+ CPPUNIT_ASSERT_EQUAL (params .n_steps (), static_cast < unsigned int > (2 ));
139+ }
120140};
121141
122142CPPUNIT_TEST_SUITE_REGISTRATION ( RBParametersTest );
You can’t perform that action at this time.
0 commit comments