summaryrefslogtreecommitdiffstats
path: root/test/ttsafe.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-10-01 14:04:36 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-10-01 14:04:36 (GMT)
commitf1ba03cea5b82699a984c80bd2deac14fdc8df18 (patch)
treeebe777c3e0b83f4c4cec9212731da9ebe0a0cfd3 /test/ttsafe.c
parent10343c197906415388f2a4c8d292e21d25cf7381 (diff)
downloadhdf5-f1ba03cea5b82699a984c80bd2deac14fdc8df18.zip
hdf5-f1ba03cea5b82699a984c80bd2deac14fdc8df18.tar.gz
hdf5-f1ba03cea5b82699a984c80bd2deac14fdc8df18.tar.bz2
Source formatted
Diffstat (limited to 'test/ttsafe.c')
-rw-r--r--test/ttsafe.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/test/ttsafe.c b/test/ttsafe.c
index 2de460b..d2085b9 100644
--- a/test/ttsafe.c
+++ b/test/ttsafe.c
@@ -32,9 +32,8 @@
/* ANY new test needs to have a prototype in ttsafe.h */
#include "ttsafe.h"
-
#define MAX_NUM_NAME 1000
-#define NAME_OFFSET 6 /* offset for "name<num>" */
+#define NAME_OFFSET 6 /* offset for "name<num>" */
/* pre-condition: num must be a non-negative number */
H5_ATTR_PURE static unsigned
@@ -42,10 +41,10 @@ num_digits(int num)
{
unsigned u;
- if(num == 0)
+ if (num == 0)
return 1;
- for(u = 0; num > 0; u++)
+ for (u = 0; num > 0; u++)
num = num / 10;
return u;
@@ -59,43 +58,45 @@ tts_is_threadsafe(void)
hbool_t should_be;
#ifdef H5_HAVE_THREADSAFE
- is_ts = FALSE;
+ is_ts = FALSE;
should_be = TRUE;
-#else /* H5_HAVE_THREADSAFE */
- is_ts = TRUE;
+#else /* H5_HAVE_THREADSAFE */
+ is_ts = TRUE;
should_be = FALSE;
#endif /* H5_HAVE_THREADSAFE */
- if(H5is_library_threadsafe(&is_ts) != SUCCEED)
- TestErrPrintf("H5_is_library_threadsafe() call failed - test failed\n");
+ if (H5is_library_threadsafe(&is_ts) != SUCCEED)
+ TestErrPrintf("H5_is_library_threadsafe() call failed - test failed\n");
- if(is_ts != should_be)
- TestErrPrintf("Thread-safety value incorrect - test failed\n");
+ if (is_ts != should_be)
+ TestErrPrintf("Thread-safety value incorrect - test failed\n");
return;
}
/* Routine to generate attribute names for numeric values */
-char *gen_name(int value)
+char *
+gen_name(int value)
{
- char *temp;
+ char * temp;
unsigned length;
- int i;
+ int i;
- length = num_digits(MAX_NUM_NAME - 1);
- temp = (char *)HDmalloc(NAME_OFFSET + length + 1);
- temp = HDstrcpy(temp, "attrib");
+ length = num_digits(MAX_NUM_NAME - 1);
+ temp = (char *)HDmalloc(NAME_OFFSET + length + 1);
+ temp = HDstrcpy(temp, "attrib");
temp[NAME_OFFSET + length] = '\0';
for (i = (int)(length - 1); i >= 0; i--) {
temp[NAME_OFFSET + i] = (char)((int)'0' + value % 10);
- value = value / 10;
+ value = value / 10;
}
return temp;
}
-int main(int argc, char *argv[])
+int
+main(int argc, char *argv[])
{
/* Initialize testing framework */
@@ -123,7 +124,7 @@ int main(int argc, char *argv[])
TestInfo(argv[0]);
/* Parse command line arguments */
- TestParseCmdLine(argc,argv);
+ TestParseCmdLine(argc, argv);
/* Perform requested testing */
PerformTests();
@@ -142,4 +143,3 @@ int main(int argc, char *argv[])
return GetTestNumErrs();
} /* end main() */
-