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

align masters #9

Merged
merged 4 commits into from
Dec 12, 2019
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
added a hdf5 datetime attribute test
  • Loading branch information
reyntjesr committed Dec 10, 2019
commit 18716060fdb5a1084a07a1dedd931a6ddfe47d3e
6 changes: 6 additions & 0 deletions Hdf5Tests/Hdf5AttributeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,16 @@ public void WriteAndReadAttributes()
string strValue = "test";
string[] strValues = new string[2] { "test", "another test" };
bool boolValue = true;
DateTime dateValue = new DateTime(1969, 1, 12);
var groupStr = "/test";

//string concatFunc(string x) => string.Concat(groupStr, "/", x);
string intName = nameof(intValues);
string dblName = nameof(dblValue);
string strName = nameof(strValue);
string strNames = nameof(strValues);
string boolName = nameof(boolValue);
string dateName = nameof(dateValue);

try
{
Expand All @@ -85,6 +88,7 @@ public void WriteAndReadAttributes()
Hdf5.WriteAttribute(groupId, strName, strValue);
Hdf5.WriteAttributes<string>(groupId, strNames, strValues);
Hdf5.WriteAttribute(groupId, boolName, boolValue);
Hdf5.WriteAttribute(groupId, dateName, dateValue);
H5G.close(groupId);
Hdf5.CloseFile(fileId);
}
Expand All @@ -108,6 +112,8 @@ public void WriteAndReadAttributes()
Assert.IsTrue(strValues.SequenceEqual(readStrs));
bool readBool = Hdf5.ReadAttribute<bool>(groupId, boolName);
Assert.IsTrue(boolValue == readBool);
DateTime readDate = Hdf5.ReadAttribute<DateTime>(groupId, dateName);
Assert.IsTrue(dateValue == readDate);
H5G.close(groupId);
Hdf5.CloseFile(fileId);
}
Expand Down