return DIAGNOSTICS_ERROR_NONE;
}
-STATIC int get_report_path(diagnostics_ctx_h ctx, const char **path, unsigned int *len)
+STATIC int get_report_path(diagnostics_ctx_h ctx, const char **path, size_t *len)
{
RETV_IF(ctx == NULL, DIAGNOSTICS_ERROR_INVALID_PARAMETER);
RETV_IF(path == NULL, DIAGNOSTICS_ERROR_INVALID_PARAMETER);
GVariant *val;
val = g_variant_get_child_value(((struct _diagnostics_ctx_s *)ctx)->signal->parameters, SIG_CRASH_REPORTPATH);
- *path = g_variant_get_string(val, len);
+ *path = g_variant_get_string(val, (gsize *)len);
return DIAGNOSTICS_ERROR_NONE;
}
RETV_IF(((struct _diagnostics_ctx_s *)ctx)->signal_type != SIG_TYPE_CRASH, DIAGNOSTICS_ERROR_NOT_SUPPORTED);
const char *report_path;
- unsigned int len;
+ size_t len;
int report_id;
int fd;
int ret;
extern struct _diagnostics_cb_info_s cb_info;
-int get_report_path(void *ctx, const char **path, unsigned int *len);
+int get_report_path(diagnostics_ctx_h ctx, const char **path, size_t *len);
struct _diagnostics_ctx_s *diagnostics_create(struct dbus_signal_s *signal);
struct _diagnostics_data_s *diagnostics_data_create(int fd);
void signal_handler(GDBusConnection *connection,
assert_int_equal(diagnostics_data_read(&data, buf, count, timeout, &bytes_read), DIAGNOSTICS_ERROR_IO_ERROR);
}
-int read(int fd, void *buf, size_t nbytes)
+ssize_t read(int fd, void *buf, size_t nbytes)
{
(void) fd;
(void) buf;
static void test_diagnostics_get_report_path_n1(void **state) {
(void) state;
const char *path;
- unsigned int len;
+ size_t len;
assert_int_equal(get_report_path(NULL, &path, &len), DIAGNOSTICS_ERROR_INVALID_PARAMETER);
}
static void test_diagnostics_get_report_path_n2(void **state) {
(void) state;
diagnostics_ctx_h br_ptr = build_ctx_crash();
- unsigned int len;
+ size_t len;
assert_int_equal(get_report_path(br_ptr, NULL, &len), DIAGNOSTICS_ERROR_INVALID_PARAMETER);
diagnostics_ctx_h ctx = build_ctx_crash();
((struct _diagnostics_ctx_s *)ctx)->signal_type = SIG_TYPE_CRASH + 10;
const char *path;
- unsigned int len;
+ size_t len;
assert_int_equal(get_report_path(ctx, &path, &len), DIAGNOSTICS_ERROR_NOT_SUPPORTED);
(void) state;
diagnostics_ctx_h ctx = build_ctx_crash();
const char *path;
- unsigned int len;
+ size_t len;
int result = get_report_path(ctx, &path, &len);
assert_int_equal(result, DIAGNOSTICS_ERROR_NONE);