-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build] introduce catch2, update cmake
- Loading branch information
Showing
7 changed files
with
91 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
|
||
namespace molcore { | ||
|
||
class Region { | ||
|
||
public: | ||
|
||
virtual bool isin(const double x, const double y, const double z) const = 0; | ||
|
||
virtual ~Region() = default; | ||
|
||
private: | ||
|
||
|
||
}; | ||
|
||
class Boundary { | ||
|
||
public: | ||
|
||
virtual ~Boundary() = default; | ||
|
||
private: | ||
|
||
}; | ||
|
||
class Box : public Region, public Boundary { | ||
|
||
public: | ||
|
||
Box(); | ||
|
||
auto isin(const double x, const double y, const double z) const -> bool override; | ||
|
||
private: | ||
|
||
}; | ||
} // namespace molcore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "molcore/space.hpp" | ||
|
||
namespace molcore | ||
{ | ||
|
||
Box::Box() {} | ||
|
||
bool Box::isin(const double x, const double y, const double z) const | ||
{ | ||
return true; | ||
} | ||
} // namespace molcore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include <string> | ||
|
||
#include <catch2/catch_test_macros.hpp> | ||
|
||
#include "molcore/molcore.hpp" | ||
|
||
TEST_CASE("Exported Class", "[exported]") | ||
{ | ||
auto const exported = exported_class {}; | ||
|
||
CHECK(std::string("molcore") == exported.name()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include <catch2/catch_test_macros.hpp> | ||
|
||
#include "molcore/space.hpp" | ||
|
||
namespace molcore | ||
{ | ||
|
||
TEST_CASE("Test Space", "[Box]") | ||
{ | ||
auto box = Box(); | ||
CHECK(box.isin(1, 2, 3)); | ||
} | ||
|
||
} // namespace molcore |