Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
Not running yet

Update #548
  • Loading branch information
eugenwintersberger committed Aug 8, 2022
1 parent 1bb573c commit 094d93c
Show file tree
Hide file tree
Showing 28 changed files with 37 additions and 21 deletions.
11 changes: 1 addition & 10 deletions src/h5cpp/attribute/attribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <h5cpp/attribute/attribute.hpp>
#include <h5cpp/core/utilities.hpp>
#include <h5cpp/node/link.hpp>
#include <h5cpp/contrib/stl/string.hpp>
//#include <h5cpp/contrib/stl/string.hpp>

namespace hdf5 {
namespace attribute {
Expand Down Expand Up @@ -97,15 +97,6 @@ const node::Link &Attribute::parent_link() const noexcept
return parent_link_;
}

void Attribute::write(const char *data) const
{
write(std::string(data));
}

void Attribute::write(const char *data,const datatype::Datatype &mem_type) const
{
write(std::string(data),mem_type);
}

void Attribute::check_size(const dataspace::Dataspace &mem_space,
const dataspace::Dataspace &file_space,
Expand Down
13 changes: 10 additions & 3 deletions src/h5cpp/attribute/attribute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <h5cpp/error/error.hpp>
#include <initializer_list>
#include <h5cpp/core/utilities.hpp>
#include <h5cpp/contrib/stl/vector.hpp>
//#include <h5cpp/contrib/stl/vector.hpp>

namespace hdf5 {
namespace attribute {
Expand Down Expand Up @@ -143,7 +143,10 @@ class DLL_EXPORT Attribute
//!
//! \throws std::runtime_error in case of a failure
//!
void write(const char *data) const;
void write(const char *data) const
{
write(std::string(data));
}

//!
//! \brief write from initializer list
Expand Down Expand Up @@ -194,7 +197,11 @@ class DLL_EXPORT Attribute
//!
template<typename T>
void write(const T& data,const datatype::Datatype &mem_type) const;
void write(const char *data,const datatype::Datatype &mem_type) const;
void write(const char *data,const datatype::Datatype &mem_type) const
{
write(std::string(data),mem_type);
}


template<typename T>
void read(T &data) const;
Expand Down
2 changes: 1 addition & 1 deletion test/attribute/attribute_fixed_string_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//
#include <catch2/catch.hpp>
#include <h5cpp/hdf5.hpp>
#include <h5cpp/contrib/stl/string.hpp>
#include <h5cpp/contrib/stl/stl.hpp>
#include <string>
#include <vector>

Expand Down
1 change: 1 addition & 0 deletions test/attribute/attribute_management_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
//
#include <catch2/catch.hpp>
#include <h5cpp/hdf5.hpp>
#include <h5cpp/contrib/stl/stl.hpp>

using namespace hdf5;

Expand Down
1 change: 1 addition & 0 deletions test/attribute/attribute_scalar_io_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <catch2/catch.hpp>
#include <cstdint>
#include <h5cpp/hdf5.hpp>
#include <h5cpp/contrib/stl/stl.hpp>
#include <vector>

using namespace hdf5;
Expand Down
1 change: 1 addition & 0 deletions test/attribute/attribute_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <h5cpp/dataspace/dataspace.hpp>
#include <h5cpp/file/functions.hpp>
#include <h5cpp/node/group.hpp>
#include <h5cpp/contrib/stl/stl.hpp>


using namespace hdf5;
Expand Down
2 changes: 1 addition & 1 deletion test/attribute/attribute_variable_string_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <h5cpp/hdf5.hpp>
#include <string>
#include <vector>
#include <h5cpp/contrib/stl/string.hpp>
#include <h5cpp/contrib/stl/stl.hpp>

using namespace hdf5;

Expand Down
1 change: 1 addition & 0 deletions test/contrib/nexus/attribute_h5py_bool_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
//
#include <catch2/catch.hpp>
#include <h5cpp/contrib/nexus/ebool.hpp>
#include <h5cpp/contrib/stl/stl.hpp>
#include <h5cpp/hdf5.hpp>

using namespace hdf5;
Expand Down
1 change: 1 addition & 0 deletions test/contrib/nexus/attribute_pniio_bool_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
//
#include <catch2/catch.hpp>
#include <h5cpp/contrib/nexus/ebool.hpp>
#include <h5cpp/contrib/stl/stl.hpp>
#include <h5cpp/datatype/enum.hpp>
#include <h5cpp/hdf5.hpp>

Expand Down
1 change: 1 addition & 0 deletions test/contrib/nexus/dataset_h5py_bool_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
//
#include <catch2/catch.hpp>
#include <h5cpp/hdf5.hpp>
#include <h5cpp/contrib/stl/stl.hpp>
#include "../../utilities.hpp"
#include "utilities.hpp"

Expand Down
1 change: 1 addition & 0 deletions test/contrib/nexus/dataset_pniio_bool_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
//
#include <catch2/catch.hpp>
#include <h5cpp/hdf5.hpp>
#include <h5cpp/contrib/stl/stl.hpp>
#include "utilities.hpp"
#include "../../utilities.hpp"

Expand Down
2 changes: 1 addition & 1 deletion test/contrib/nexus/ebool_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include <h5cpp/hdf5.hpp>
#include <h5cpp/contrib/stl/string.hpp>
#include <h5cpp/contrib/stl/stl.hpp>
#include <h5cpp/contrib/nexus/ebool.hpp>


Expand Down
2 changes: 1 addition & 1 deletion test/file/file_image_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <h5cpp/core/filesystem.hpp>
#include <h5cpp/file/functions.hpp>
#include <h5cpp/node/group.hpp>
#include <h5cpp/contrib/stl/string.hpp>
#include <h5cpp/contrib/stl/stl.hpp>
#include <h5cpp/core/utilities.hpp>

using namespace hdf5;
Expand Down
1 change: 1 addition & 0 deletions test/file/file_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <catch2/catch.hpp>
#include <h5cpp/file/functions.hpp>
#include <h5cpp/node/group.hpp>
#include <h5cpp/contrib/stl/stl.hpp>

using namespace hdf5;

Expand Down
1 change: 1 addition & 0 deletions test/node/chunked_dataset_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
//
#include <catch2/catch.hpp>
#include <h5cpp/hdf5.hpp>
#include <h5cpp/contrib/stl/stl.hpp>

using namespace hdf5;

Expand Down
2 changes: 1 addition & 1 deletion test/node/dataset_array_type_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <algorithm>
#include <catch2/catch.hpp>
#include <h5cpp/hdf5.hpp>
#include <h5cpp/contrib/stl/vector.hpp>
#include <h5cpp/contrib/stl/stl.hpp>

template <typename T>
struct Vector {
Expand Down
1 change: 1 addition & 0 deletions test/node/dataset_bool_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
//
#include <catch2/catch.hpp>
#include <h5cpp/hdf5.hpp>
#include <h5cpp/contrib/stl/stl.hpp>

using namespace hdf5;

Expand Down
2 changes: 1 addition & 1 deletion test/node/dataset_const_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <h5cpp/hdf5.hpp>
#include <array>
#include <cstdint>
#include <h5cpp/contrib/stl/array.hpp>
#include <h5cpp/contrib/stl/stl.hpp>

using namespace hdf5;

Expand Down
1 change: 1 addition & 0 deletions test/node/dataset_direct_chunk_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
//
#include <catch2/catch.hpp>
#include <h5cpp/hdf5.hpp>
#include <h5cpp/contrib/stl/stl.hpp>

using namespace hdf5;

Expand Down
1 change: 1 addition & 0 deletions test/node/dataset_dynamic_type_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <algorithm>
#include <catch2/catch.hpp>
#include <h5cpp/hdf5.hpp>
#include <h5cpp/contrib/stl/stl.hpp>

struct Flip {
public:
Expand Down
1 change: 1 addition & 0 deletions test/node/dataset_extent_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <catch2/catch.hpp>
#include <h5cpp/hdf5.hpp>
#include <h5cpp/contrib/stl/stl.hpp>

using namespace hdf5;

Expand Down
1 change: 1 addition & 0 deletions test/node/dataset_fixed_string_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
//
#include <catch2/catch.hpp>
#include <h5cpp/hdf5.hpp>
#include <h5cpp/contrib/stl/stl.hpp>

using namespace hdf5;

Expand Down
1 change: 1 addition & 0 deletions test/node/dataset_h5py_string_compat_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
//
#include <catch2/catch.hpp>
#include <h5cpp/hdf5.hpp>
#include <h5cpp/contrib/stl/stl.hpp>
#include <h5cpp/core/utilities.hpp>

using namespace hdf5;
Expand Down
2 changes: 1 addition & 1 deletion test/node/dataset_partial_io_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
//
#include <catch2/catch.hpp>
#include <h5cpp/hdf5.hpp>
#include <h5cpp/contrib/stl/string.hpp>
#include <h5cpp/contrib/stl/stl.hpp>

using namespace hdf5;

Expand Down
1 change: 1 addition & 0 deletions test/node/dataset_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <catch2/catch.hpp>
#include <h5cpp/hdf5.hpp>
#include <h5cpp/contrib/stl/stl.hpp>

using namespace hdf5;

Expand Down
2 changes: 1 addition & 1 deletion test/node/dataset_variable_string_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// Created on: Oct 25, 2017
//
#include <catch2/catch.hpp>
#include <h5cpp/contrib/stl/string.hpp>
#include <h5cpp/contrib/stl/stl.hpp>
#include <h5cpp/hdf5.hpp>

using namespace hdf5;
Expand Down
1 change: 1 addition & 0 deletions test/node/dataset_vlen_array_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <examples/h5cpp/hklpoint.hpp>
#include <examples/hklpoint.hpp>
#include <h5cpp/hdf5.hpp>
#include <h5cpp/contrib/stl/stl.hpp>

using namespace hdf5;

Expand Down
1 change: 1 addition & 0 deletions test/node/node_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <catch2/catch.hpp>
#include <h5cpp/file/functions.hpp>
#include <h5cpp/node/functions.hpp>
#include <h5cpp/contrib/stl/stl.hpp>

using namespace hdf5;

Expand Down

0 comments on commit 094d93c

Please sign in to comment.