Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Unity builds #536

Merged
merged 3 commits into from
May 18, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/transports/sentry_disk_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "sentry_string.h"

static void
send_envelope(sentry_envelope_t *envelope, void *state)
send_envelope_disk_transport(sentry_envelope_t *envelope, void *state)
{
const sentry_run_t *run = state;

Expand All @@ -18,7 +18,7 @@ send_envelope(sentry_envelope_t *envelope, void *state)
sentry_transport_t *
sentry_new_disk_transport(const sentry_run_t *run)
{
sentry_transport_t *transport = sentry_transport_new(send_envelope);
sentry_transport_t *transport = sentry_transport_new(send_envelope_disk_transport);
if (!transport) {
return NULL;
}
Expand Down
4 changes: 2 additions & 2 deletions src/transports/sentry_function_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct transport_state {
};

static void
send_envelope(sentry_envelope_t *envelope, void *_state)
send_envelope_function_transport(sentry_envelope_t *envelope, void *_state)
{
struct transport_state *state = _state;
state->func(envelope, state->data);
Expand All @@ -29,7 +29,7 @@ sentry_new_function_transport(
state->func = func;
state->data = data;

sentry_transport_t *transport = sentry_transport_new(send_envelope);
sentry_transport_t *transport = sentry_transport_new(send_envelope_function_transport);
if (!transport) {
sentry_free(state);
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "sentry_testsupport.h"

#define XX(Name) void CONCAT(test_sentry_, Name)(void);
#define XX(Name) SENTRY_TEST(Name);
#include "tests.inc"
#undef XX

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/sentry_testsupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "../vendor/acutest.h"

#define CONCAT(A, B) A##B
#define SENTRY_TEST(Name) void CONCAT(test_sentry_, Name)(void **UNUSED(state))
#define SENTRY_TEST(Name) void CONCAT(test_sentry_, Name)(void)
#define SKIP_TEST() (void)0

#define TEST_CHECK_STRING_EQUAL(Val, ReferenceVal) \
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_attachments.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ typedef struct {
} sentry_attachments_testdata_t;

static void
send_envelope(const sentry_envelope_t *envelope, void *_data)
send_envelope_test_attachments(const sentry_envelope_t *envelope, void *_data)
{
sentry_attachments_testdata_t *data = _data;
data->called += 1;
Expand All @@ -34,7 +34,7 @@ SENTRY_TEST(lazy_attachments)
sentry_options_set_auto_session_tracking(options, false);
sentry_options_set_dsn(options, "https://foo@sentry.invalid/42");
sentry_options_set_transport(
options, sentry_new_function_transport(send_envelope, &testdata));
options, sentry_new_function_transport(send_envelope_test_attachments, &testdata));
sentry_options_set_release(options, "prod");

sentry_options_add_attachment(options, PREFIX ".existing-file-attachment");
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <sentry.h>

static void
send_envelope(const sentry_envelope_t *envelope, void *data)
send_envelope_test_basic(const sentry_envelope_t *envelope, void *data)
{
uint64_t *called = data;
*called += 1;
Expand Down Expand Up @@ -34,7 +34,7 @@ SENTRY_TEST(basic_function_transport)
sentry_options_t *options = sentry_options_new();
sentry_options_set_dsn(options, "https://foo@sentry.invalid/42");
sentry_options_set_transport(
options, sentry_new_function_transport(send_envelope, &called));
options, sentry_new_function_transport(send_envelope_test_basic, &called));
sentry_options_set_release(options, "prod");
sentry_options_set_require_user_consent(options, true);
sentry_init(options);
Expand Down Expand Up @@ -80,7 +80,7 @@ SENTRY_TEST(sampling_before_send)
sentry_options_t *options = sentry_options_new();
sentry_options_set_dsn(options, "https://foo@sentry.invalid/42");
sentry_options_set_transport(options,
sentry_new_function_transport(send_envelope, &called_transport));
sentry_new_function_transport(send_envelope_test_basic, &called_transport));
sentry_options_set_before_send(options, before_send, &called_beforesend);
sentry_options_set_sample_rate(options, 0.75);
sentry_init(options);
Expand Down