Skip to content

Commit

Permalink
remove UNUSED macro from tests, use SF_UNUSED instead (#822)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-mkubik authored Jan 31, 2025
1 parent acd7134 commit 9f9d51d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 18 deletions.
20 changes: 10 additions & 10 deletions tests/test_bind_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define INPUT_ARRAY_SIZE 3

void test_bind_parameters(void **unused) {
UNUSED(unused);
SF_UNUSED(unused);
/* init */
SF_STATUS status;
SF_BIND_INPUT input_array[INPUT_ARRAY_SIZE];
Expand Down Expand Up @@ -354,17 +354,17 @@ void test_array_binding_core(unsigned int array_size, sf_bool fallback, int64 st
}

void test_array_binding_normal(void** unused) {
UNUSED(unused);
SF_UNUSED(unused);
test_array_binding_core(1000, SF_BOOLEAN_FALSE, 0, SF_BOOLEAN_FALSE);
}

void test_array_binding_stage(void** unused) {
UNUSED(unused);
SF_UNUSED(unused);
test_array_binding_core(100000, SF_BOOLEAN_FALSE, 0, SF_BOOLEAN_FALSE);
}

void test_array_binding_stage_fallback(void** unused) {
UNUSED(unused);
SF_UNUSED(unused);
// Azure SDK take too long (14min) to fail with invalid proxy
char* cenv = getenv("CLOUD_PROVIDER");
if (cenv && !strncmp(cenv, "AZURE", 5))
Expand All @@ -376,14 +376,14 @@ void test_array_binding_stage_fallback(void** unused) {
}

void test_array_binding_threshold(void** unused) {
UNUSED(unused);
SF_UNUSED(unused);
test_array_binding_core(1000, SF_BOOLEAN_FALSE, 500, SF_BOOLEAN_FALSE);
}

// test threshold with fallback so we can ensure stage binding
// is actually used with lower threshold and disabled after fallback
void test_array_binding_threshold_fallback(void** unused) {
UNUSED(unused);
SF_UNUSED(unused);
// Azure SDK take too long (14min) to fail with invalid proxy
char* cenv = getenv("CLOUD_PROVIDER");
if (cenv && !strncmp(cenv, "AZURE", 5))
Expand All @@ -395,12 +395,12 @@ void test_array_binding_threshold_fallback(void** unused) {
}

void test_array_binding_disable(void** unused) {
UNUSED(unused);
SF_UNUSED(unused);
test_array_binding_core(1000, SF_BOOLEAN_FALSE, 500, SF_BOOLEAN_TRUE);
}

void test_array_binding_supported_false_update(void** unused) {
UNUSED(unused);
SF_UNUSED(unused);
SF_STATUS status;
char bind_data_b[2][4] = { "2.3", "3.4" };
char bind_data_c[2][7] = { "bind", "insert" };
Expand Down Expand Up @@ -517,7 +517,7 @@ void test_array_binding_supported_false_update(void** unused) {
}

void test_array_binding_supported_false_insert(void** unused) {
UNUSED(unused);
SF_UNUSED(unused);

// SNOW-1878297 TODO: disable for now due to server issue.
// Sever returns arrayBindSupported=true while it's not really supported.
Expand Down Expand Up @@ -574,7 +574,7 @@ void test_array_binding_supported_false_insert(void** unused) {
}

void test_array_binding_supported_false_select(void** unused) {
UNUSED(unused);
SF_UNUSED(unused);
SF_STATUS status;
char bind_data[2][2] = { "1", "2" };

Expand Down
4 changes: 2 additions & 2 deletions tests/test_column_fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1542,12 +1542,12 @@ void test_column_length_with_bundle_202408_helper(sf_bool enabled)
}

void test_column_length_with_bundle_202408_disabled(void** unused) {
UNUSED(unused);
SF_UNUSED(unused);
test_column_length_with_bundle_202408_helper(SF_BOOLEAN_FALSE);
}

void test_column_length_with_bundle_202408_enabled(void** unused) {
UNUSED(unused);
SF_UNUSED(unused);
test_column_length_with_bundle_202408_helper(SF_BOOLEAN_TRUE);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/test_unit_connect_parameters.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ void test_connection_parameters_application(void **unused) {

extern sf_bool STDCALL renew_session(CURL* curl, SF_CONNECT* sf, SF_ERROR_STRUCT* error);
void test_connect_with_renew(void** unused) {
UNUSED(unused);
SF_UNUSED(unused);

SF_CONNECT* sf = setup_snowflake_connection();

Expand Down
4 changes: 2 additions & 2 deletions tests/test_unit_pat.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Test auth connection when the token was not provided.
*/
void test_pat_with_no_token(void **unused) {
UNUSED(unused);
SF_UNUSED(unused);
SF_CONNECT *sf = snowflake_init();
snowflake_set_attribute(sf, SF_CON_ACCOUNT, "test_account");
snowflake_set_attribute(sf, SF_CON_USER, "test_user");
Expand All @@ -32,7 +32,7 @@ void test_pat_with_no_token(void **unused) {
* Test the request body with pat connection.
*/
void test_json_data_in_pat(void **unused) {
UNUSED(unused);
SF_UNUSED(unused);
SF_CONNECT *sf = (SF_CONNECT *) SF_CALLOC(1, sizeof(SF_CONNECT));
sf->account = "testaccount";
sf->host = "testaccount.snowflakecomputing.com";
Expand Down
3 changes: 0 additions & 3 deletions tests/utils/test_setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ extern "C" {
#include <snowflake/client.h>
#include <snowflake/platform.h>

// Defined for unused function parameters.
#define UNUSED(x) (void)(x)

#define SKIP_IF_PROXY_ENV_IS_SET \
{ \
char envbuf[1024]; \
Expand Down

0 comments on commit 9f9d51d

Please sign in to comment.