Skip to content

Commit

Permalink
add a unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
dzzz2001 committed Jan 20, 2025
1 parent 156ee88 commit ea17559
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions source/module_base/test/vector3_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
* - VneV
* - overload operator "!=" to assert
* - the inequality between two 3d vectors
* - VltV
* - overload operator "<" to sort
* - the "less than" relationship between two 3d vectors
* - StdOutV
* - overload operator "<<" to print out
* - a 3d vectors on standard output
Expand Down Expand Up @@ -703,6 +706,22 @@ TEST_F(Vector3Test,VneV)
EXPECT_TRUE(wp != w);
}

TEST_F(Vector3Test, VltV)
{
ModuleBase::Vector3<double> u, up;
u.set(da, db, dc);
up.set(dc, db, da);
EXPECT_TRUE(u < up);
ModuleBase::Vector3<float> v, vp;
v.set(fa, fb, fc);
vp.set(fa, fb, fc);
EXPECT_FALSE(v < vp);
ModuleBase::Vector3<int> w, wp;
w.set(ia, ib, ic);
wp.set(ib, ib, ic);
EXPECT_TRUE(w < wp);
}

TEST_F(Vector3Test,StdOutV)
{
// double Vector3
Expand Down

0 comments on commit ea17559

Please sign in to comment.