-
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.
Split nest_test_data into data and helpers
- Loading branch information
1 parent
94778bc
commit f30db1f
Showing
26 changed files
with
416 additions
and
273 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
//------------------------------------------------------------------------------ | ||
// nest in situ vis | ||
// | ||
// Copyright (c) 2017-2018 RWTH Aachen University, Germany, | ||
// Virtual Reality & Immersive Visualisation Group. | ||
//------------------------------------------------------------------------------ | ||
// License | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
//------------------------------------------------------------------------------ | ||
|
||
#ifndef NIV_INCLUDE_NIV_TESTING_CONDUIT_SCHEMA_HPP_ | ||
#define NIV_INCLUDE_NIV_TESTING_CONDUIT_SCHEMA_HPP_ | ||
|
||
namespace niv { | ||
namespace testing { | ||
namespace conduit_schema { | ||
|
||
template <typename T> | ||
inline std::string OpenTag(T tag) { | ||
std::stringstream s; | ||
s << '\"' << tag << '\"' << ":{ \n"; | ||
return s.str(); | ||
} | ||
|
||
inline std::string CloseTag() { return std::string("} \n"); } | ||
inline std::string CloseTagNext() { return std::string("}, \n"); } | ||
|
||
inline std::string DoubleData(std::size_t offset) { | ||
std::stringstream s; | ||
s << "dtype:float64, "; | ||
s << "number_of_elements:1, "; | ||
s << "offset:" << offset << ", "; | ||
s << "stride:8, "; | ||
s << "element_bytes:8"; | ||
s << "\n"; | ||
return s.str(); | ||
} | ||
|
||
inline void RemoveNextIndicator(std::stringstream* s) { | ||
s->clear(); | ||
s->seekp(s->str().size() - 3); | ||
*s << " \n"; | ||
} | ||
|
||
} // namespace conduit_schema | ||
} // namespace testing | ||
} // namespace niv | ||
|
||
#endif // NIV_INCLUDE_NIV_TESTING_CONDUIT_SCHEMA_HPP_ |
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,57 @@ | ||
//------------------------------------------------------------------------------ | ||
// nest in situ vis | ||
// | ||
// Copyright (c) 2017-2018 RWTH Aachen University, Germany, | ||
// Virtual Reality & Immersive Visualisation Group. | ||
//------------------------------------------------------------------------------ | ||
// License | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
//------------------------------------------------------------------------------ | ||
|
||
#ifndef NIV_INCLUDE_NIV_TESTING_HELPERS_HPP_ | ||
#define NIV_INCLUDE_NIV_TESTING_HELPERS_HPP_ | ||
|
||
#include "conduit/conduit_node.hpp" | ||
|
||
namespace niv { | ||
namespace testing { | ||
|
||
class Helpers; | ||
|
||
void Send(const conduit::Node& node); | ||
|
||
conduit::Node AnyNode(); | ||
conduit::Node AnotherNode(); | ||
|
||
conduit::Node AnyUpdate(); | ||
conduit::Node UpdatedNode(); | ||
conduit::Node UpdatedNodeAllZeros(); | ||
|
||
conduit::Node ADifferentNode(); | ||
|
||
static const conduit::Node ANY_NODE{AnyNode()}; | ||
static const conduit::Node ANOTHER_NODE{AnotherNode()}; | ||
|
||
static const conduit::Node ANY_UPDATE{AnyUpdate()}; | ||
static const conduit::Node UPDATED_NODE{UpdatedNode()}; | ||
static const conduit::Node UPDATED_NODE_ALL_ZEROS{UpdatedNodeAllZeros()}; | ||
|
||
static const conduit::Node A_DIFFERENT_NODE{ADifferentNode()}; | ||
|
||
static const double ANY_VALUE{4.123}; | ||
|
||
} // namespace testing | ||
} // namespace niv | ||
|
||
#endif // NIV_INCLUDE_NIV_TESTING_HELPERS_HPP_ |
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
Oops, something went wrong.