/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
- * David van der Spoel, Berk Hess, Erik Lindahl, and including many
- * others, as listed in the AUTHORS file in the top-level source
- * directory and at http://www.gromacs.org.
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
*
* GROMACS is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* \author Teemu Murtola <teemu.murtola@gmail.com>
* \ingroup module_trajectoryanalysis
*/
-#include <gtest/gtest.h>
+#include "gmxpre.h"
#include "gromacs/trajectoryanalysis/modules/angle.h"
+#include <gtest/gtest.h>
+
#include "testutils/cmdlinetest.h"
#include "moduletest.h"
*/
//! Test fixture for the angle analysis module.
-typedef gmx::test::TrajectoryAnalysisModuleTestFixture<gmx::analysismodules::Angle>
+typedef gmx::test::TrajectoryAnalysisModuleTestFixture<gmx::analysismodules::AngleInfo>
AngleModuleTest;
TEST_F(AngleModuleTest, ComputesSimpleAngles)
"-binw", "60"
};
setTopology("angle.gro");
- runTest(CommandLine::create(cmdline));
+ runTest(CommandLine(cmdline));
}
TEST_F(AngleModuleTest, ComputesDihedrals)
"-binw", "120"
};
setTopology("angle.gro");
- runTest(CommandLine::create(cmdline));
+ runTest(CommandLine(cmdline));
}
TEST_F(AngleModuleTest, ComputesVectorPairAngles)
"-binw", "60"
};
setTopology("angle.gro");
- runTest(CommandLine::create(cmdline));
+ runTest(CommandLine(cmdline));
}
TEST_F(AngleModuleTest, ComputesVectorPlanePairAngles)
"-binw", "60"
};
setTopology("angle.gro");
- runTest(CommandLine::create(cmdline));
+ runTest(CommandLine(cmdline));
}
TEST_F(AngleModuleTest, ComputesPlaneZAxisAngles)
"-binw", "60"
};
setTopology("angle.gro");
- runTest(CommandLine::create(cmdline));
+ runTest(CommandLine(cmdline));
}
TEST_F(AngleModuleTest, ComputesVectorSphereNormalZAxisAngles)
"-binw", "60"
};
setTopology("angle.gro");
- runTest(CommandLine::create(cmdline));
+ runTest(CommandLine(cmdline));
}
TEST_F(AngleModuleTest, ComputesVectorTimeZeroAngles)
};
setTopology("angle.gro");
setTrajectory("angle.gro");
- runTest(CommandLine::create(cmdline));
+ runTest(CommandLine(cmdline));
+}
+
+TEST_F(AngleModuleTest, ComputesMultipleAngles)
+{
+ const char *const cmdline[] = {
+ "angle",
+ "-g1", "vector",
+ "-group1",
+ "resname RV1 RV2 and name A1 A2",
+ "resname RV3 RV4 and name A1 A2",
+ "-g2", "plane",
+ "-group2",
+ "resname RP1 RP2 and name A1 A2 A3",
+ "resname RP1 RP2 and name A1 A2 A3",
+ "-binw", "60"
+ };
+ setTopology("angle.gro");
+ runTest(CommandLine(cmdline));
+}
+
+TEST_F(AngleModuleTest, HandlesDynamicSelections)
+{
+ const char *const cmdline[] = {
+ "angle",
+ "-g1", "angle", "-group1", "resname RA1 RA2 and name A1 A2 A3 and z < 0.5",
+ "-binw", "60"
+ };
+ setTopology("angle.gro");
+ runTest(CommandLine(cmdline));
+}
+
+TEST_F(AngleModuleTest, HandlesOneVsMultipleVectorAngles)
+{
+ const char *const cmdline[] = {
+ "angle",
+ "-g1", "vector", "-group1", "resname RV1 RV2 and name A1 A2",
+ "-g2", "vector", "-group2", "resname RV3 and name A1 A2",
+ "-binw", "60"
+ };
+ setTopology("angle.gro");
+ runTest(CommandLine(cmdline));
+}
+
+TEST_F(AngleModuleTest, HandlesOneVsMultipleVectorGroupsAngles)
+{
+ const char *const cmdline[] = {
+ "angle",
+ "-g1", "vector",
+ "-group1",
+ "resname RV1 and name A1 A2",
+ "resname RV3 RV4 and name A1 A2",
+ "-g2", "plane",
+ "-group2",
+ "resname RP1 RP2 and name A1 A2 A3",
+ "-binw", "60"
+ };
+ setTopology("angle.gro");
+ runTest(CommandLine(cmdline));
}
} // namespace