1 #define BOOST_TEST_DYN_LINK
2 #include <boost/test/unit_test.hpp>
21 for(
int branch = 0; branch < tree.
size(); ++branch) {
23 for(
int orbit = 0; orbit < tree[branch].
size(); ++orbit) {
24 nclust[branch].
push_back(tree[branch][orbit].size());
30 BOOST_AUTO_TEST_SUITE(BasicStructureSiteTest)
35 fs::path test_cases_path(
"tests/unit/clusterography/test_cases.json");
39 for(
auto test_it = tests.
begin(); test_it != tests.
end(); ++test_it) {
48 BOOST_CHECK_MESSAGE(j.
contains(
"title"),
"test case 'title' is required");
49 BOOST_CHECK_MESSAGE(j.
contains(
"prim"),
"test case 'prim' is required");
50 BOOST_CHECK_MESSAGE(j.
contains(
"bspecs"),
"test case 'bspecs' is required");
70 BOOST_AUTO_TEST_SUITE_END()
ClustJsonHelper< ValueType > jsonHelper(ValueType &_value, const Structure &_struc, double tol=TOL)
iterator end()
Returns iterator to end of JSON object or JSON array.
BOOST_AUTO_TEST_CASE(ClusterographyTest)
Structure specifies the lattice and atomic basis of a crystal.
jsonParser & to_json(const ClexDescription &desc, jsonParser &json)
iterator begin()
Returns const_iterator to beginning of JSON object or JSON array.
BasicStructure< Site > read_prim(fs::path filename)
bool get_else(T &t, const std::string &key, const T &default_value, Args...args) const
bool check(std::string test, const jsonParser &expected, const jsonParser &calculated, fs::path test_cases_path, bool quiet, double tol=0.0)
Check expected JSON vs calculated JSON using BOOST_CHECK_EQUAL.
jsonParser expected_Nclusters(const SiteOrbitree &tree)
jsonParser & push_back(const T &value)
Puts new valued element at end of array of any type T for which 'jsonParser& to_json( const T &value...
bool contains(const std::string &name) const
Return true if JSON object contains 'name'.
static jsonParser array()
Returns an empty json array.
SiteOrbitree make_orbitree(Structure &prim, const jsonParser &json, double _tol)
Make orbitree. For now specifically global.
Index size(Index np) const
Number of orbits in OrbitBranch 'np'.