From 1fd6af33e41f85aa5e9533820cd01e65d54a1013 Mon Sep 17 00:00:00 2001 From: Mike Smith Date: Wed, 29 Nov 2023 13:48:28 +0100 Subject: [PATCH] Fix leaking reference to dataspace --- .github/workflows/main.yml | 2 -- tests/testthat/test_H5A.R | 8 +++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3cc4e5f..e225fb4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,11 +1,9 @@ on: push: branches: - - master - devel pull_request: branches: - - master - devel name: R-CMD-check diff --git a/tests/testthat/test_H5A.R b/tests/testthat/test_H5A.R index 20754ff..24e40fa 100644 --- a/tests/testthat/test_H5A.R +++ b/tests/testthat/test_H5A.R @@ -152,16 +152,18 @@ test_that("fixed length string attributes are correct", { H5Tset_size(tid, nchar(attr_value)) fid <- H5Fopen(h5File) + sid <- H5Screate("H5S_SCALAR") aid <- H5Acreate(fid, name = attr_name, - dtype_id=tid, h5space=H5Screate("H5S_SCALAR")) + dtype_id=tid, h5space = sid) H5Awrite(aid, attr_value) # string of length 7 - H5Aclose(aid) - H5Fclose(fid) + h5closeAll(aid, sid, fid) attr <- h5readAttributes(h5File, "/") expect_is(attr, class = "list") expect_equal(names(attr), attr_name) expect_equal(attr$name, attr_value) }) + +expect_length(h5validObjects(), 0)