Skip to content

Commit e5812f1

Browse files
[pre-commit.ci lite] apply automatic fixes
1 parent 2de2c60 commit e5812f1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer_time.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "gtest/gtest.h"
22
#include "module_hamilt_lcao/module_hcontainer/hcontainer.h"
3-
#include "time.h"
3+
#include <ctime>
44

55
// test_size is the number of atoms in the unitcell
66
// modify test_size to test different size of unitcell
@@ -52,7 +52,7 @@ TEST(single_test_hcontainer, insert_pair)
5252
// print current used memory of system
5353
auto memory_start = ModuleBase::GlobalFunc::MemAvailable() / 1024.0;
5454
// get random number between (0, 100000000) by rand()
55-
srand((unsigned)time(NULL));
55+
srand((unsigned)time(nullptr));
5656
hamilt::HContainer<double> HR_test(test_size);
5757
clock_t start, end;
5858
start = clock();
@@ -85,7 +85,7 @@ TEST(single_test_hcontainer, insert_pair)
8585
TEST(single_test_IJR, insert_pair)
8686
{
8787
// get random number between (0, 100000000) by rand()
88-
srand((unsigned)time(NULL));
88+
srand((unsigned)time(nullptr));
8989
hamilt::HContainer<double> HR_test(test_size);
9090
clock_t start, end;
9191
start = clock();
@@ -121,7 +121,7 @@ TEST(single_test_IJR, insert_pair)
121121
TEST_F(HContainerTest, find_pair)
122122
{
123123
// find_pair 1000000 times with random iat1 and iat2
124-
srand((unsigned)time(NULL));
124+
srand((unsigned)time(nullptr));
125125
clock_t start, end;
126126
start = clock();
127127
for (int i = 0; i < test_size * 100; i++)

0 commit comments

Comments
 (0)