* Add travis sanitizers tests. * Add gcc-7 in Travis. * Add SANITIZER_PATH for CMake. * Enable sanitizer tests in Travis. * Fix memory leaks in tests. * Fix all memory leaks reported by Address Sanitizer. * tests/cpp/helpers.h/CreateDMatrix now returns raw pointer.
12 lines
307 B
C++
12 lines
307 B
C++
// Copyright by Contributors
|
|
#include <xgboost/objective.h>
|
|
|
|
#include "../helpers.h"
|
|
|
|
TEST(Objective, UnknownFunction) {
|
|
xgboost::ObjFunction* obj;
|
|
EXPECT_ANY_THROW(obj = xgboost::ObjFunction::Create("unknown_name"));
|
|
EXPECT_NO_THROW(obj = xgboost::ObjFunction::Create("reg:linear"));
|
|
delete obj;
|
|
}
|