@@ -107,9 +107,6 @@ class MathChebyshevTest : public testing::Test
107107
108108TEST_F (MathChebyshevTest, calcoef_real)
109109{
110- #ifdef __MPI
111- #undef __MPI
112- #endif
113110 auto fun_x6 = [&](double x) { return fun.x6 (x); };
114111 auto fun_x7 = [&](double x) { return fun.x7 (x); };
115112 p_chetest = new ModuleBase::Chebyshev<double >(10 );
@@ -133,9 +130,6 @@ TEST_F(MathChebyshevTest, calcoef_real)
133130
134131TEST_F (MathChebyshevTest, calcoef_pair)
135132{
136- #ifdef __MPI
137- #undef __MPI
138- #endif
139133 auto fun_x6 = [&](double x) { return fun.x6 (x); };
140134 auto fun_x7 = [&](double x) { return fun.x7 (x); };
141135 p_chetest = new ModuleBase::Chebyshev<double >(10 );
@@ -154,9 +148,6 @@ TEST_F(MathChebyshevTest, calcoef_pair)
154148
155149TEST_F (MathChebyshevTest, calcoef_complex)
156150{
157- #ifdef __MPI
158- #undef __MPI
159- #endif
160151 auto fun_expi = [&](std::complex <double > x) { return fun.expi (x); };
161152 const int norder = 100 ;
162153 const double PI = 3.14159265358979323846 ;
@@ -178,9 +169,6 @@ TEST_F(MathChebyshevTest, calcoef_complex)
178169
179170TEST_F (MathChebyshevTest, calfinalvec_real)
180171{
181- #ifdef __MPI
182- #undef __MPI
183- #endif
184172 const int norder = 100 ;
185173 const double E = 2.718281828459046 ;
186174 p_chetest = new ModuleBase::Chebyshev<double >(norder);
@@ -215,9 +203,6 @@ TEST_F(MathChebyshevTest, calfinalvec_real)
215203
216204TEST_F (MathChebyshevTest, calfinalvec_complex)
217205{
218- #ifdef __MPI
219- #undef __MPI
220- #endif
221206 const int norder = 100 ;
222207 const double E = 2.718281828459046 ;
223208 p_chetest = new ModuleBase::Chebyshev<double >(norder);
@@ -252,9 +237,6 @@ TEST_F(MathChebyshevTest, calfinalvec_complex)
252237
253238TEST_F (MathChebyshevTest, calpolyvec_complex)
254239{
255- #ifdef __MPI
256- #undef __MPI
257- #endif
258240 const int norder = 100 ;
259241 const double E = 2.718281828459046 ;
260242 p_chetest = new ModuleBase::Chebyshev<double >(norder);
@@ -302,9 +284,6 @@ TEST_F(MathChebyshevTest, calpolyvec_complex)
302284
303285TEST_F (MathChebyshevTest, tracepolyA)
304286{
305- #ifdef __MPI
306- #undef __MPI
307- #endif
308287 const int norder = 100 ;
309288 p_chetest = new ModuleBase::Chebyshev<double >(norder);
310289
@@ -359,7 +338,6 @@ TEST_F(MathChebyshevTest, checkconverge)
359338{
360339#ifdef __MPI
361340#undef __MPI
362- #endif
363341 const int norder = 100 ;
364342 p_chetest = new ModuleBase::Chebyshev<double >(norder);
365343 auto fun_sigma_y
@@ -401,13 +379,12 @@ TEST_F(MathChebyshevTest, checkconverge)
401379
402380 delete[] v;
403381 delete p_chetest;
382+ #define __MPI
383+ #endif
404384}
405385
406386TEST_F (MathChebyshevTest, recurs)
407387{
408- #ifdef __MPI
409- #undef __MPI
410- #endif
411388 testing::internal::CaptureStdout ();
412389 EXPECT_EXIT (ModuleBase::Chebyshev<double > noneche (0 ), ::testing::ExitedWithCode (1 ), " " );
413390 std::string output = testing::internal::GetCapturedStdout ();
@@ -423,9 +400,6 @@ TEST_F(MathChebyshevTest, recurs)
423400#ifdef __ENABLE_FLOAT_FFTW
424401TEST_F (MathChebyshevTest, calcoef_real_float)
425402{
426- #ifdef __MPI
427- #undef __MPI
428- #endif
429403 auto fun_x6f = [&](float x) { return fun.x6 (x); };
430404 auto fun_x7f = [&](float x) { return fun.x7 (x); };
431405 p_fchetest = new ModuleBase::Chebyshev<float >(10 );
@@ -448,9 +422,6 @@ TEST_F(MathChebyshevTest, calcoef_real_float)
448422
449423TEST_F (MathChebyshevTest, calcoef_pair_float)
450424{
451- #ifdef __MPI
452- #undef __MPI
453- #endif
454425 auto fun_x6f = [&](float x) { return fun.x6 (x); };
455426 auto fun_x7f = [&](float x) { return fun.x7 (x); };
456427 p_fchetest = new ModuleBase::Chebyshev<float >(10 );
@@ -469,9 +440,6 @@ TEST_F(MathChebyshevTest, calcoef_pair_float)
469440
470441TEST_F (MathChebyshevTest, calcoef_complex_float)
471442{
472- #ifdef __MPI
473- #undef __MPI
474- #endif
475443 auto fun_expif = [&](std::complex <float > x) { return fun.expi (x); };
476444 const int norder = 100 ;
477445 const float PI = 3.14159265358979323846 ;
@@ -493,9 +461,6 @@ TEST_F(MathChebyshevTest, calcoef_complex_float)
493461
494462TEST_F (MathChebyshevTest, calfinalvec_real_float)
495463{
496- #ifdef __MPI
497- #undef __MPI
498- #endif
499464 const int norder = 100 ;
500465 const float E = 2.718281828459046 ;
501466 p_fchetest = new ModuleBase::Chebyshev<float >(norder);
@@ -530,9 +495,6 @@ TEST_F(MathChebyshevTest, calfinalvec_real_float)
530495
531496TEST_F (MathChebyshevTest, calfinalvec_complex_float)
532497{
533- #ifdef __MPI
534- #undef __MPI
535- #endif
536498 const int norder = 100 ;
537499 const float E = 2.718281828459046 ;
538500 p_fchetest = new ModuleBase::Chebyshev<float >(norder);
@@ -567,9 +529,6 @@ TEST_F(MathChebyshevTest, calfinalvec_complex_float)
567529
568530TEST_F (MathChebyshevTest, calpolyvec_float)
569531{
570- #ifdef __MPI
571- #undef __MPI
572- #endif
573532 const int norder = 100 ;
574533 const float E = 2.718281828459046 ;
575534 p_fchetest = new ModuleBase::Chebyshev<float >(norder);
@@ -617,9 +576,6 @@ TEST_F(MathChebyshevTest, calpolyvec_float)
617576
618577TEST_F (MathChebyshevTest, tracepolyA_float)
619578{
620- #ifdef __MPI
621- #undef __MPI
622- #endif
623579 const int norder = 100 ;
624580 p_fchetest = new ModuleBase::Chebyshev<float >(norder);
625581
@@ -669,9 +625,6 @@ TEST_F(MathChebyshevTest, tracepolyA_float)
669625
670626TEST_F (MathChebyshevTest, checkconverge_float)
671627{
672- #ifdef __MPI
673- #undef __MPI
674- #endif
675628 const int norder = 100 ;
676629 p_fchetest = new ModuleBase::Chebyshev<float >(norder);
677630
0 commit comments