From b80444b035bcf5f4345eb00bae3d86ec4cd98fc4 Mon Sep 17 00:00:00 2001 From: YuLiu98 Date: Thu, 12 Dec 2024 20:54:53 +0800 Subject: [PATCH] add const for Find_atom() in unittests --- source/module_elecstate/module_dm/test/test_dm_io.cpp | 2 +- source/module_elecstate/module_dm/test/tmp_mocks.cpp | 2 +- .../hamilt_lcaodft/operator_lcao/test/tmp_mocks.cpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/module_elecstate/module_dm/test/test_dm_io.cpp b/source/module_elecstate/module_dm/test/test_dm_io.cpp index 901ea7bef8..56f47e36fe 100644 --- a/source/module_elecstate/module_dm/test/test_dm_io.cpp +++ b/source/module_elecstate/module_dm/test/test_dm_io.cpp @@ -48,7 +48,7 @@ void Grid_Driver::Find_atom(const UnitCell& ucell, const ModuleBase::Vector3& tau, const int& T, const int& I, - AdjacentAtomInfo* adjs) + AdjacentAtomInfo* adjs) const { } Grid::Grid(const int& test_grid_in) : test_grid(test_grid_in) diff --git a/source/module_elecstate/module_dm/test/tmp_mocks.cpp b/source/module_elecstate/module_dm/test/tmp_mocks.cpp index 3001dc4181..b9f1356ba5 100644 --- a/source/module_elecstate/module_dm/test/tmp_mocks.cpp +++ b/source/module_elecstate/module_dm/test/tmp_mocks.cpp @@ -78,7 +78,7 @@ void Grid_Driver::Find_atom(const UnitCell& ucell, const ModuleBase::Vector3& tau, const int& T, const int& I, - AdjacentAtomInfo* adjs) + AdjacentAtomInfo* adjs) const { adjs->adj_num = ucell.nat - 1; adjs->adjacent_tau.resize(ucell.nat); diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/tmp_mocks.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/tmp_mocks.cpp index 9f5bb551eb..088d8c8ef2 100644 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/tmp_mocks.cpp +++ b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/tmp_mocks.cpp @@ -156,7 +156,8 @@ void Grid_Driver::Find_atom(const UnitCell& ucell, const ModuleBase::Vector3& tau, const int& T, const int& I, - AdjacentAtomInfo* adjs) { + AdjacentAtomInfo* adjs) const +{ adjs->adj_num = ucell.nat - 1; adjs->adjacent_tau.resize(ucell.nat); adjs->ntype.resize(ucell.nat, 0);