Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add comments to code for future reference, no functional change #832

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion tests/unit/tests_high_five_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,21 @@ TEST_CASE("Test allocation time") {
CHECK(alloc_size == data.size() * sizeof(decltype(data)::value_type));
}

/*
* Test to ensure legacy support: DataSet used to have a default constructor.
* However, it is not useful to have a DataSet object that does not actually
* refer to a dataset in a file. Hence, the the default constructor was
* deprecated.
* This test is to ensure that the constructor is not accidentally removed and
* thereby break users' code.
*/
TEST_CASE("Test default constructors") {
const std::string file_name("h5_default_ctors.h5");
const std::string dataset_name("dset");
File file(file_name, File::Truncate);
auto ds = file.createDataSet(dataset_name, std::vector<int>{1, 2, 3, 4, 5});

DataSet d2; // deprecated as it constructs unsafe objects
DataSet d2; // expect deprecation warning, as it constructs unsafe object
// d2.getFile(); // runtime error
CHECK(!d2.isValid());
d2 = ds; // copy
Expand Down
Loading