Skip to content

Commit

Permalink
Merge pull request #2610
Browse files Browse the repository at this point in the history
44c1d16 unit_tests: fix compiling on Windows (iDunk5400)
  • Loading branch information
fluffypony committed Oct 15, 2017
2 parents 6159a83 + 44c1d16 commit b412626
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions tests/unit_tests/epee_utils.cpp
Expand Up @@ -37,9 +37,7 @@
#include <sstream>
#include <vector>

#ifdef _WIN32
# include <winsock.h>
#else
#ifndef _WIN32
# include <arpa/inet.h>
#endif

Expand Down
8 changes: 4 additions & 4 deletions tests/unit_tests/serialization.cpp
Expand Up @@ -677,7 +677,7 @@ TEST(Serialization, portability_wallet)
bool r = false;
try
{
w.load(wallet_file.native(), password);
w.load(wallet_file.string(), password);
r = true;
}
catch (const exception& e)
Expand Down Expand Up @@ -794,7 +794,7 @@ TEST(Serialization, portability_outputs)
// read file
const boost::filesystem::path filename = unit_test::data_dir / "outputs";
std::string data;
bool r = epee::file_io_utils::load_file_to_string(filename.native(), data);
bool r = epee::file_io_utils::load_file_to_string(filename.string(), data);
ASSERT_TRUE(r);
const size_t magiclen = strlen(OUTPUT_EXPORT_FILE_MAGIC);
ASSERT_FALSE(data.size() < magiclen || memcmp(data.data(), OUTPUT_EXPORT_FILE_MAGIC, magiclen));
Expand Down Expand Up @@ -910,7 +910,7 @@ TEST(Serialization, portability_unsigned_tx)
const boost::filesystem::path filename = unit_test::data_dir / "unsigned_monero_tx";
std::string s;
const bool testnet = true;
bool r = epee::file_io_utils::load_file_to_string(filename.native(), s);
bool r = epee::file_io_utils::load_file_to_string(filename.string(), s);
ASSERT_TRUE(r);
const size_t magiclen = strlen(UNSIGNED_TX_PREFIX);
ASSERT_FALSE(strncmp(s.c_str(), UNSIGNED_TX_PREFIX, magiclen));
Expand Down Expand Up @@ -1058,7 +1058,7 @@ TEST(Serialization, portability_signed_tx)
const boost::filesystem::path filename = unit_test::data_dir / "signed_monero_tx";
const bool testnet = true;
std::string s;
bool r = epee::file_io_utils::load_file_to_string(filename.native(), s);
bool r = epee::file_io_utils::load_file_to_string(filename.string(), s);
ASSERT_TRUE(r);
const size_t magiclen = strlen(SIGNED_TX_PREFIX);
ASSERT_FALSE(strncmp(s.c_str(), SIGNED_TX_PREFIX, magiclen));
Expand Down

0 comments on commit b412626

Please sign in to comment.