Skip to content

Commit

Permalink
fix compiler warnings for CPP tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Oct 4, 2023
1 parent f175ceb commit cd48230
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tests/cpp_tests/test_byte_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ TEST(ByteBuffer, JustWorks) {
EXPECT_EQ(cumulativeSize, buffer->GetSize());
int16_t serializedInt16 = 0;
char* int16Ptr = reinterpret_cast<char*>(&serializedInt16);
for (int i = 0; i < sizeof(int16_t); i++) {
for (uint i = 0; i < sizeof(int16_t); i++) {
int16Ptr[i] = buffer->GetAt(cumulativeSize - (sizeof(int16_t) - i));
}
EXPECT_EQ(int16Val, serializedInt16);
Expand All @@ -41,7 +41,7 @@ TEST(ByteBuffer, JustWorks) {
EXPECT_EQ(cumulativeSize, buffer->GetSize());
int64_t serializedInt64 = 0;
char* int64Ptr = reinterpret_cast<char*>(&serializedInt64);
for (int i = 0; i < sizeof(int64_t); i++) {
for (uint i = 0; i < sizeof(int64_t); i++) {
int64Ptr[i] = buffer->GetAt(cumulativeSize - (sizeof(int64_t) - i));
}
EXPECT_EQ(int64Val, serializedInt64);
Expand All @@ -52,7 +52,7 @@ TEST(ByteBuffer, JustWorks) {
EXPECT_EQ(cumulativeSize, buffer->GetSize());
double serializedDouble = 0;
char* doublePtr = reinterpret_cast<char*>(&serializedDouble);
for (int i = 0; i < sizeof(double); i++) {
for (uint i = 0; i < sizeof(double); i++) {
doublePtr[i] = buffer->GetAt(cumulativeSize - (sizeof(double) - i));
}
EXPECT_EQ(doubleVal, serializedDouble);
Expand Down
2 changes: 1 addition & 1 deletion tests/cpp_tests/testutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ namespace LightGBM {
groups_ptr,
thread_count,
t);
threads.push_back(move(th));
threads.push_back(std::move(th));
}

for (auto& t : threads) t.join();
Expand Down

0 comments on commit cd48230

Please sign in to comment.