Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ rules. Read the complete governance document before making or reviewing changes:
9. Do not call MPI routines directly; use the internally-guarded wrappers
(e.g., `Parallel_Reduce::reduce_*`, `Parallel_Common::bcast_*`) instead.
10. Do not write new `#define private public` or `#define protected public`
access hacks in test files. If a unit test needs to inspect internal
state, either promote the member visibility explicitly or add a
public test-only accessor.
access hacks in test files; the governance checker **blocks** a net
increase. These macros reinterpret access control for every declaration
in the translation unit -- standard library headers included -- and make
the test TU disagree with the rest of the build. The usual root cause is
that the code under test reads global `PARAM` itself, so the test has to
reach in to drive it; the fix is to pass those INPUT values as explicit
arguments (see `Relax_Criteria` and `K_Vectors::read_kpoints`). Where the
test genuinely needs internal state, add a public `const` observer, or an
explicit `friend class XxxTest;` on the class under test.
11. New unit test source files shall be named `test_<module_name>.cpp`,
matching the source file they exercise. For example, the test for
`rhog_io.cpp` shall be `test_rhog_io.cpp`. This naming keeps the
Expand Down
2 changes: 0 additions & 2 deletions source/source_cell/test/unitcell_test_setupcell.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "gtest/gtest.h"
#include "gmock/gmock.h"
#define private public
#undef private
#include "memory"
#include "source_base/mathzone.h"
#include "source_base/global_variable.h"
Expand Down
2 changes: 0 additions & 2 deletions source/source_cell/test_pw/unitcell_test_pw.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "gtest/gtest.h"
#include "gmock/gmock.h"
#define private public
#undef private
#include "memory"
#include "source_base/mathzone.h"
#include "source_base/global_variable.h"
Expand Down
45 changes: 0 additions & 45 deletions source/source_hsolver/test/test_diago_assist.cpp

This file was deleted.

4 changes: 1 addition & 3 deletions source/source_hsolver/test/test_hsolver.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
#include <gtest/gtest.h>
#include <iostream>
#include <vector>
#define protected public

#include "hsolver_supplementary_mock.h"
#include "source_hamilt/hamilt.h"
#include "source_hsolver/hsolver.h"

#include <source_base/macros.h>

// template class hsolver::HSolver<std::complex<float>, base_device::DEVICE_CPU>;
// template class hsolver::HSolver<std::complex<double>, base_device::DEVICE_CPU>;

#include <source_base/macros.h>
/************************************************
* unit test of HSolver base class
***********************************************/
Expand Down
2 changes: 0 additions & 2 deletions source/source_io/module_output/cal_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "source_base/global_function.h"
#define private public
#include "source_io/module_parameter/parameter.h"
#undef private
#include "source_base/global_variable.h"
#include "source_base/memory_recorder.h"
#include "cal_test.h"
Expand Down
238 changes: 0 additions & 238 deletions source/source_io/test/for_testing_input_conv.h

This file was deleted.

2 changes: 0 additions & 2 deletions source/source_io/test/write_orb_info_test.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#include "gtest/gtest.h"
#include "gmock/gmock.h"
#define private public
#include "source_io/module_parameter/parameter.h"
#undef private
#include "source_io/module_output/write_orb_info.h"
#include "source_cell/unitcell.h"
#include "prepare_unitcell.h"
Expand Down
2 changes: 0 additions & 2 deletions source/source_io/test_serial/rho_io_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ Magnetism::~Magnetism()
}


#define private public
#include "source_io/module_parameter/parameter.h"
#undef private

/***************************************************************
* unit test of read_rho, write_rho and trilinear_interpolate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
#include <cmath>
#include <vector>

#define private public
#include "source_io/module_parameter/parameter.h"
#undef private

/***********************************************************************
* Unit tests for DeltaSpin PW support
Expand Down
Loading
Loading