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
0c0eb2a6
"vscode:/vscode.git/clone" did not exist on "25200c3ac83d0b48ed2d5babbea94d4a12599cba"
Unverified
Commit
0c0eb2a6
authored
Oct 12, 2022
by
Nikita Titov
Committed by
GitHub
Oct 11, 2022
Browse files
[tests] Fix cpp streaming data tests (#5481)
parent
f5dd320e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
tests/cpp_tests/test_stream.cpp
tests/cpp_tests/test_stream.cpp
+20
-2
No files found.
tests/cpp_tests/test_stream.cpp
View file @
0c0eb2a6
...
...
@@ -35,6 +35,9 @@ void test_stream_dense(
int
has_init_scores
=
init_scores
!=
nullptr
;
int
has_queries
=
groups
!=
nullptr
;
bool
succeeded
=
true
;
std
::
string
exceptionText
(
""
);
try
{
int
result
=
0
;
switch
(
creation_type
)
{
...
...
@@ -111,13 +114,19 @@ void test_stream_dense(
init_scores
,
groups
);
}
catch
(...)
{
catch
(
std
::
exception
&
ex
)
{
succeeded
=
false
;
exceptionText
=
std
::
string
(
ex
.
what
());
}
if
(
dataset_handle
)
{
int
result
=
LGBM_DatasetFree
(
dataset_handle
);
EXPECT_EQ
(
0
,
result
)
<<
"LGBM_DatasetFree result code: "
<<
result
;
}
if
(
!
succeeded
)
{
FAIL
()
<<
"Test Dense Stream failed with exception: "
<<
exceptionText
;
}
}
void
test_stream_sparse
(
...
...
@@ -142,6 +151,9 @@ void test_stream_sparse(
int
has_init_scores
=
init_scores
!=
nullptr
;
int
has_queries
=
groups
!=
nullptr
;
bool
succeeded
=
true
;
std
::
string
exceptionText
(
""
);
try
{
int
result
=
0
;
switch
(
creation_type
)
{
...
...
@@ -220,13 +232,19 @@ void test_stream_sparse(
init_scores
,
groups
);
}
catch
(...)
{
catch
(
std
::
exception
&
ex
)
{
succeeded
=
false
;
exceptionText
=
std
::
string
(
ex
.
what
());
}
if
(
dataset_handle
)
{
int
result
=
LGBM_DatasetFree
(
dataset_handle
);
EXPECT_EQ
(
0
,
result
)
<<
"LGBM_DatasetFree result code: "
<<
result
;
}
if
(
!
succeeded
)
{
FAIL
()
<<
"Test Sparse Stream failed with exception: "
<<
exceptionText
;
}
}
TEST
(
Stream
,
PushDenseRowsWithMetadata
)
{
...
...
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