@@ -265,78 +265,17 @@ TEST_F(IonsMoveBasicTest, TerminateNotConverged)
265265 EXPECT_THAT (ofs_output , ::testing::HasSubstr (expected_ofs));
266266}
267267
268- // Test the setup_etot() function case 1
269- TEST_F (IonsMoveBasicTest, SetupEtotCase1)
270- {
271- // Initialize data
272- const int istep = 1 ;
273- std::vector<double > etot_info = {2.0 , 1.0 , 0.0 };
274- double energy_in = 3.0 ;
275- bool judgement = true ;
276-
277- // Call the function being tested
278- std::ofstream ofs (" /dev/null" );
279- Ions_Move_Basic::setup_etot (energy_in, judgement, istep, ofs, etot_info);
280- ofs.close ();
281-
282- // Check the results
283- EXPECT_DOUBLE_EQ (etot_info[1 ], 3.0 );
284- EXPECT_DOUBLE_EQ (etot_info[0 ], 3.0 );
285- EXPECT_DOUBLE_EQ (etot_info[0 ] - etot_info[1 ], 0.0 );
286- }
287-
288- // Test the setup_etot() function case 2
289- TEST_F (IonsMoveBasicTest, SetupEtotCase2)
290- {
291- // Initialize data
292- const int istep = 2 ;
293- std::vector<double > etot_info = {2.0 , 4.0 };
294- double energy_in = 3.0 ;
295- bool judgement = true ;
296-
297- // Call the function being tested
298- std::ofstream ofs (" /dev/null" );
299- Ions_Move_Basic::setup_etot (energy_in, judgement, istep, ofs, etot_info);
300- ofs.close ();
301-
302- // Check the results
303- EXPECT_DOUBLE_EQ (etot_info[1 ], 2.0 );
304- EXPECT_DOUBLE_EQ (etot_info[0 ], 3.0 );
305- EXPECT_DOUBLE_EQ (etot_info[0 ] - etot_info[1 ], 1.0 );
306- }
307-
308- // Test the setup_etot() function case 3
309- TEST_F (IonsMoveBasicTest, SetupEtotCase3)
310- {
311- // Initialize data
312- const int istep = 2 ;
313- std::vector<double > etot_info = {2.0 , 1.0 };
314- double energy_in = 3.0 ;
315- bool judgement = true ;
316-
317- // Call the function being tested
318- std::ofstream ofs (" /dev/null" );
319- Ions_Move_Basic::setup_etot (energy_in, judgement, istep, ofs, etot_info);
320- ofs.close ();
321-
322- // Check the results
323- EXPECT_DOUBLE_EQ (etot_info[1 ], 2.0 );
324- EXPECT_DOUBLE_EQ (etot_info[0 ], 3.0 );
325- EXPECT_DOUBLE_EQ (etot_info[0 ] - etot_info[1 ], 1.0 );
326- }
327-
328- // Test the setup_etot() function case 4
329- TEST_F (IonsMoveBasicTest, SetupEtotCase4)
268+ // Test the setup_etot() function
269+ TEST_F (IonsMoveBasicTest, SetupEtot)
330270{
331271 // Initialize data
332272 const int istep = 2 ;
333273 std::vector<double > etot_info = {2.0 , 1.0 };
334274 double energy_in = 3.0 ;
335- bool judgement = false ;
336275
337276 // Call the function being tested
338277 std::ofstream ofs (" /dev/null" );
339- Ions_Move_Basic::setup_etot (energy_in, judgement, istep, ofs , etot_info);
278+ Ions_Move_Basic::setup_etot (energy_in, istep, etot_info);
340279 ofs.close ();
341280
342281 // Check the results
0 commit comments