reformat unittest tree with clang-format

This commit is contained in:
Axel Kohlmeyer
2021-08-23 17:06:30 -04:00
parent 0f8b331d8f
commit 6bc8da05b9
37 changed files with 501 additions and 453 deletions

View File

@ -14,15 +14,15 @@
#include "atom.h"
#include "info.h"
#include "input.h"
#include "variable.h"
#include "library.h"
#include "variable.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <cmath>
#include <cstring>
#include <vector>
#include <functional>
#include <vector>
#include "../testing/core.h"
#include "../testing/systems/melt.h"
@ -32,16 +32,17 @@
#define XSTR(val) #val
std::string INPUT_FOLDER = STRINGIFY(TEST_INPUT_FOLDER);
const char * LOREM_IPSUM = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent metus.";
const char *LOREM_IPSUM =
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent metus.";
bool verbose = false;
using LAMMPS_NS::utils::split_words;
namespace LAMMPS_NS {
using ::testing::MatchesRegex;
using ::testing::StrEq;
using ::testing::Eq;
using ::testing::HasSubstr;
using ::testing::MatchesRegex;
using ::testing::StrEq;
class PythonPackageTest : public LAMMPSTest {
protected:
@ -115,7 +116,8 @@ TEST_F(PythonPackageTest, InvokeFunctionPassString)
// execute python function, passing string as argument
HIDE_OUTPUT([&] {
command("variable val python bool_to_val");
command("python bool_to_val input 1 \"true\" format sf return v_val file ${input_dir}/func.py");
command(
"python bool_to_val input 1 \"true\" format sf return v_val file ${input_dir}/func.py");
});
ASSERT_EQ(get_variable_value("val"), 1.0);
@ -126,7 +128,8 @@ TEST_F(PythonPackageTest, InvokeFunctionPassStringVariable)
// execute python function, passing string variable as argument
HIDE_OUTPUT([&] {
command("variable val python bool_to_val");
command("python bool_to_val input 1 v_str format sf return v_val file ${input_dir}/func.py");
command(
"python bool_to_val input 1 v_str format sf return v_val file ${input_dir}/func.py");
});
HIDE_OUTPUT([&] {
@ -147,7 +150,8 @@ TEST_F(PythonPackageTest, InvokeStringFunction)
// execute python function, passing string variable as argument
HIDE_OUTPUT([&] {
command("variable str python val_to_bool");
command("python val_to_bool input 1 v_val format is return v_str file ${input_dir}/func.py");
command(
"python val_to_bool input 1 v_val format is return v_str file ${input_dir}/func.py");
});
HIDE_OUTPUT([&] {
@ -264,8 +268,7 @@ TEST_F(PythonPackageTest, RunSourceInline)
command("python xyz source \"\"\"\n"
"from __future__ import print_function\n"
"print(2+2)\n"
"\"\"\""
);
"\"\"\"");
});
ASSERT_THAT(output, HasSubstr("4"));
@ -287,9 +290,9 @@ TEST_F(FixPythonInvokeTest, end_of_step)
});
auto lines = utils::split_lines(output);
int count = 0;
int count = 0;
for(auto & line : lines) {
for (auto &line : lines) {
if (line == "PYTHON_END_OF_STEP") ++count;
}
@ -312,9 +315,9 @@ TEST_F(FixPythonInvokeTest, post_force)
});
auto lines = utils::split_lines(output);
int count = 0;
int count = 0;
for(auto & line : lines) {
for (auto &line : lines) {
if (line == "PYTHON_POST_FORCE") ++count;
}