|
1 | 1 | #include "gtest/gtest.h" |
2 | 2 | #include "module_hamilt_lcao/module_hcontainer/hcontainer.h" |
3 | | -#include "time.h" |
| 3 | +#include <ctime> |
4 | 4 |
|
5 | 5 | // test_size is the number of atoms in the unitcell |
6 | 6 | // modify test_size to test different size of unitcell |
@@ -52,7 +52,7 @@ TEST(single_test_hcontainer, insert_pair) |
52 | 52 | // print current used memory of system |
53 | 53 | auto memory_start = ModuleBase::GlobalFunc::MemAvailable() / 1024.0; |
54 | 54 | // get random number between (0, 100000000) by rand() |
55 | | - srand((unsigned)time(NULL)); |
| 55 | + srand((unsigned)time(nullptr)); |
56 | 56 | hamilt::HContainer<double> HR_test(test_size); |
57 | 57 | clock_t start, end; |
58 | 58 | start = clock(); |
@@ -85,7 +85,7 @@ TEST(single_test_hcontainer, insert_pair) |
85 | 85 | TEST(single_test_IJR, insert_pair) |
86 | 86 | { |
87 | 87 | // get random number between (0, 100000000) by rand() |
88 | | - srand((unsigned)time(NULL)); |
| 88 | + srand((unsigned)time(nullptr)); |
89 | 89 | hamilt::HContainer<double> HR_test(test_size); |
90 | 90 | clock_t start, end; |
91 | 91 | start = clock(); |
@@ -121,7 +121,7 @@ TEST(single_test_IJR, insert_pair) |
121 | 121 | TEST_F(HContainerTest, find_pair) |
122 | 122 | { |
123 | 123 | // find_pair 1000000 times with random iat1 and iat2 |
124 | | - srand((unsigned)time(NULL)); |
| 124 | + srand((unsigned)time(nullptr)); |
125 | 125 | clock_t start, end; |
126 | 126 | start = clock(); |
127 | 127 | for (int i = 0; i < test_size * 100; i++) |
|
0 commit comments