8476323dff10d0aca3173d630acc57c43d22e8b2
[alexxy/gromacs.git] / python_packaging / sample_restraint / tests / test_binding.cpp
1 //
2 // Created by Eric Irrgang on 11/9/17.
3 //
4
5 #include "testingconfiguration.h"
6
7 #include <memory>
8 #include <vector>
9
10 #include "gmxapi/md/mdmodule.h"
11
12 #include "gromacs/restraint/restraintpotential.h"
13
14 #include <gtest/gtest.h>
15
16 namespace
17 {
18
19 const auto filename = plugin::testing::sample_tprfilename;
20
21 class NullRestraint : public gmx::IRestraintPotential
22 {
23     public:
24         gmx::PotentialPointData evaluate(gmx::Vector r1,
25                                          gmx::Vector r2,
26                                          double t) override
27         {
28             return {};
29         }
30
31         std::vector<int> sites() const override
32         {
33             return {0,0};
34         }
35 };
36
37 class SimpleApiModule : public gmxapi::MDModule
38 {
39     public:
40         const char *name() const override
41         {
42             return "NullApiModule";
43         }
44
45         std::shared_ptr<gmx::IRestraintPotential> getRestraint() override
46         {
47             auto restraint = std::make_shared<NullRestraint>();
48             return restraint;
49         }
50 };
51
52 } // end anonymous namespace