Skip to content

Commit be85854

Browse files
authored
Fix: a bug in output title (#2041)
Co-authored-by: root <hongriTianqi>
1 parent 20c7fc5 commit be85854

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

source/module_base/test/tool_title_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ TEST_F(ToolTitleTest, TITLE1)
3636
{
3737
GlobalV::ofs_running.open("TITLEtest1.log");
3838
std::string output1;
39-
ModuleBase::TITLE(cfname,true);
39+
ModuleBase::TITLE(cfname,false);
4040
GlobalV::ofs_running.close();
4141
ifs.open("TITLEtest1.log");
4242
getline(ifs,output1);
@@ -48,7 +48,7 @@ TEST_F(ToolTitleTest, TITLE2)
4848
{
4949
GlobalV::ofs_running.open("TITLEtest2.log");
5050
std::string output2;
51-
ModuleBase::TITLE(claname,funname,true);
51+
ModuleBase::TITLE(claname,funname,false);
5252
GlobalV::ofs_running.close();
5353
ifs.open("TITLEtest2.log");
5454
getline(ifs,output2);
@@ -62,7 +62,7 @@ TEST_F(ToolTitleTest, TITLE3)
6262
std::string output3a;
6363
std::string output3b;
6464
oofs.open("TITLEtest3.log");
65-
ModuleBase::TITLE(oofs,claname,funname,true);
65+
ModuleBase::TITLE(oofs,claname,funname,false);
6666
oofs.close();
6767
ifs.open("TITLEtest3.log");
6868
getline(ifs,output3a);

source/module_base/tool_title.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ namespace ModuleBase
1111
// GLOBAL FUNCTION :
1212
// NAME : TITLE( title for each function )
1313
//==========================================================
14-
void TITLE(const std::string &class_function_name,bool enable)
14+
void TITLE(const std::string &class_function_name,const bool disable)
1515
{
16-
if (!enable)
16+
if (disable)
1717
{
1818
return;//no output
1919
}
@@ -27,9 +27,9 @@ void TITLE(const std::string &class_function_name,bool enable)
2727
#endif
2828
}
2929

30-
void TITLE(const std::string &class_name,const std::string &function_name,bool enable)
30+
void TITLE(const std::string &class_name,const std::string &function_name,const bool disable)
3131
{
32-
if (!enable)
32+
if (disable)
3333
{
3434
return;//no output
3535
}
@@ -44,9 +44,9 @@ void TITLE(const std::string &class_name,const std::string &function_name,bool e
4444
return;
4545
}
4646

47-
void TITLE(std::ofstream &ofs,const std::string &class_name,const std::string &function_name,bool enable)
47+
void TITLE(std::ofstream &ofs,const std::string &class_name,const std::string &function_name,const bool disable)
4848
{
49-
if (!enable)
49+
if (disable)
5050
{
5151
return;//no output
5252
}

source/module_base/tool_title.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
namespace ModuleBase
1616
{
1717

18-
void TITLE(const std::string &class_function_name,bool enable=false);
19-
void TITLE(const std::string &class_name,const std::string &function_name,bool enable=false);
20-
void TITLE(std::ofstream &ofs,const std::string &class_name,const std::string &function_name,bool enable=false);
18+
void TITLE(const std::string &class_function_name,const bool disable=true);
19+
void TITLE(const std::string &class_name,const std::string &function_name,const bool disable=true);
20+
void TITLE(std::ofstream &ofs,const std::string &class_name,const std::string &function_name,const bool disable=false);
2121
}
2222

2323
#endif

source/module_hamilt_general/module_xc/test/xc3_mock.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ namespace ModuleBase
7777
IntArray::IntArray(int,int){};
7878
IntArray::~IntArray(){};
7979

80-
void TITLE(const std::string &class_function_name,bool enable){};
81-
void TITLE(const std::string &class_name,const std::string &function_name,bool enable){};
80+
void TITLE(const std::string &class_function_name,bool disable){};
81+
void TITLE(const std::string &class_name,const std::string &function_name,bool disable){};
8282
}
8383

8484
namespace GlobalV

0 commit comments

Comments
 (0)