aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-05-04 16:11:03 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-05-04 16:12:37 +0300
commit6845df16333e7504abd7cceb2b5cb4e7637c73fb (patch)
tree2de6857a5bec4a45d9d9cb89622481f6c422b7a7 /test
parentfix compiler warnings (diff)
downloadwinapi-common-6845df16333e7504abd7cceb2b5cb4e7637c73fb.tar.gz
winapi-common-6845df16333e7504abd7cceb2b5cb4e7637c73fb.zip
move away from variable-size ints
Diffstat (limited to 'test')
-rw-r--r--test/unit_tests/resource.cpp4
-rw-r--r--test/unit_tests/shmem.cpp9
-rw-r--r--test/unit_tests/worker/worker.cpp2
3 files changed, 9 insertions, 6 deletions
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 <boost/format.hpp>
#include <boost/test/unit_test.hpp>
+#include <cstdint>
+
using namespace winapi;
#include <ostream>
@@ -20,7 +22,7 @@ using namespace winapi;
namespace std {
ostream& operator<<(ostream& os, unsigned char c) {
- return os << boost::format("%|1$02x|") % static_cast<unsigned int>(c);
+ return os << boost::format("%|1$02x|") % static_cast<uint32_t>(c);
}
ostream& operator<<(ostream& os, const vector<unsigned char>& 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 <boost/test/unit_test.hpp>
#include <condition_variable>
+#include <cstdint>
#include <mutex>
#include <thread>
@@ -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;
}