11#include < gtest/gtest.h>
22
3+ #include < cstddef>
34#include < cstdint>
45#include < stb_library.hpp>
56#include < string>
@@ -15,7 +16,7 @@ class NesterovATestTaskAll : public ::testing::TestWithParam<int> {
1516 std::string abs_path = ppc::util::GetAbsolutePath (" all/example/data/pic_all.jpg" );
1617 data = stbi_load (abs_path.c_str (), &width, &height, &channels, 0 );
1718 ASSERT_TRUE (data != nullptr ) << " Failed to load image: " << stbi_failure_reason ();
18- img = std::vector<uint8_t >(data, data + (width * height * channels));
19+ img = std::vector<uint8_t >(data, data + (static_cast < size_t >( width) * height * channels));
1920 stbi_image_free (data);
2021
2122 ASSERT_EQ (width, height);
@@ -28,10 +29,10 @@ class NesterovATestTaskAll : public ::testing::TestWithParam<int> {
2829
2930TEST_P (NesterovATestTaskAll, MatmulFromPic) {
3031 int divider = GetParam ();
31- const int k_count = (width + height) / divider;
32+ const size_t k_count = (width + height) / divider;
3233
3334 std::vector<int > in (k_count * k_count, 0 );
34- for (int i = 0 ; i < k_count; i++) {
35+ for (size_t i = 0 ; i < k_count; i++) {
3536 in[(i * k_count) + i] = 1 ;
3637 }
3738
@@ -45,10 +46,10 @@ TEST_P(NesterovATestTaskAll, MatmulFromPic) {
4546
4647TEST_P (NesterovATestTaskAll, MatMulUtilFromPic) {
4748 int divider = GetParam ();
48- const int k_count = (width + height) / divider;
49+ const size_t k_count = (width + height) / divider;
4950
5051 std::vector<int > in (k_count * k_count, 0 );
51- for (int i = 0 ; i < k_count; i++) {
52+ for (size_t i = 0 ; i < k_count; i++) {
5253 in[(i * k_count) + i] = 1 ;
5354 }
5455 std::vector<int > out (k_count * k_count, 0 );
@@ -59,10 +60,10 @@ TEST_P(NesterovATestTaskAll, MatMulUtilFromPic) {
5960
6061TEST_P (NesterovATestTaskAll, MatMulTBBUtilFromPic) {
6162 int divider = GetParam ();
62- const int k_count = (width + height) / divider;
63+ const size_t k_count = (width + height) / divider;
6364
6465 std::vector<int > in (k_count * k_count, 0 );
65- for (int i = 0 ; i < k_count; i++) {
66+ for (size_t i = 0 ; i < k_count; i++) {
6667 in[(i * k_count) + i] = 1 ;
6768 }
6869 std::vector<int > out (k_count * k_count, 0 );
0 commit comments