From 6845df16333e7504abd7cceb2b5cb4e7637c73fb Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 4 May 2021 16:11:03 +0300 Subject: move away from variable-size ints --- test/unit_tests/resource.cpp | 4 +++- test/unit_tests/shmem.cpp | 9 +++++---- test/unit_tests/worker/worker.cpp | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/unit_tests/resource.cpp b/test/unit_tests/resource.cpp index 894edca..66556d5 100644 --- a/test/unit_tests/resource.cpp +++ b/test/unit_tests/resource.cpp @@ -12,6 +12,8 @@ #include #include +#include + using namespace winapi; #include @@ -20,7 +22,7 @@ using namespace winapi; namespace std { ostream& operator<<(ostream& os, unsigned char c) { - return os << boost::format("%|1$02x|") % static_cast(c); + return os << boost::format("%|1$02x|") % static_cast(c); } ostream& operator<<(ostream& os, const vector& cs) { diff --git a/test/unit_tests/shmem.cpp b/test/unit_tests/shmem.cpp index 4220386..894a0f9 100644 --- a/test/unit_tests/shmem.cpp +++ b/test/unit_tests/shmem.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -18,14 +19,14 @@ namespace { BOOST_CONSTEXPR_OR_CONST auto shmem_name = "test-data-struct"; -BOOST_CONSTEXPR_OR_CONST int main_data = -1; -BOOST_CONSTEXPR_OR_CONST int setter1_data = 69; -BOOST_CONSTEXPR_OR_CONST int setter2_data = 420; +BOOST_CONSTEXPR_OR_CONST int32_t main_data = -1; +BOOST_CONSTEXPR_OR_CONST int32_t setter1_data = 69; +BOOST_CONSTEXPR_OR_CONST int32_t setter2_data = 420; struct DataStruct { std::mutex mtx; std::condition_variable cv; - int data; + int32_t data; }; void setter1_main() { diff --git a/test/unit_tests/worker/worker.cpp b/test/unit_tests/worker/worker.cpp index 093bba8..c4dadf8 100644 --- a/test/unit_tests/worker/worker.cpp +++ b/test/unit_tests/worker/worker.cpp @@ -112,7 +112,7 @@ int loop() { } // namespace int main() { - int ec = loop(); + auto ec = loop(); std::this_thread::sleep_for(std::chrono::milliseconds{1000}); return ec; } -- cgit v1.2.3