|
@@ -63,7 +63,7 @@ TEST(director, director_galaxy_save) {
|
|
|
|
|
|
dir.galaxy.username = "test";
|
|
|
dir.galaxy.game = 'Z';
|
|
|
- // This causes a YAML::Node Sequence
|
|
|
+ // This causes a YAML::Node Sequence
|
|
|
dir.galaxy.meta["trade"][10963][0] = 1;
|
|
|
dir.galaxy.save();
|
|
|
|
|
@@ -119,8 +119,21 @@ TEST(director, director_parsing_density) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ std::array<density, 6> dense = {{{70, 0, 6, 0, false},
|
|
|
+ {441, 100, 2, 0, false},
|
|
|
+ {575, 1000, 2, 15, true},
|
|
|
+ {600, 40, 6, 0, false},
|
|
|
+ {629, 1, 4, 0, false},
|
|
|
+ {711, 101, 6, 0, false}}};
|
|
|
+
|
|
|
+ for (auto const& s : dense) {
|
|
|
+ auto d = dir.galaxy.dscan.find(s.sector);
|
|
|
+ EXPECT_EQ(d, s) << "Sector " << s.sector << " density";
|
|
|
+ }
|
|
|
+
|
|
|
// Check that each sector was correctly processed
|
|
|
std::vector<int> sectors = {70, 441, 575, 600, 629, 711};
|
|
|
+
|
|
|
YAML::Node sector_data;
|
|
|
sector_data[70]["density"] = 0;
|
|
|
sector_data[70]["warps"] = 6;
|
|
@@ -156,15 +169,20 @@ TEST(director, director_parsing_density) {
|
|
|
for (auto sector : sectors) {
|
|
|
// GTEST_COUT << "Testing Sector " << sector << std::endl;
|
|
|
EXPECT_EQ(dir.galaxy.meta["density"][sector]["density"].as<int>(),
|
|
|
- sector_data[sector]["density"].as<int>()) << "Sector " << sector << " density";
|
|
|
+ sector_data[sector]["density"].as<int>())
|
|
|
+ << "Sector " << sector << " density";
|
|
|
EXPECT_EQ(dir.galaxy.meta["density"][sector]["warps"].as<int>(),
|
|
|
- sector_data[sector]["warps"].as<int>()) << "Sector " << sector << " warps";
|
|
|
+ sector_data[sector]["warps"].as<int>())
|
|
|
+ << "Sector " << sector << " warps";
|
|
|
EXPECT_EQ(dir.galaxy.meta["density"][sector]["navhaz"].as<int>(),
|
|
|
- sector_data[sector]["navhaz"].as<int>()) << "Sector " << sector << " navhaz";
|
|
|
+ sector_data[sector]["navhaz"].as<int>())
|
|
|
+ << "Sector " << sector << " navhaz";
|
|
|
EXPECT_EQ(dir.galaxy.meta["density"][sector]["anom"].as<bool>(),
|
|
|
- sector_data[sector]["anom"].as<bool>()) << "Sector " << sector << " anom";
|
|
|
+ sector_data[sector]["anom"].as<bool>())
|
|
|
+ << "Sector " << sector << " anom";
|
|
|
EXPECT_EQ(dir.galaxy.meta["density"][sector]["known"].as<bool>(),
|
|
|
- sector_data[sector]["known"].as<bool>()) << "Sector " << sector << " known";
|
|
|
+ sector_data[sector]["known"].as<bool>())
|
|
|
+ << "Sector " << sector << " known";
|
|
|
}
|
|
|
}
|
|
|
|