|
@@ -4,9 +4,9 @@
|
|
|
#include <string>
|
|
|
#include <vector>
|
|
|
|
|
|
+#include "director.h"
|
|
|
#include "galaxy.h"
|
|
|
#include "gtest/gtest.h"
|
|
|
-#include "director.h"
|
|
|
|
|
|
/*
|
|
|
|
|
@@ -110,6 +110,7 @@ struct pair {
|
|
|
};
|
|
|
};
|
|
|
|
|
|
+#ifdef NOT_ANYMORE
|
|
|
TEST(ports, trade_types) {
|
|
|
std::map<pair, int> expected;
|
|
|
for (int x = 0; x < 9; ++x) {
|
|
@@ -139,7 +140,6 @@ TEST(ports, trade_types) {
|
|
|
GTEST_COUT << "Done!" << std::endl;
|
|
|
*/
|
|
|
|
|
|
-#ifdef NOT_ANYMORE
|
|
|
for (int p1 = 1; p1 <= 8; ++p1) {
|
|
|
for (int p2 = p1; p2 <= 8; ++p2) {
|
|
|
// GTEST_COUT << "Type " << p1 << " and " << p2 << std::endl;
|
|
@@ -157,9 +157,8 @@ TEST(ports, trade_types) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-#endif
|
|
|
-
|
|
|
}
|
|
|
+#endif
|
|
|
|
|
|
TEST(ports, parse_portcim) {
|
|
|
// This really needs to be checked against real lines from a log file
|
|
@@ -242,4 +241,23 @@ TEST(ports, parse_portcim) {
|
|
|
// EXPECT_EQ(parse.percent, ports[0].percent);
|
|
|
}
|
|
|
|
|
|
+TEST(galaxy, trade_type_info) {
|
|
|
+ // test this code to see that we get the correct trade type results.
|
|
|
+ Galaxy g;
|
|
|
+ g.add_port(port{68, 1, {1290, 557, 561}, {100, 47, 56}});
|
|
|
+ g.add_port(port{706, 4, {2490, 2590, 743}, {100, 100, 94}});
|
|
|
+ trade_type_result ttr = g.trade_type_info(68, 706);
|
|
|
+ EXPECT_EQ(ttr.type, BEST) << "Expect Trade Type BEST";
|
|
|
+ // burn out equipment
|
|
|
+ g.add_port(port{68, 1, {1290, 557, 161}, {100, 47, 16}});
|
|
|
+ ttr = g.trade_type_info(68, 706);
|
|
|
+ EXPECT_EQ(ttr.type, FAIR_O) << "Expect Trade Type FAIR_O";
|
|
|
+ std::vector<port_pair_type> vppt = g.find_trades(68);
|
|
|
+ EXPECT_EQ(vppt.size(), 0) << "Should have no trades, because no warps";
|
|
|
+ g.add_warp(sector_warps{706, {68}});
|
|
|
+ g.add_warp(sector_warps{68, {51, 693, 706, 904}});
|
|
|
+ vppt = g.find_trades(68);
|
|
|
+ EXPECT_EQ(vppt.size(), 1) << "Found a trade";
|
|
|
+}
|
|
|
+
|
|
|
} // namespace
|