Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
8f577de0
Unverified
Commit
8f577de0
authored
Oct 06, 2023
by
James Lamb
Committed by
GitHub
Oct 06, 2023
Browse files
fix compiler warnings for CPP tests (#6124)
parent
3c7e38be
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
tests/cpp_tests/test_byte_buffer.cpp
tests/cpp_tests/test_byte_buffer.cpp
+3
-3
tests/cpp_tests/testutils.cpp
tests/cpp_tests/testutils.cpp
+1
-1
No files found.
tests/cpp_tests/test_byte_buffer.cpp
View file @
8f577de0
...
@@ -30,7 +30,7 @@ TEST(ByteBuffer, JustWorks) {
...
@@ -30,7 +30,7 @@ TEST(ByteBuffer, JustWorks) {
EXPECT_EQ
(
cumulativeSize
,
buffer
->
GetSize
());
EXPECT_EQ
(
cumulativeSize
,
buffer
->
GetSize
());
int16_t
serializedInt16
=
0
;
int16_t
serializedInt16
=
0
;
char
*
int16Ptr
=
reinterpret_cast
<
char
*>
(
&
serializedInt16
);
char
*
int16Ptr
=
reinterpret_cast
<
char
*>
(
&
serializedInt16
);
for
(
int
i
=
0
;
i
<
sizeof
(
int16_t
);
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
sizeof
(
int16_t
);
i
++
)
{
int16Ptr
[
i
]
=
buffer
->
GetAt
(
cumulativeSize
-
(
sizeof
(
int16_t
)
-
i
));
int16Ptr
[
i
]
=
buffer
->
GetAt
(
cumulativeSize
-
(
sizeof
(
int16_t
)
-
i
));
}
}
EXPECT_EQ
(
int16Val
,
serializedInt16
);
EXPECT_EQ
(
int16Val
,
serializedInt16
);
...
@@ -41,7 +41,7 @@ TEST(ByteBuffer, JustWorks) {
...
@@ -41,7 +41,7 @@ TEST(ByteBuffer, JustWorks) {
EXPECT_EQ
(
cumulativeSize
,
buffer
->
GetSize
());
EXPECT_EQ
(
cumulativeSize
,
buffer
->
GetSize
());
int64_t
serializedInt64
=
0
;
int64_t
serializedInt64
=
0
;
char
*
int64Ptr
=
reinterpret_cast
<
char
*>
(
&
serializedInt64
);
char
*
int64Ptr
=
reinterpret_cast
<
char
*>
(
&
serializedInt64
);
for
(
int
i
=
0
;
i
<
sizeof
(
int64_t
);
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
sizeof
(
int64_t
);
i
++
)
{
int64Ptr
[
i
]
=
buffer
->
GetAt
(
cumulativeSize
-
(
sizeof
(
int64_t
)
-
i
));
int64Ptr
[
i
]
=
buffer
->
GetAt
(
cumulativeSize
-
(
sizeof
(
int64_t
)
-
i
));
}
}
EXPECT_EQ
(
int64Val
,
serializedInt64
);
EXPECT_EQ
(
int64Val
,
serializedInt64
);
...
@@ -52,7 +52,7 @@ TEST(ByteBuffer, JustWorks) {
...
@@ -52,7 +52,7 @@ TEST(ByteBuffer, JustWorks) {
EXPECT_EQ
(
cumulativeSize
,
buffer
->
GetSize
());
EXPECT_EQ
(
cumulativeSize
,
buffer
->
GetSize
());
double
serializedDouble
=
0
;
double
serializedDouble
=
0
;
char
*
doublePtr
=
reinterpret_cast
<
char
*>
(
&
serializedDouble
);
char
*
doublePtr
=
reinterpret_cast
<
char
*>
(
&
serializedDouble
);
for
(
int
i
=
0
;
i
<
sizeof
(
double
);
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
sizeof
(
double
);
i
++
)
{
doublePtr
[
i
]
=
buffer
->
GetAt
(
cumulativeSize
-
(
sizeof
(
double
)
-
i
));
doublePtr
[
i
]
=
buffer
->
GetAt
(
cumulativeSize
-
(
sizeof
(
double
)
-
i
));
}
}
EXPECT_EQ
(
doubleVal
,
serializedDouble
);
EXPECT_EQ
(
doubleVal
,
serializedDouble
);
...
...
tests/cpp_tests/testutils.cpp
View file @
8f577de0
...
@@ -265,7 +265,7 @@ namespace LightGBM {
...
@@ -265,7 +265,7 @@ namespace LightGBM {
groups_ptr
,
groups_ptr
,
thread_count
,
thread_count
,
t
);
t
);
threads
.
push_back
(
move
(
th
));
threads
.
push_back
(
std
::
move
(
th
));
}
}
for
(
auto
&
t
:
threads
)
t
.
join
();
for
(
auto
&
t
:
threads
)
t
.
join
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment