@@ -48,9 +48,10 @@ namespace GlobalC
4848 * - K_Vectors()
4949 * - basic parameters (nks,nkstot,nkstot_ibz) are set
5050 * - read_kpoints()
51- * - read from file
51+ * - read from file
5252 * - generate KPT from kspacing parameter
5353 * - renew and memory allocation
54+ * - read from file (Line_Cartesian kpoint file)
5455 */
5556
5657#define private public
@@ -164,11 +165,11 @@ TEST_F(KlistTest, Renew)
164165{
165166 K_Vectors kv;
166167 std::string k_file = " KPT4" ;
167- // Cartesian: non-spin case nspin=0
168+ // Cartesian: non-spin case nspin=1
168169 kv.nspin = 1 ;
169170 kv.read_kpoints (k_file);
170171 EXPECT_EQ (kv.kvec_c .size (),5 );
171- // spin case nspin=1
172+ // spin case nspin=2
172173 kv.nspin = 2 ;
173174 kv.read_kpoints (k_file);
174175 EXPECT_EQ (kv.kvec_c .size (),10 );
@@ -177,4 +178,24 @@ TEST_F(KlistTest, Renew)
177178
178179}
179180
181+ TEST_F (KlistTest, LineCartesian)
182+ {
183+ K_Vectors kv;
184+ std::string k_file = " KPT5" ;
185+ // Line Cartesian: non-spin case nspin=1
186+ kv.nspin = 1 ;
187+ // Read from k point file under the case of Line_Cartesian.
188+ kv.read_kpoints (k_file);
189+ EXPECT_EQ (kv.nkstot ,51 );
190+ EXPECT_EQ (kv.kvec_c .size (),51 );
191+ // Line Cartesian: spin case nspin=2
192+ kv.nspin = 2 ;
193+ // Read from k point file under the case of Line_Cartesian.
194+ kv.read_kpoints (k_file);
195+ EXPECT_EQ (kv.nkstot ,51 );
196+ EXPECT_EQ (kv.kvec_c .size (),102 );
197+ remove (" KPT5" );
198+
199+
200+ }
180201#undef private
0 commit comments