Skip to content

Commit

Permalink
expect_eq ordering consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
nuclearkatie committed Jun 12, 2024
1 parent cae1e3a commit 778aade
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/toolkit/matl_sell_policy_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,36 @@ TEST_F(MatlSellPolicyTests, Package) {
EXPECT_EQ(1, qr_trans.GetVal<int>("Time", 1));
EXPECT_EQ(2, qr_trans.GetVal<int>("Time", 2));

<<<<<<< Updated upstream
std::vector<cyclus::Cond> 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<double>("Quantity", 0));
EXPECT_EQ(2, qr_res.GetVal<double>("Quantity", 1));
EXPECT_EQ(1, qr_res.GetVal<double>("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<double>("Quantity", 0));

std::vector<double> pkg_first_split = {qr_res.GetVal<double>("Quantity", 1),
qr_res.GetVal<double>("Quantity", 2),
std::sort(pkg_first_split.begin(), pkg_first_split.end(),
std::greater<double>());
std::vector<double> exp_first = {3, 2};

EXPECT_EQ(exp_first, pkgng_split);

std::vector<double> pkg_second_split = {qr_res.GetVal<double>("Quantity", 3),
qr_res.GetVal<double>("Quantity", 4)};
std::sort(pkg_second_split.begin(), pkg_second_split.end(),
std::greater<double>());
std::vector<double> exp_second = {2, 1};

EXPECT_EQ(exp_second, pkg_second_split);
>>>>>>> Stashed changes

// All material should have been transacted, including the resource of size 1
EXPECT_EQ(0, buf.quantity());
Expand Down

0 comments on commit 778aade

Please sign in to comment.