From 92b9a122d0ccac0b5f1703671036a4c9f6cc8421 Mon Sep 17 00:00:00 2001 From: Sonata Date: Wed, 29 May 2019 14:18:50 -0500 Subject: [PATCH 1/2] resolves issue #488 by converting Char to std::string in a reactor test --- src/reactor_tests.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/reactor_tests.cc b/src/reactor_tests.cc index 1e24358132..8b175c0d09 100644 --- a/src/reactor_tests.cc +++ b/src/reactor_tests.cc @@ -680,7 +680,6 @@ TEST(ReactorTests, ByProduct) { conds.push_back(Cond("Value", "==", 0)); qr = sim.db().Query("ReactorSideProducts", &conds); EXPECT_EQ(5, qr.rows.size()); - } TEST(ReactorTests, MultipleByProduct) { @@ -706,25 +705,26 @@ TEST(ReactorTests, MultipleByProduct) { sim.AddRecipe("spentuox", c_spentuox()); int id = sim.Run(); - std::vector conds; + + std::vector conds_2; // test if it produces heat when reactor is running int quantity = 10; - conds.push_back(Cond("Product", "==", "process_heat")); - conds.push_back(Cond("Value", "==", quantity)); - QueryResult qr = sim.db().Query("ReactorSideProducts", &conds); + conds_2.push_back(Cond("Product", "==", std::string("process_heat"))); + conds_2.push_back(Cond("Value", "==", quantity)); + QueryResult qr = sim.db().Query("ReactorSideProducts", &conds_2); EXPECT_EQ(5, qr.rows.size()); // test if it produces water when reactor is running - conds.clear(); + conds_2.clear(); quantity = 100; - conds.push_back(Cond("Product", "==", "water")); - conds.push_back(Cond("Value", "==", quantity)); - qr = sim.db().Query("ReactorSideProducts", &conds); + conds_2.push_back(Cond("Product", "==", std::string("water"))); + conds_2.push_back(Cond("Value", "==", quantity)); + qr = sim.db().Query("ReactorSideProducts", &conds_2); EXPECT_EQ(5, qr.rows.size()); - conds.clear(); - conds.push_back(Cond("Value", "==", 0)); - qr = sim.db().Query("ReactorSideProducts", &conds); + conds_2.clear(); + conds_2.push_back(Cond("Value", "==", 0)); + qr = sim.db().Query("ReactorSideProducts", &conds_2); EXPECT_EQ(10, qr.rows.size()); } From 15a760323c93538d571d26440ad509c3c177b8dd Mon Sep 17 00:00:00 2001 From: Sonata Date: Wed, 29 May 2019 14:24:14 -0500 Subject: [PATCH 2/2] resolves issue #488 by converting Char to std::string in a reactor test --- src/reactor_tests.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/reactor_tests.cc b/src/reactor_tests.cc index 8b175c0d09..89996cb0c7 100644 --- a/src/reactor_tests.cc +++ b/src/reactor_tests.cc @@ -706,25 +706,25 @@ TEST(ReactorTests, MultipleByProduct) { int id = sim.Run(); - std::vector conds_2; + std::vector conds; // test if it produces heat when reactor is running int quantity = 10; - conds_2.push_back(Cond("Product", "==", std::string("process_heat"))); - conds_2.push_back(Cond("Value", "==", quantity)); - QueryResult qr = sim.db().Query("ReactorSideProducts", &conds_2); + conds.push_back(Cond("Product", "==", std::string("process_heat"))); + conds.push_back(Cond("Value", "==", quantity)); + QueryResult qr = sim.db().Query("ReactorSideProducts", &conds); EXPECT_EQ(5, qr.rows.size()); // test if it produces water when reactor is running - conds_2.clear(); + conds.clear(); quantity = 100; - conds_2.push_back(Cond("Product", "==", std::string("water"))); - conds_2.push_back(Cond("Value", "==", quantity)); - qr = sim.db().Query("ReactorSideProducts", &conds_2); + conds.push_back(Cond("Product", "==", std::string("water"))); + conds.push_back(Cond("Value", "==", quantity)); + qr = sim.db().Query("ReactorSideProducts", &conds); EXPECT_EQ(5, qr.rows.size()); - conds_2.clear(); - conds_2.push_back(Cond("Value", "==", 0)); - qr = sim.db().Query("ReactorSideProducts", &conds_2); + conds.clear(); + conds.push_back(Cond("Value", "==", 0)); + qr = sim.db().Query("ReactorSideProducts", &conds); EXPECT_EQ(10, qr.rows.size()); }