From edf6220e76adf98620e4358f134a90ea8f5a9362 Mon Sep 17 00:00:00 2001 From: Katie Mummah Date: Wed, 12 Jun 2024 11:17:56 -0500 Subject: [PATCH] fix bad merge in matl sell pol tests --- tests/toolkit/matl_sell_policy_tests.cc | 40 +++++++++---------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/tests/toolkit/matl_sell_policy_tests.cc b/tests/toolkit/matl_sell_policy_tests.cc index 1d8cf8508f..737365af2b 100644 --- a/tests/toolkit/matl_sell_policy_tests.cc +++ b/tests/toolkit/matl_sell_policy_tests.cc @@ -192,36 +192,24 @@ TEST_F(MatlSellPolicyTests, Package) { EXPECT_EQ(1, qr_trans.GetVal("Time", 1)); EXPECT_EQ(2, qr_trans.GetVal("Time", 2)); -<<<<<<< Updated upstream + // Resource 0 is the material of 5 that we first created. + QueryResult qr_all_res = sim.db().Query("Resources", NULL); + EXPECT_EQ(5, qr_all_res.GetVal("Quantity", 0)); + + // Then check that three packaged materials were created of size 2, 2, and 1 std::vector conds; conds.push_back(cyclus::Cond("PackageName", "==", std::string("foo"))); - QueryResult qr_res = sim.db().Query("Resources", &conds); - EXPECT_EQ(qr_res.rows.size(), 3); - EXPECT_EQ(2, qr_res.GetVal("Quantity", 0)); - EXPECT_EQ(2, qr_res.GetVal("Quantity", 1)); - EXPECT_EQ(1, qr_res.GetVal("Quantity", 2)); -======= - // Resource 0 is the material of 5 that we first created. The first resource - // is split into 3 and 2, then split again into 1 and 2 - // the first resource split into 3 and 2. Resource 3/4 is split into 1 and 2 - EXPECT_EQ(5, qr_res.GetVal("Quantity", 0)); - - std::vector pkg_first_split = {qr_res.GetVal("Quantity", 1), - qr_res.GetVal("Quantity", 2), - std::sort(pkg_first_split.begin(), pkg_first_split.end(), - std::greater()); - std::vector exp_first = {3, 2}; - - EXPECT_EQ(exp_first, pkgng_split); + QueryResult qr_pkgd_res = sim.db().Query("Resources", &conds); + EXPECT_EQ(qr_pkgd_res.rows.size(), 3); - std::vector pkg_second_split = {qr_res.GetVal("Quantity", 3), - qr_res.GetVal("Quantity", 4)}; - std::sort(pkg_second_split.begin(), pkg_second_split.end(), - std::greater()); - std::vector exp_second = {2, 1}; + std::vector pkged_res = {qr_pkgd_res.GetVal("Quantity", 0), + qr_pkgd_res.GetVal("Quantity", 1), + qr_pkgd_res.GetVal("Quantity", 2)}; + std::sort(pkged_res.begin(), pkged_res.end(), std::greater()); + + std::vector exp = {2, 2, 1}; - EXPECT_EQ(exp_second, pkg_second_split); ->>>>>>> Stashed changes + EXPECT_EQ(exp, pkged_res); // All material should have been transacted, including the resource of size 1 EXPECT_EQ(0, buf.quantity());