apply clang-format settings to the c++ sources in the unittest tree
This commit is contained in:
@ -11,23 +11,23 @@
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "potential_file_reader.h"
|
||||
#include "lammps.h"
|
||||
#include "utils.h"
|
||||
#include "MANYBODY/pair_sw.h"
|
||||
#include "MANYBODY/pair_comb.h"
|
||||
#include "MANYBODY/pair_comb3.h"
|
||||
#include "MANYBODY/pair_eim.h"
|
||||
#include "MANYBODY/pair_gw.h"
|
||||
#include "MANYBODY/pair_gw_zbl.h"
|
||||
#include "MANYBODY/pair_nb3b_harmonic.h"
|
||||
#include "MANYBODY/pair_sw.h"
|
||||
#include "MANYBODY/pair_tersoff.h"
|
||||
#include "MANYBODY/pair_tersoff_mod.h"
|
||||
#include "MANYBODY/pair_tersoff_mod_c.h"
|
||||
#include "MANYBODY/pair_tersoff_zbl.h"
|
||||
#include "MANYBODY/pair_gw.h"
|
||||
#include "MANYBODY/pair_gw_zbl.h"
|
||||
#include "MANYBODY/pair_nb3b_harmonic.h"
|
||||
#include "MANYBODY/pair_vashishta.h"
|
||||
#include "MANYBODY/pair_eim.h"
|
||||
#include "lammps.h"
|
||||
#include "potential_file_reader.h"
|
||||
#include "utils.h"
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <mpi.h>
|
||||
|
||||
@ -47,25 +47,29 @@ const int LAMMPS_NS::PairVashishta::NPARAMS_PER_LINE;
|
||||
|
||||
class PotentialFileReaderTest : public ::testing::Test {
|
||||
protected:
|
||||
LAMMPS * lmp;
|
||||
LAMMPS *lmp;
|
||||
|
||||
void SetUp() override {
|
||||
const char *args[] = {"PotentialFileReaderTest", "-log", "none", "-echo", "screen", "-nocite" };
|
||||
void SetUp() override
|
||||
{
|
||||
const char *args[] = {
|
||||
"PotentialFileReaderTest", "-log", "none", "-echo", "screen", "-nocite"};
|
||||
char **argv = (char **)args;
|
||||
int argc = sizeof(args)/sizeof(char *);
|
||||
int argc = sizeof(args) / sizeof(char *);
|
||||
::testing::internal::CaptureStdout();
|
||||
lmp = new LAMMPS(argc, argv, MPI_COMM_WORLD);
|
||||
::testing::internal::GetCapturedStdout();
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
void TearDown() override
|
||||
{
|
||||
::testing::internal::CaptureStdout();
|
||||
delete lmp;
|
||||
::testing::internal::GetCapturedStdout();
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(PotentialFileReaderTest, Si) {
|
||||
TEST_F(PotentialFileReaderTest, Si)
|
||||
{
|
||||
::testing::internal::CaptureStdout();
|
||||
PotentialFileReader reader(lmp, "Si.sw", "Stillinger-Weber");
|
||||
::testing::internal::GetCapturedStdout();
|
||||
@ -74,7 +78,8 @@ TEST_F(PotentialFileReaderTest, Si) {
|
||||
ASSERT_EQ(utils::count_words(line), PairSW::NPARAMS_PER_LINE);
|
||||
}
|
||||
|
||||
TEST_F(PotentialFileReaderTest, Comb) {
|
||||
TEST_F(PotentialFileReaderTest, Comb)
|
||||
{
|
||||
::testing::internal::CaptureStdout();
|
||||
PotentialFileReader reader(lmp, "ffield.comb", "COMB");
|
||||
::testing::internal::GetCapturedStdout();
|
||||
@ -83,7 +88,8 @@ TEST_F(PotentialFileReaderTest, Comb) {
|
||||
ASSERT_EQ(utils::count_words(line), PairComb::NPARAMS_PER_LINE);
|
||||
}
|
||||
|
||||
TEST_F(PotentialFileReaderTest, Comb3) {
|
||||
TEST_F(PotentialFileReaderTest, Comb3)
|
||||
{
|
||||
::testing::internal::CaptureStdout();
|
||||
PotentialFileReader reader(lmp, "ffield.comb3", "COMB3");
|
||||
::testing::internal::GetCapturedStdout();
|
||||
@ -92,7 +98,8 @@ TEST_F(PotentialFileReaderTest, Comb3) {
|
||||
ASSERT_EQ(utils::count_words(line), PairComb3::NPARAMS_PER_LINE);
|
||||
}
|
||||
|
||||
TEST_F(PotentialFileReaderTest, Tersoff) {
|
||||
TEST_F(PotentialFileReaderTest, Tersoff)
|
||||
{
|
||||
::testing::internal::CaptureStdout();
|
||||
PotentialFileReader reader(lmp, "Si.tersoff", "Tersoff");
|
||||
::testing::internal::GetCapturedStdout();
|
||||
@ -101,7 +108,8 @@ TEST_F(PotentialFileReaderTest, Tersoff) {
|
||||
ASSERT_EQ(utils::count_words(line), PairTersoff::NPARAMS_PER_LINE);
|
||||
}
|
||||
|
||||
TEST_F(PotentialFileReaderTest, TersoffMod) {
|
||||
TEST_F(PotentialFileReaderTest, TersoffMod)
|
||||
{
|
||||
::testing::internal::CaptureStdout();
|
||||
PotentialFileReader reader(lmp, "Si.tersoff.mod", "Tersoff/Mod");
|
||||
::testing::internal::GetCapturedStdout();
|
||||
@ -110,7 +118,8 @@ TEST_F(PotentialFileReaderTest, TersoffMod) {
|
||||
ASSERT_EQ(utils::count_words(line), PairTersoffMOD::NPARAMS_PER_LINE);
|
||||
}
|
||||
|
||||
TEST_F(PotentialFileReaderTest, TersoffModC) {
|
||||
TEST_F(PotentialFileReaderTest, TersoffModC)
|
||||
{
|
||||
::testing::internal::CaptureStdout();
|
||||
PotentialFileReader reader(lmp, "Si.tersoff.modc", "Tersoff/ModC");
|
||||
::testing::internal::GetCapturedStdout();
|
||||
@ -119,7 +128,8 @@ TEST_F(PotentialFileReaderTest, TersoffModC) {
|
||||
ASSERT_EQ(utils::count_words(line), PairTersoffMODC::NPARAMS_PER_LINE);
|
||||
}
|
||||
|
||||
TEST_F(PotentialFileReaderTest, TersoffZBL) {
|
||||
TEST_F(PotentialFileReaderTest, TersoffZBL)
|
||||
{
|
||||
::testing::internal::CaptureStdout();
|
||||
PotentialFileReader reader(lmp, "SiC.tersoff.zbl", "Tersoff/ZBL");
|
||||
::testing::internal::GetCapturedStdout();
|
||||
@ -128,7 +138,8 @@ TEST_F(PotentialFileReaderTest, TersoffZBL) {
|
||||
ASSERT_EQ(utils::count_words(line), PairTersoffZBL::NPARAMS_PER_LINE);
|
||||
}
|
||||
|
||||
TEST_F(PotentialFileReaderTest, GW) {
|
||||
TEST_F(PotentialFileReaderTest, GW)
|
||||
{
|
||||
::testing::internal::CaptureStdout();
|
||||
PotentialFileReader reader(lmp, "SiC.gw", "GW");
|
||||
::testing::internal::GetCapturedStdout();
|
||||
@ -137,7 +148,8 @@ TEST_F(PotentialFileReaderTest, GW) {
|
||||
ASSERT_EQ(utils::count_words(line), PairGW::NPARAMS_PER_LINE);
|
||||
}
|
||||
|
||||
TEST_F(PotentialFileReaderTest, GWZBL) {
|
||||
TEST_F(PotentialFileReaderTest, GWZBL)
|
||||
{
|
||||
::testing::internal::CaptureStdout();
|
||||
PotentialFileReader reader(lmp, "SiC.gw.zbl", "GW/ZBL");
|
||||
::testing::internal::GetCapturedStdout();
|
||||
@ -146,7 +158,8 @@ TEST_F(PotentialFileReaderTest, GWZBL) {
|
||||
ASSERT_EQ(utils::count_words(line), PairGWZBL::NPARAMS_PER_LINE);
|
||||
}
|
||||
|
||||
TEST_F(PotentialFileReaderTest, Nb3bHarmonic) {
|
||||
TEST_F(PotentialFileReaderTest, Nb3bHarmonic)
|
||||
{
|
||||
::testing::internal::CaptureStdout();
|
||||
PotentialFileReader reader(lmp, "MOH.nb3b.harmonic", "NB3B Harmonic");
|
||||
::testing::internal::GetCapturedStdout();
|
||||
@ -155,7 +168,8 @@ TEST_F(PotentialFileReaderTest, Nb3bHarmonic) {
|
||||
ASSERT_EQ(utils::count_words(line), PairNb3bHarmonic::NPARAMS_PER_LINE);
|
||||
}
|
||||
|
||||
TEST_F(PotentialFileReaderTest, Vashishta) {
|
||||
TEST_F(PotentialFileReaderTest, Vashishta)
|
||||
{
|
||||
::testing::internal::CaptureStdout();
|
||||
PotentialFileReader reader(lmp, "SiC.vashishta", "Vashishta");
|
||||
::testing::internal::GetCapturedStdout();
|
||||
|
||||
Reference in New Issue
Block a user