Skip to content

Commit

Permalink
Fix 'unused parameter' warnings in C++ tests (#5199)
Browse files Browse the repository at this point in the history
  • Loading branch information
derobins authored Jan 2, 2025
1 parent 00adfce commit ed082ac
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 11 deletions.
4 changes: 4 additions & 0 deletions c++/test/dsets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,8 @@ test_dset(const void *params)
fapl_id = h5_fileaccess(); // in h5test.c, returns a file access template
int nerrors = 0; // keep track of number of failures occur

(void)params;

try {
// Use the file access template id to create a file access prop.
// list object to pass in H5File::H5File
Expand Down Expand Up @@ -1505,6 +1507,8 @@ test_dset(const void *params)
extern "C" void
cleanup_dsets(void *params)
{
(void)params;

if (GetTestCleanup()) {
HDremove(FILE1.c_str());
HDremove(FILE_ACCPLIST.c_str());
Expand Down
4 changes: 4 additions & 0 deletions c++/test/tarray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,8 @@ test_array_info()
extern "C" void
test_array(const void *params)
{
(void)params;

// Output message about test being performed
MESSAGE(5, ("Testing Array Datatypes\n"));

Expand All @@ -504,6 +506,8 @@ test_array(const void *params)
extern "C" void
cleanup_array(void *params)
{
(void)params;

if (GetTestCleanup()) {
HDremove(FILENAME.c_str());
}
Expand Down
4 changes: 4 additions & 0 deletions c++/test/tattr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1958,6 +1958,8 @@ test_attr_corder_create_basic(FileCreatPropList &fcpl, FileAccPropList &fapl)
extern "C" void
test_attr(const void *params)
{
(void)params;

// Output message about test being performed
MESSAGE(5, ("Testing Attributes\n"));

Expand Down Expand Up @@ -2043,6 +2045,8 @@ test_attr(const void *params)
extern "C" void
cleanup_attr(void *params)
{
(void)params;

if (GetTestCleanup()) {
HDremove(FILE_BASIC.c_str());
HDremove(FILE_COMPOUND.c_str());
Expand Down
4 changes: 4 additions & 0 deletions c++/test/tcompound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,8 @@ test_compound_set_size()
extern "C" void
test_compound(const void *params)
{
(void)params;

// Output message about test being performed
MESSAGE(5, ("Testing Compound Data Type operations\n"));

Expand All @@ -755,6 +757,8 @@ test_compound(const void *params)
extern "C" void
cleanup_compound(void *params)
{
(void)params;

if (GetTestCleanup()) {
HDremove(COMPFILE.c_str());
}
Expand Down
4 changes: 4 additions & 0 deletions c++/test/tdspl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ test_transfplist()
extern "C" void
test_dsproplist(const void *params)
{
(void)params;

// Output message about test being performed
MESSAGE(5, ("Testing Generic Dataset Property Lists\n"));

Expand All @@ -134,6 +136,8 @@ test_dsproplist(const void *params)
extern "C" void
cleanup_dsproplist(void *params)
{
(void)params;

if (GetTestCleanup()) {
HDremove(FILENAME.c_str());
}
Expand Down
11 changes: 6 additions & 5 deletions c++/test/tfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,8 @@ test_file_info()
extern "C" void
test_file(const void *params)
{
(void)params;

// Output message about test being performed
MESSAGE(5, ("Testing File I/O Operations\n"));

Expand All @@ -992,12 +994,11 @@ test_file(const void *params)
* Return none
*-------------------------------------------------------------------------
*/
#ifdef __cplusplus
extern "C"
#endif
void
cleanup_file(void *params)
extern "C" void
cleanup_file(void *params)
{
(void)params;

if (GetTestCleanup()) {
HDremove(FILE1.c_str());
HDremove(FILE2.c_str());
Expand Down
4 changes: 4 additions & 0 deletions c++/test/tfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ const H5std_string FILE1("tfilters.h5");
extern "C" void
test_filters(const void *params)
{
(void)params;

// Output message about test being performed
MESSAGE(5, ("Testing Various Filters\n"));

Expand Down Expand Up @@ -261,6 +263,8 @@ test_filters(const void *params)
extern "C" void
cleanup_filters(void *params)
{
(void)params;

if (GetTestCleanup()) {
HDremove(FILE1.c_str());
}
Expand Down
4 changes: 4 additions & 0 deletions c++/test/th5s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,8 @@ test_h5s_compound_scalar_read()
extern "C" void
test_h5s(const void *params)
{
(void)params;

// Output message about test being performed
MESSAGE(5, ("Testing Dataspaces\n"));

Expand All @@ -495,6 +497,8 @@ test_h5s(const void *params)
extern "C" void
cleanup_h5s(void *params)
{
(void)params;

if (GetTestCleanup()) {
HDremove(DATAFILE.c_str());
}
Expand Down
4 changes: 4 additions & 0 deletions c++/test/titerate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@ test_HDFFV_9920()
extern "C" void
test_iterate(const void *params)
{
(void)params;

// Output message about test being performed
MESSAGE(5, ("Testing Iterate Feature\n"));

Expand All @@ -466,6 +468,8 @@ test_iterate(const void *params)
extern "C" void
cleanup_iterate(void *params)
{
(void)params;

if (GetTestCleanup()) {
HDremove(FILE_ITERATE.c_str());
HDremove(FILE_NAME.c_str());
Expand Down
4 changes: 4 additions & 0 deletions c++/test/tlinks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,8 @@ test_links(const void *params)
hid_t fapl_id, fapl2_id; /* File access property lists */
unsigned new_format; /* Whether to use the new format or not */

(void)params;

if ((fapl_id = h5_fileaccess()) < 0)
throw Exception("test_links", "Unable to get file access property list");

Expand Down Expand Up @@ -771,6 +773,8 @@ test_links(const void *params)
extern "C" void
cleanup_links(void *params)
{
(void)params;

if (GetTestCleanup()) {
HDremove(FILENAME[0]);
HDremove(FILENAME[1]);
Expand Down
10 changes: 4 additions & 6 deletions c++/test/tobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,6 @@ test_open_object_header()
* file will return the same file "number".
*
* Return None
*
* July, 2018
*-------------------------------------------------------------------------
*/
const H5std_string FILE_OBJINFO("tobject_getinfo.h5");
Expand Down Expand Up @@ -599,8 +597,6 @@ test_getobjectinfo_same_file()
* the property setting.
*
* Return None
*
* April, 2019
*-------------------------------------------------------------------------
*/
const H5std_string FILE_INTERGRPS("tobject_intergrps.h5");
Expand Down Expand Up @@ -713,13 +709,13 @@ test_intermediate_groups()
*
* Return Success: 0
* Failure: -1
*
* March 4, 2014
*-------------------------------------------------------------------------
*/
extern "C" void
test_object(const void *params)
{
(void)params;

// Output message about test being performed
MESSAGE(5, ("Testing Object Functions\n"));

Expand All @@ -744,6 +740,8 @@ test_object(const void *params)
extern "C" void
cleanup_object(void *params)
{
(void)params;

if (GetTestCleanup()) {
HDremove(FILE_OBJECTS.c_str());
HDremove(FILE_OBJHDR.c_str());
Expand Down
4 changes: 4 additions & 0 deletions c++/test/trefer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,8 @@ test_reference_region_1D()
extern "C" void
test_reference(const void *params)
{
(void)params;

// Output message about test being performed
MESSAGE(5, ("Testing References\n"));

Expand All @@ -850,6 +852,8 @@ test_reference(const void *params)
extern "C" void
cleanup_reference(void *params)
{
(void)params;

if (GetTestCleanup()) {
HDremove(FILE1.c_str());
HDremove(FILE2.c_str());
Expand Down
4 changes: 4 additions & 0 deletions c++/test/ttypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,8 @@ test_operators()
extern "C" void
test_types(const void *params)
{
(void)params;

// Output message about test being performed
MESSAGE(5, ("Testing Generic Data Types\n"));

Expand Down Expand Up @@ -1122,6 +1124,8 @@ test_types(const void *params)
extern "C" void
cleanup_types(void *params)
{
(void)params;

if (GetTestCleanup()) {
for (int i = 0; i < 6; i++)
HDremove(FILENAME[i]);
Expand Down
4 changes: 4 additions & 0 deletions c++/test/tvlstr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,8 @@ test_vl_rewrite()
extern "C" void
test_vlstrings(const void *params)
{
(void)params;

// Output message about test being performed
MESSAGE(5, ("Testing Variable-Length Strings"));

Expand Down Expand Up @@ -969,6 +971,8 @@ test_vlstrings(const void *params)
extern "C" void
cleanup_vlstrings(void *params)
{
(void)params;

if (GetTestCleanup()) {
HDremove(FILENAME.c_str());
HDremove(FILENAME2.c_str());
Expand Down

0 comments on commit ed082ac

Please sign in to comment.