summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJan Safranek <jsafrane@redhat.com>2009-08-06 14:03:32 +0200
committerDhaval Giani <dhaval@linux.vnet.ibm.com>2009-08-29 10:50:25 +0530
commitba948c63f487789e8c3e8478c0edeb15ff716214 (patch)
tree0d9119b4496109fdd4b39a3c4a3fb089efff6e7d /tests
parent6f93cd767947d29c51a8d9fefeb7e582b0a324a2 (diff)
downloadlibcg-ba948c63f487789e8c3e8478c0edeb15ff716214.tar.gz
libcg-ba948c63f487789e8c3e8478c0edeb15ff716214.tar.xz
libcg-ba948c63f487789e8c3e8478c0edeb15ff716214.zip
Remove warnings from test_functions.c
Fix following warnings: test_functions.c: In function ‘group_modified’: test_functions.c:435: warning: format ‘%d’ expects type ‘int *’, but argument 3 has type ‘_Bool *’ test_functions.c:440: warning: format ‘%lld’ expects type ‘long long int *’, but argument 3 has type ‘int64_t *’ test_functions.c:445: warning: format ‘%llu’ expects type ‘long long unsigned int *’, but argument 3 has type ‘u_int64_t *’ Signed-off-by: Jan Safranek <jsafrane@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/libcgrouptest.h1
-rw-r--r--tests/test_functions.c8
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;