mirror of
https://github.com/monero-project/monero.git
synced 2024-11-17 08:17:37 +00:00
unit_tests: fix compiling on Windows
This commit is contained in:
parent
86e9de588c
commit
44c1d160c8
2 changed files with 5 additions and 7 deletions
|
@ -37,9 +37,7 @@
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifndef _WIN32
|
||||||
# include <winsock.h>
|
|
||||||
#else
|
|
||||||
# include <arpa/inet.h>
|
# include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -677,7 +677,7 @@ TEST(Serialization, portability_wallet)
|
||||||
bool r = false;
|
bool r = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
w.load(wallet_file.native(), password);
|
w.load(wallet_file.string(), password);
|
||||||
r = true;
|
r = true;
|
||||||
}
|
}
|
||||||
catch (const exception& e)
|
catch (const exception& e)
|
||||||
|
@ -794,7 +794,7 @@ TEST(Serialization, portability_outputs)
|
||||||
// read file
|
// read file
|
||||||
const boost::filesystem::path filename = unit_test::data_dir / "outputs";
|
const boost::filesystem::path filename = unit_test::data_dir / "outputs";
|
||||||
std::string data;
|
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);
|
ASSERT_TRUE(r);
|
||||||
const size_t magiclen = strlen(OUTPUT_EXPORT_FILE_MAGIC);
|
const size_t magiclen = strlen(OUTPUT_EXPORT_FILE_MAGIC);
|
||||||
ASSERT_FALSE(data.size() < magiclen || memcmp(data.data(), OUTPUT_EXPORT_FILE_MAGIC, magiclen));
|
ASSERT_FALSE(data.size() < magiclen || memcmp(data.data(), OUTPUT_EXPORT_FILE_MAGIC, magiclen));
|
||||||
|
@ -910,7 +910,7 @@ TEST(Serialization, portability_unsigned_tx)
|
||||||
const boost::filesystem::path filename = unit_test::data_dir / "unsigned_monero_tx";
|
const boost::filesystem::path filename = unit_test::data_dir / "unsigned_monero_tx";
|
||||||
std::string s;
|
std::string s;
|
||||||
const bool testnet = true;
|
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);
|
ASSERT_TRUE(r);
|
||||||
const size_t magiclen = strlen(UNSIGNED_TX_PREFIX);
|
const size_t magiclen = strlen(UNSIGNED_TX_PREFIX);
|
||||||
ASSERT_FALSE(strncmp(s.c_str(), UNSIGNED_TX_PREFIX, magiclen));
|
ASSERT_FALSE(strncmp(s.c_str(), UNSIGNED_TX_PREFIX, magiclen));
|
||||||
|
@ -1058,7 +1058,7 @@ TEST(Serialization, portability_signed_tx)
|
||||||
const boost::filesystem::path filename = unit_test::data_dir / "signed_monero_tx";
|
const boost::filesystem::path filename = unit_test::data_dir / "signed_monero_tx";
|
||||||
const bool testnet = true;
|
const bool testnet = true;
|
||||||
std::string s;
|
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);
|
ASSERT_TRUE(r);
|
||||||
const size_t magiclen = strlen(SIGNED_TX_PREFIX);
|
const size_t magiclen = strlen(SIGNED_TX_PREFIX);
|
||||||
ASSERT_FALSE(strncmp(s.c_str(), SIGNED_TX_PREFIX, magiclen));
|
ASSERT_FALSE(strncmp(s.c_str(), SIGNED_TX_PREFIX, magiclen));
|
||||||
|
|
Loading…
Reference in a new issue