Skip to content

Commit 5fe7471

Browse files
authored
Unit Test:void matrix::fill_out(const double x) (#2014)
1 parent 289f798 commit 5fe7471

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

source/module_base/test/matrix_test.cpp

100644100755
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* - operator "*=", "+=", "-="
1919
* - function trace_on
2020
* - function zero_out
21+
* - function fill_out
2122
* - function max/min/absmax
2223
* - function norm
2324
* - function print (not called in abacus, no need to test)
@@ -337,3 +338,16 @@ TEST_F(matrixTest,Alloc)
337338
output = testing::internal::GetCapturedStdout();
338339
EXPECT_THAT(output,testing::HasSubstr("Allocation error for Matrix"));
339340
}
341+
342+
TEST_F(matrixTest,Fillout)
343+
{
344+
double k=2.4;
345+
m33a.fill_out(k);
346+
for (int i=0;i<m33a.nr;++i)
347+
{
348+
for (int j=0;j<m33a.nc;++j)
349+
{
350+
EXPECT_DOUBLE_EQ(m33a(i,j),k);
351+
}
352+
}
353+
}

0 commit comments

Comments
 (0)