mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
ClangTidy cleanups
1. NULL -> nullptr 2. foo.reset(new Bar) -> = foo = std::make_unique<Bar>() 3. Missing std library includes & prefixes Change-Id: I260b261b484554be681ee5a7398126fdb3b3a789
This commit is contained in:
@@ -46,12 +46,12 @@ namespace internal {
|
||||
class BlockSparseMatrixTest : public ::testing::Test {
|
||||
protected:
|
||||
void SetUp() final {
|
||||
std::unique_ptr<LinearLeastSquaresProblem> problem(
|
||||
CreateLinearLeastSquaresProblemFromId(2));
|
||||
std::unique_ptr<LinearLeastSquaresProblem> problem =
|
||||
CreateLinearLeastSquaresProblemFromId(2);
|
||||
CHECK(problem != nullptr);
|
||||
A_.reset(down_cast<BlockSparseMatrix*>(problem->A.release()));
|
||||
|
||||
problem.reset(CreateLinearLeastSquaresProblemFromId(1));
|
||||
problem = CreateLinearLeastSquaresProblemFromId(1);
|
||||
CHECK(problem != nullptr);
|
||||
B_.reset(down_cast<TripletSparseMatrix*>(problem->A.release()));
|
||||
|
||||
@@ -110,15 +110,15 @@ TEST_F(BlockSparseMatrixTest, ToDenseMatrixTest) {
|
||||
}
|
||||
|
||||
TEST_F(BlockSparseMatrixTest, AppendRows) {
|
||||
std::unique_ptr<LinearLeastSquaresProblem> problem(
|
||||
CreateLinearLeastSquaresProblemFromId(2));
|
||||
std::unique_ptr<LinearLeastSquaresProblem> problem =
|
||||
CreateLinearLeastSquaresProblemFromId(2);
|
||||
std::unique_ptr<BlockSparseMatrix> m(
|
||||
down_cast<BlockSparseMatrix*>(problem->A.release()));
|
||||
A_->AppendRows(*m);
|
||||
EXPECT_EQ(A_->num_rows(), 2 * m->num_rows());
|
||||
EXPECT_EQ(A_->num_cols(), m->num_cols());
|
||||
|
||||
problem.reset(CreateLinearLeastSquaresProblemFromId(1));
|
||||
problem = CreateLinearLeastSquaresProblemFromId(1);
|
||||
std::unique_ptr<TripletSparseMatrix> m2(
|
||||
down_cast<TripletSparseMatrix*>(problem->A.release()));
|
||||
B_->AppendRows(*m2);
|
||||
|
||||
Reference in New Issue
Block a user