From 51c7d9eb39f5413a690f9a1d76e27a2edf16bc67 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 23 May 2006 13:14:24 -0500 Subject: [svn-r12369] Purpose: Fixed bug Description: Shanti compiler destroy unnamed objects later than others, which caused some reference counting test fail. Revised the test so that destructors are called at the same time, regardless the differences of compiler implementation. Revised some constructors, close, operator=, and destructors to make sure that all the object ids are handled properly. Platforms tested: Linux 2.4 (heping) SunOS 5.9 (shanti) HPUX 11.00 (kelgia) AIX 5.1 (copper) --- c++/test/tattr.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 21fe503..e327493 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -1101,18 +1101,18 @@ test_attr_dtype_shared(void) fid1.openFile(FILENAME, H5F_ACC_RDWR); // Open dataset - dset = fid1.openDataSet(DSET1_NAME); + DataSet *dset2 = new DataSet (fid1.openDataSet(DSET1_NAME)); // Open attribute - attr = dset.openAttribute(ATTR1_NAME); + Attribute *attr2 = new Attribute (dset.openAttribute(ATTR1_NAME)); // Read data from the attribute - attr.read(PredType::NATIVE_INT, &rdata); + attr2->read(PredType::NATIVE_INT, &rdata); verify_val(data, rdata, "Attribute::read", __LINE__, __FILE__); // Close attribute and dataset - attr.close(); - dset.close(); + delete attr2; + delete dset2; // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); -- cgit v0.12