Skip to content

Commit

Permalink
Test for zlib: conjunct test in p4est and sc
Browse files Browse the repository at this point in the history
  • Loading branch information
cburstedde committed Dec 15, 2023
1 parent 11d090c commit cafeb66
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 5 deletions.
10 changes: 10 additions & 0 deletions src/p4est_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ p4est_is_initialized (void)
return p4est_initialized;
}

int
p4est_have_zlib (void)
{
#ifndef P4EST_HAVE_ZLIB
return 0;
#else
return sc_have_zlib ();
#endif
}

int
p4est_get_package_id (void)
{
Expand Down
5 changes: 5 additions & 0 deletions src/p4est_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,11 @@ void p4est_init (sc_log_handler_t log_handler,
*/
int p4est_is_initialized (void);

/** Check for a sufficiently recent zlib installation.
* \return True if zlib is detected in both sc and p4est.
*/
int p4est_have_zlib (void);

/** Query the package identity as registered in libsc.
* \return This is -1 before \ref p4est_init has been called
* and a proper package identifier (>= 0) afterwards.
Expand Down
2 changes: 1 addition & 1 deletion test/test_balance2.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ main (int argc, char **argv)
p4est_init (NULL, SC_LP_DEFAULT);

/* check for ZLIB usability */
if (!(have_zlib = sc_have_zlib ())) {
if (!(have_zlib = p4est_have_zlib ())) {
P4EST_GLOBAL_LERROR
("Not found a working ZLIB installation: ignoring CRCs\n");
}
Expand Down
2 changes: 1 addition & 1 deletion test/test_balance_type2.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ main (int argc, char **argv)
p4est_init (NULL, SC_LP_DEFAULT);

/* check for ZLIB usability */
if (!(have_zlib = sc_have_zlib ())) {
if (!(have_zlib = p4est_have_zlib ())) {
P4EST_GLOBAL_LERROR
("Not found a working ZLIB installation: ignoring CRCs\n");
}
Expand Down
2 changes: 1 addition & 1 deletion test/test_loadsave2.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ test_loadsave (p4est_connectivity_t * connectivity, const char *prefix,
P4EST_GLOBAL_INFOF ("Using file names %s and %s\n", conn_name, p4est_name);

/* check for ZLIB usability */
if (!(have_zlib = sc_have_zlib ())) {
if (!(have_zlib = p4est_have_zlib ())) {
P4EST_GLOBAL_LERROR
("Not found a working ZLIB installation: ignoring CRCs\n");
}
Expand Down
2 changes: 1 addition & 1 deletion test/test_partition2.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ main (int argc, char **argv)
p4est_init (NULL, SC_LP_DEFAULT);

/* check for ZLIB usability */
if (!(have_zlib = sc_have_zlib ())) {
if (!(have_zlib = p4est_have_zlib ())) {
P4EST_GLOBAL_LERROR
("Not found a working ZLIB installation: ignoring CRCs\n");
}
Expand Down
2 changes: 1 addition & 1 deletion test/test_valid2.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ check_all (sc_MPI_Comm mpicomm, p4est_connectivity_t * conn,
P4EST_GLOBAL_STATISTICSF ("Testing configuration %s\n", vtkname);

/* check for ZLIB usability */
if (!(have_zlib = sc_have_zlib ())) {
if (!(have_zlib = p4est_have_zlib ())) {
P4EST_GLOBAL_LERROR
("Not found a working ZLIB installation: ignoring CRCs\n");
crc_expected = crc_partition_expected = gcrc_expected = 0;
Expand Down

0 comments on commit cafeb66

Please sign in to comment.