diff --git a/source/module_base/test/CMakeLists.txt b/source/module_base/test/CMakeLists.txt index 16f0d21f14..d500a6d97a 100644 --- a/source/module_base/test/CMakeLists.txt +++ b/source/module_base/test/CMakeLists.txt @@ -127,3 +127,8 @@ AddTest( TARGET base_opt_TN SOURCES opt_TN_test.cpp opt_test_tools.cpp ../opt_CG.cpp ../opt_DCsrch.cpp ../global_variable.cpp ../../src_parallel/parallel_reduce.cpp ) + +AddTest( + TARGET base_ylm + SOURCES ylm_test.cpp ../ylm.cpp ../timer.cpp ../tool_quit.cpp ../global_variable.cpp ../global_file.cpp ../memory.cpp + ) diff --git a/source/module_base/test/ylm_test.cpp b/source/module_base/test/ylm_test.cpp new file mode 100644 index 0000000000..ee85ac80ec --- /dev/null +++ b/source/module_base/test/ylm_test.cpp @@ -0,0 +1,25 @@ +#include "../ylm.h" +#include "gtest/gtest.h" +/************************************************ + * unit test of class ylm + ***********************************************/ + +/** + * - Tested Functions: + * - ZEROS + * - set all elements of a double float array to zero + * */ + +class ylmTest : public testing::Test +{ +}; + +TEST_F(ylmTest,Zeros) +{ + double aaaa[100]; + ModuleBase::Ylm::ZEROS(aaaa,100); + for(int i = 0; i < 100; i++) + { + EXPECT_EQ(aaaa[i],0.0); + } +}