diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/libcgrouptest.h | 1 | ||||
-rw-r--r-- | tests/test_functions.c | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/tests/libcgrouptest.h b/tests/libcgrouptest.h index 923828a..98b1ba9 100644 --- a/tests/libcgrouptest.h +++ b/tests/libcgrouptest.h @@ -30,6 +30,7 @@ #include <libcgroup.h> #include "../config.h" #include <unistd.h> +#include <inttypes.h> #define SIZE 100 /* Max size of a message to be printed */ #define NUM_MSGS 20 /* Number of such messsages */ diff --git a/tests/test_functions.c b/tests/test_functions.c index 80e4e90..d9ca88e 100644 --- a/tests/test_functions.c +++ b/tests/test_functions.c @@ -421,6 +421,7 @@ int group_modified(char *path_control_file, int value_type, char string_val[100]; FILE *fd; int error = 1; + int aux; fd = fopen(path_control_file, "r"); if (!fd) { @@ -432,17 +433,18 @@ int group_modified(char *path_control_file, int value_type, switch (value_type) { case BOOL: - fscanf(fd, "%d", &bool_val); + fscanf(fd, "%d", &aux); + bool_val = aux; if (bool_val == cval.val_bool) error = 0; break; case INT64: - fscanf(fd, "%lld", &int64_val); + fscanf(fd, "%" SCNi64, &int64_val); if (int64_val == cval.val_int64) error = 0; break; case UINT64: - fscanf(fd, "%llu", &uint64_val); + fscanf(fd, "%" SCNu64, &uint64_val); if (uint64_val == cval.val_uint64) error = 0; break; |