summaryrefslogtreecommitdiffstats
path: root/c++/test/tattr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright headers (#2184)Larry Knox2022-11-011-1/+0
| | | | | * Updated source file copyright headers to remove "Copyright by the Board of Trustees of the University of Illinois", which is kept in the top-level COPYING file.
* Fix c++ test failure (#2005)bmribler2022-08-121-48/+75
| | | | | | | | | | | | | | | | * Fix test failure Description: - Added two H5File constructors to open file with non-default fapl - Added non-default fapl to test functions - Commented certain renaming attribute tests because of the unexpected behavior in renaming an attribute (HDFFV-11327) Platform tested: Linux/64 (jelly) * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Develop clang 13 format (#1933)Allen Byrne2022-07-261-2/+2
| | | | | * Update format source to clang 13 * More format changes
* Fixes C++ sign-conversion warnings w/ clang 14 (#1870)Dana Robinson2022-07-111-4/+3
| | | | | | | * Fixes sign-conversion warnings w/ clang 14 * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Replaced several uses of sprintf with safer snprintf (#1383)Sean McBride2022-01-281-3/+3
| | | | | | | * Replaced several uses of sprintf with safer snprintf * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Used clang-tidy to change all floating point f suffixes to F (#1359)Sean McBride2022-01-281-1/+1
|
* More clang tidy (#908)Sean McBride2021-08-231-9/+9
| | | | | | | | | | | | | | | | | | | * Pacify clang-analyzer-unix.cstring.NullArg * Apply some bugprone-suspicious-string-compare * Apply some readability-simplify-boolean-expr * Apply some readability-make-member-function-const * Apple some bugprone-macro-parentheses * Changed an f suffix to L for `long double` * Applied some readability-uppercase-literal-suffix automatically * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Fixes C++ warnings when passing hsize_t values to printf in test code (#745)Dana Robinson2021-06-111-20/+32
|
* C++ warning and build fixes (#707)Dana Robinson2021-06-011-59/+89
| | | | | | | | | | | | * Committing clang-format changes * C++ build and warning updates * Fixes all warnings on C++ (with gcc 9.3) * Updates CMake and Autotools C++ builds * Undo warning clobber Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Fixed all clang-tidy bugprone-suspicious-string-compare warnings (#451)Sean McBride2021-03-101-1/+1
| | | | | | | | | * Fixed all clang-tidy bugprone-suspicious-string-compare warnings This change was generated entirely by clang-tidy itself. * Reformat code with clang v10.0.1. Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
* Removed checks/workarounds for pre-C++89 compatibility (#449)Sean McBride2021-03-101-4/+0
| | | | | | | | After 30+ years, just assume that the following exist: - extension-less includes - namespaces - std:: - static_cast - bool
* More warning fixes (#400)Sean McBride2021-03-041-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fixed -Wunused-local-typedef warning * Fixed -Wformat warnings In one case also removed a `z` character. There was a `z%d` that I think was supposed to be `%zd` * Fixed -Wshorten-64-to-32 warnings * Fixed -Wself-assign warnings * Fixed -Wreserved-id-macro warnings * Commit format changes from clang-format, clang version 10.0.1. * Fixed -Wself-assign warnings * Fixed -Wunused-local-typedef warning * Fixed -Wformat warnings In two cases also removed a `z` character. There was a `z%d` that was supposed to be `%zd`. * Fixed -Wshorten-64-to-32 warnings * Fixed -Wreserved-id-macro warnings * Fixed -Wself-assign warnings * Format source. * Remove blank lines to pass format check. Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
* Update license url part2 (#333)Larry Knox2021-02-171-1/+1
| | | | | | * Modify temporary rpath for testing in java example scripts. * Update URL in source file Copyright headers for web copy of COPYING file - files not in src or test.
* Clang-format of source filesAllen Byrne2020-09-301-419/+437
|
* Trim trailing whitespaceQuincey Koziol2020-04-201-2/+2
|
* Squashed commit of the token_refactoring branch:Dana Robinson2020-01-161-2/+2
|
* Develop normalization with vol_integration.Dana Robinson2018-09-191-4/+4
| | | | | Mostly peripheral things like the tools and wrappers, with just enough core library code to support that.
* Code improvementBinh-Minh Ribler2018-07-211-6/+6
| | | | | | | | | | | Description: Moved the new H5Object::getInfo member functions to H5Location and made them overloaded with the existing H5Location::getObjinfo. This way is cleaner than the previous approach. Platforms tested: Linux/64 (jelly) Linux/32 (jam) Darwin (osx1010test)
* Fixed HDFFV-10458 partiallyBinh-Minh Ribler2018-07-171-1/+18
| | | | | | | | | | | | | | | | | | | | Description: Added wrappers for H5Oget_info2 and H5Oget_info_by_name2. // Returns information about an HDF5 object. void getInfo(H5O_info_t& objinfo, unsigned fields = H5O_INFO_BASIC) // Returns information about an HDF5 object, given its name. void getInfo(const char* name, H5O_info_t& objinfo, unsigned fields = H5O_INFO_BASIC, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) void getInfo(const H5std_string& name, H5O_info_t& objinfo, unsigned fields = H5O_INFO_BASIC, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) Platforms tested: Linux/64 (jelly) Linux/32 (jam) Darwin (osx1010test)
* Various code cleanupBinh-Minh Ribler2017-12-041-130/+190
| | | | | | | | | | | Description: - Replaced H5Location::exists with H5Location::nameExists and marked H5Location::exists as deprecated. - Miscellaneous test cleanup for consistency. Platforms tested: Linux/32 2.6 (jam) Linux/64 (jelly) Darwin (osx1010test)
* Merge pull request #426 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:hdf5_1_10 to ↵Larry Knox2017-04-251-6/+4
| | | | | | | | | | hdf5_1_10 * commit '54957d37f5aa73912763dbb6e308555e863c43f4': Commit copyright header change for src/H5PLpkg.c which was added after running script to make changes. Add new files in release_docs to MANIFEST. Cimmit changes to Makefile.in(s) and H5PL.c that resulted from running autogen.sh. Merge pull request #407 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:hdf5_1_10_1 to hdf5_1_10_1 Change copyright headers to replace url referring to file to be removed and replace it with new url for COPYING file.
* Description:Binh-Minh Ribler2017-03-031-1031/+1031
| | | | | | Only format changes: mostly tabs vs. spaces Platforms tested: Linux/64 (jelly) - very minor
* Description:Binh-Minh Ribler2016-10-191-19/+7
| | | | | | | | | | | | Removed obsolet macros from C++ API: H5_NO_NAMESPACE, H5_NO_STD, __cplusplus Leave OLD_HEADER_FILENAME because iostream.h might still be in use, until further checking is done. Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test) Jelly
* Purpose: Code cleanupBinh-Minh Ribler2016-09-021-4/+8
| | | | | | | | | | Description: - Used FP_EPSILON in comparing float values to verify read data - Casted C macro to fix mismatched types in verify_val calls Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test)
* [svn-r29759] Purpose: Code improvementsBinh-Minh Ribler2016-04-221-30/+49
| | | | | | | | | | | | Description: - Changed object in catch statements to reference - Replaced old-style casts or reinterpret_cast with static_cast - Removed unused name H5Library::need_cleanup - Removed Exception::printError from documentation Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test)
* [svn-r28138] Add first support for _Bool and make hbool_t a "real" _Bool if ↵Jerome Soumagne2015-10-201-1/+1
| | | | | | | | | | | | | | available Fix tests accordingly and fix misuse of hbool_t in various places Fix initialization of H5Pgcpl/ocpl structs in property decoding routines Tested on: Linux/32 (jam) Linux/64 (platypus) Linux/PPC64 (ostrich) MacOSX/64 10.11
* [svn-r27961] Purpose: Partial fix of issues HDFFV-9169 and HDFFV-9167Binh-Minh Ribler2015-10-061-19/+266
| | | | | | | | | | | | | | | | | | | | | | Description: Added wrappers for H5P[s/g]et_attr_phase_change and H5P[s/g]et_attr_creation_order // Sets attribute storage phase change thresholds. void setAttrPhaseChange(unsigned max_compact = 8, unsigned min_dense = 6) // Gets attribute storage phase change thresholds. void getAttrPhaseChange(unsigned& max_compact, unsigned& min_dense) // Sets tracking and indexing of attribute creation order. void setAttrCrtOrder(unsigned crt_order_flags) // Gets tracking and indexing settings for attribute creation order. unsigned getAttrCrtOrder() Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test)
* [svn-r26655] Purpose: Fixed HDFFV-7947Binh-Minh Ribler2015-03-301-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Description: When copy constructor or constructor that takes an existing id is invoked, the C ref counter stays the same but there is an extra C++ object which later is destroyed and may cause the HDF5 id to be closed prematurely. The C++ library needs to increment the ref counter in these situations, so that the C library will not close the id when it is still being referenced. However, the incrementing of ref count left some objects opened at the end of the program, perhaps, due to compiler's optimization on cons/destructors. The constructor, that takes an existing id, needs to increment the counter but it seems that the matching destructor wasn't invoked. The workaround is to have a function for each class that has "id" that only sets the id and not increment the ref count for the library to use in these situations. These functions are "friend" and not public. The friend functions are: void f_Attribute_setId(Attribute *, hid_t) void f_DataSet_setId(DataSet *, hid_t) void f_DataSpace_setId(DataSpace *, hid_t) void f_DataType_setId(DataType *, hid_t) Platforms tested: Linux/64 (platypus) Linux/32 2.6 (jam gnu and Intel 15.0) SunOS 5.11 (emu)
* [svn-r26458] Purpose: Fix warnings HDFFV-8658Binh-Minh Ribler2015-03-151-26/+26
| | | | | | | | | Description: Fixed many type conversion warnings and unused variables. Platforms tested: Linux/64 (platypus) Linux/32 2.6 (jam) SunOS 5.11 (emu)
* [svn-r25061] Description:Binh-Minh Ribler2014-04-171-12/+24
| | | | | | | | | | | Put back overloaded functions for backward compatibility: - were replaced by better prototyped versions, such as Attribute::getName. - were modified to add const to constant arguments. Added notes for future removal in documentation. Platforms tested: Linux/ppc64 (ostrich) Linux/32 2.6 (jam) SunOS 5.11 (emu)
* [svn-r24994] Purpose: Removed some warningsBinh-Minh Ribler2014-04-091-3/+6
| | | | | | | | | Description: Turned on warnings and removed some of those. Platforms tested: Linux/ppc64 (ostrich) Linux/32 2.6 (jam) SunOS 5.11 (emu)
* [svn-r24969] Description:Binh-Minh Ribler2014-04-061-1/+7
| | | | | | | | | | | | | | - Added wrappers to H5Object for H5Iget_name() to get object's name ssize_t getObjName(char *obj_name, size_t buf_size = 0) const; ssize_t getObjName(H5std_string& obj_name, size_t len = 0) const; H5std_string getObjName() const; - Added tests tobject.cpp - Added to various cleanup_* functions in tests to remove generated files - Added an overload H5I_type_t getHDFObjType() to get object's type Platforms tested: Linux/ppc64 (ostrich) Linux/32 2.6 (jam) SunOS 5.11 (emu) with gmake
* [svn-r24938] Description:Binh-Minh Ribler2014-04-011-0/+118
| | | | | | | | | | | | | | | | | | | - Overloaded Atribute::getName to take a char* for the attribute name: ssize_t Attribute::getName(char* attr_name, size_t buf_size) - Switched the arguments in this function: ssize_t getName(size_t buf_size, H5std_string& attr_name) so it became: ssize_t getName(H5std_string& attr_name, size_t buf_size) The second argument is default to 0, and can be skipped. - Removed this function: H5std_string getName(size_t buf_size); it'll collide with the first function when that function takes a NULL for the first argument, and uses default value for the second argument. - Added more tests Platforms tested: Linux/ppc64 (ostrich) Linux/32 2.6 (jam) SunOS 5.11 (emu)
* [svn-r23438] Purpose: Fix bug HDFFV-7520Binh-Minh Ribler2013-03-231-4/+72
| | | | | | | | | Description: Added wrappers for H5Aexists. Platforms Tested: Linux/32 2.6 (jam) Linux/64 2.6 (koala) Linux/ppc64 (ostrich)
* [svn-r23427] Purpose: Fix bug HDFFV-8067Binh-Minh Ribler2013-03-221-2/+0
| | | | | | | | | | | | | | | | | | | | | | Description: + The C++ test failed with the new PGI compilers versions 12.4 and 12.5 + An exception thrown by an internal function, which was called by a constructor, was not propagating to the test program during the stack unwinding, so it couldn't be caught by the test and the program terminated. + Various trials and errors indicated that the problem is where an STD string converted to a char* being passed to the internal function, but confirmation has not been found yet. It could be a compiler bug. Solution: + Added a try/catch in the constructor around the internal function and re-throw the exception when it is caught. This is a workaround. + Unrelated minor fixes: removed unused variables and MESSAGE's; commented out tvlstr.cpp/test_read_vl_string_attribute because it may be redundant, and commented out H5Tpkg.h inclusion because TEST_ALIGNMENT is not added yet and probably not necessary in the C++ API. Platforms tested: Linux/32 2.6 (jam) with PGI compilers Linux/32 2.6 (jam) with GNU compilers Linux/64 2.6 (koala)
* [svn-r22877] Description:Binh-Minh Ribler2012-10-101-1/+1
| | | | | | Changed uint to unsigned so that no hdf5-specific header file is needed. Platform tested: Linux/32 2.6 (jam) - very minor
* [svn-r22836] Purpose: Fix bug HDFFV-533 and add other missing functionsBinh-Minh Ribler2012-09-271-39/+96
| | | | | | | | | | | | | | | | | | | | | | Description: In this bug, H5File doesn't have the ability to create attribute. The following changes will provide that functionality and several others that were also missing: - Added an abstract class H5Location in between IdComponent and H5Object. - New class structure of IdComponent, H5Location, H5Object, H5File IdComponent | H5Location / \ H5Object H5File - Wrappers in H5Object were moved to H5Location because the related C functions take either file, group, dataset, or named datatype ID. - Added wrapper for H5Rget_obj_type2 - Added tests for file attributes and H5Rget_obj_type2 wrapper Platforms tested: Linux/32 2.6 (jam) Linux/64 2.6 (koala) SunOS 5.10 (linew)
* [svn-r18335] Description:Binh-Minh Ribler2010-02-261-13/+13
| | | | | | | | | | Removed header file testhdf5.h from C++ tests to eliminate a non-standard problem on OpenVMS. It wasn't essential. Platforms tested: Linux/32 2.6 (jam) FreeBSD/64 6.3 (liberty) Ray agreed to test on OpenVMS.
* [svn-r16816] Description:Binh-Minh Ribler2009-04-211-1/+11
| | | | | | | | | | | | | | Added member function Attribute::getInMemDataSize(), which is a wrapper of several C calls, to simplify getting the attribute's data size in memory. Used this new function in Attribute::read to get the fixed-len string attribute data. Added tests to tattr.cpp. Platforms tested: Linux/32 2.6 (jam) FreeBSD/64 6.3 (liberty) SunOS 5.10 (linew)
* [svn-r16787] Description:Binh-Minh Ribler2009-04-191-9/+69
| | | | | | | | | | | | | Fixed to pass parameters to H5Awrite/H5Aread correctly so that all Attribute::write and Attribute::read methods work correctly for both fixed-length and variable-length string attributes. Added more test cases. Platforms tested: Linux/32 2.6 (jam) FreeBSD/64 6.3 (liberty) SunOS 5.10 (linew)
* [svn-r15825] Description:Quincey Koziol2008-10-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Fix various problems with a the core & sec2 VFDs. Improve the h5_get_file_size() routine to handle files created with VFDs that use multiple files. Tested on: Mac OS X/32 10.5.5 (amazon) in debug mode Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
* [svn-r15628] Description:Quincey Koziol2008-09-161-1/+1
| | | | | | | | | | | | | Remove trailing whitespace from C/C++ source files, with the following script: foreach f (*.[ch] *.cpp) sed 's/[[:blank:]]*$//' $f > sed.out && mv sed.out $f end Tested on: Mac OS X/32 10.5.5 (amazon) No need for h5committest, just whitespace changes...
* [svn-r15395] When an attribute was opened twice and data was written with ↵Raymond Lu2008-07-221-13/+14
| | | | | | | | | | | one of the handles, the file didn't have the data. It happened because each handle had its own object structure, and the empty one overwrote the data with fill value. This is fixed by making some attribute information like the data be shared in the attribute structure. Tested on smirom, kagiso, and linew.
* [svn-r14144] Description:Quincey Koziol2007-09-131-0/+16
| | | | | | | | | | | | | | | | Move H5Gget_objinfo() to deprecated symbols section and retarget internal usage to H5Lget_info()/H5Oget_info(). Misc. other code cleanups... Tested on: FreeBSD/32 6.2 (duty) FreeBSD/64 6.2 (liberty) Linux/32 2.6 (kagiso) Linux/64 2.6 (smirom) AIX/32 5.3 (copper) Solaris/32 2.10 (linew) Mac OS X/32 10.4.10 (amazon)
* [svn-r13954] Purpose: Fix testBinh-Minh Ribler2007-07-081-0/+8
| | | | | | | | | | | | | | | | | Description: Compilers don't destroy temporary objects at the same time, some do immediately after use, some delay until the end of the scope. The delay makes it difficult to test the reference count functionality. Solution: Enclosed the operations on objects and check reference count after getting out of the enclosed block. This only works for the test! I'm assuming that checking reference count is just for the library to test that functionality; the user will not need to do that. :-/ Platforms tested: SunOS 5.10 (linew) Linux 2.6 (kagiso)
* [svn-r13524] Purpose: Cleanup testsBinh-Minh Ribler2007-03-171-73/+82
| | | | | | | | | | | Description: Added extern "C" to cleanup functions as well, forgot last time. Cleaned up/Added comments to some of the newly added tests. Platforms tested AIX 5.1 (copper) Linux 2.6 (kagiso) SunOS 5.8 64-bit (sol)
* [svn-r13474] Purpose: Fixed bugsBinh-Minh Ribler2007-03-081-2/+4
| | | | | | | | | | | | | | | | | Description: VMS revealed a problem in calling C++ test functions from C AddTest. Solution: Per Quincey's suggestion, added #ifdef __cplusplus extern "C" #endif to the called C++ functions. Platforms tested AIX 5.1 (copper) Linux 2.6 (kagiso) On pending: waiting for Elena to test on VMS when she comes back.
* [svn-r13253] Updated all C and C++ style source code files with the THG ↵Albert Cheng2007-02-071-2/+3
| | | | | | | | | copyright notice. Tested platform: Kagiso only since it is only a comment block change. If it works in one machine, it should work in all, I hope. Still need to check the parallel build on copper.
* [svn-r13093] Purpose: Adding testBinh-Minh Ribler2007-01-021-1/+1
| | | | | | | | | | Description: Added variable-length string tests. Platforms tested AIX 5.1 (copper) SunOS 5.8 64-bit (sol) Linux 2.6 (kagiso)
* [svn-r13082] Purpose: Code cleanupBinh-Minh Ribler2006-12-201-2/+2
| | | | | | | | | Description: Changed from hsize_t to int for rank constants to fix errors on Windows. Platform tested: Linux 2.6 (kagiso) Visual 6.0 on Windows XP