Skip to content

Commit 3961fd8

Browse files
authored
Merge pull request #3586 from jwpeterson/fix_rb_parameters_initialization
Fix missing _n_steps initialization in RBParameters compatibility constructor
2 parents 54792e6 + c65252a commit 3961fd8

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/reduced_basis/rb_parameters.C

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ RBParameters::RBParameters() :
3232
{
3333
}
3434

35-
RBParameters::RBParameters(const std::map<std::string, Real> & parameter_map)
35+
RBParameters::RBParameters(const std::map<std::string, Real> & parameter_map) :
36+
_n_steps(1)
3637
{
3738
// Backwards compatible support for constructing an RBParameters
3839
// object from a map<string, Real>. We store a single entry in each

tests/utils/rb_parameters_test.C

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ public:
6565
CPPUNIT_ASSERT_EQUAL(params.get_value("a"), 1.);
6666
CPPUNIT_ASSERT_EQUAL(params.get_value("b"), 2.);
6767
CPPUNIT_ASSERT_EQUAL(params.get_value("c"), 3.);
68+
69+
// Test that RBParameters objects constructed with the old
70+
// constructor have the correct number of steps.
71+
CPPUNIT_ASSERT_EQUAL(params.n_steps(), 1u);
6872
}
6973

7074
void testIterators()

0 commit comments

Comments
 (0)