From e5832d90a9a0dad45350956cb6f8802ffd6afb16 Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 28 Jan 2022 23:28:38 +0000 Subject: test: Fixup tests for new gen function prototypes --- test/src/action_tests.c | 4 ++-- test/src/assoc_req_tests.c | 4 ++-- test/src/assoc_resp_tests.c | 4 ++-- test/src/auth_tests.c | 4 ++-- test/src/deauth_tests.c | 4 ++-- test/src/disassoc_tests.c | 4 ++-- test/src/probe_resp_tests.c | 4 ++-- test/src/reassoc_req_tests.c | 10 ++++++---- test/src/reassoc_resp_tests.c | 6 ++++-- test/src/timing_ad_tests.c | 2 +- 10 files changed, 25 insertions(+), 21 deletions(-) (limited to 'test') diff --git a/test/src/action_tests.c b/test/src/action_tests.c index 997095d..c8377b5 100644 --- a/test/src/action_tests.c +++ b/test/src/action_tests.c @@ -12,7 +12,7 @@ const unsigned char bcast[] = BCAST_MAC; int test_action_gen_full() { struct libwifi_action action = {0}; - int ret = libwifi_create_action(&action, bcast, to, ACTION_HT); + int ret = libwifi_create_action(&action, bcast, to, to, ACTION_HT); if (ret != 0) { fprintf(stderr, "Failed to create action: %s\n", strerror(ret)); return ret; @@ -42,7 +42,7 @@ int test_action_gen_full() { int test_action_add_detail() { struct libwifi_action action = {0}; - int ret = libwifi_create_action(&action, bcast, to, ACTION_HT); + int ret = libwifi_create_action(&action, bcast, to, to, ACTION_HT); if (ret != 0) { fprintf(stderr, "Failed to create action: %s\n", strerror(ret)); return ret; diff --git a/test/src/assoc_req_tests.c b/test/src/assoc_req_tests.c index fc6379f..32d199e 100644 --- a/test/src/assoc_req_tests.c +++ b/test/src/assoc_req_tests.c @@ -12,7 +12,7 @@ const unsigned char bcast[] = BCAST_MAC; int test_assoc_req_gen_full() { struct libwifi_assoc_req assoc_req = {0}; - int ret = libwifi_create_assoc_req(&assoc_req, bcast, to, "Some SSID", 11); + int ret = libwifi_create_assoc_req(&assoc_req, bcast, to, to, "Some SSID", 11); if (ret != 0) { fprintf(stderr, "Failed to create assoc_req: %s\n", strerror(ret)); return ret; @@ -42,7 +42,7 @@ int test_assoc_req_gen_full() { int test_assoc_req_add_tag() { struct libwifi_assoc_req assoc_req = {0}; - int ret = libwifi_create_assoc_req(&assoc_req, bcast, to, "Some SSID", 11); + int ret = libwifi_create_assoc_req(&assoc_req, bcast, to, to, "Some SSID", 11); if (ret != 0) { fprintf(stderr, "Failed to create assoc_req: %s\n", strerror(ret)); return ret; diff --git a/test/src/assoc_resp_tests.c b/test/src/assoc_resp_tests.c index 3a261ed..717a3cd 100644 --- a/test/src/assoc_resp_tests.c +++ b/test/src/assoc_resp_tests.c @@ -12,7 +12,7 @@ const unsigned char bcast[] = BCAST_MAC; int test_assoc_resp_gen_full() { struct libwifi_assoc_resp assoc_resp = {0}; - int ret = libwifi_create_assoc_resp(&assoc_resp, bcast, to, 11); + int ret = libwifi_create_assoc_resp(&assoc_resp, bcast, to, to, 11); if (ret != 0) { fprintf(stderr, "Failed to create assoc_resp: %s\n", strerror(ret)); return ret; @@ -42,7 +42,7 @@ int test_assoc_resp_gen_full() { int test_assoc_resp_add_tag() { struct libwifi_assoc_resp assoc_resp = {0}; - int ret = libwifi_create_assoc_resp(&assoc_resp, bcast, to, 11); + int ret = libwifi_create_assoc_resp(&assoc_resp, bcast, to, to, 11); if (ret != 0) { fprintf(stderr, "Failed to create assoc_resp: %s\n", strerror(ret)); return ret; diff --git a/test/src/auth_tests.c b/test/src/auth_tests.c index f78aeed..41dcefe 100644 --- a/test/src/auth_tests.c +++ b/test/src/auth_tests.c @@ -12,7 +12,7 @@ const unsigned char bcast[] = BCAST_MAC; int test_auth_gen_full() { struct libwifi_auth auth = {0}; - int ret = libwifi_create_auth(&auth, bcast, to, 0, 100, STATUS_SUCCESS); + int ret = libwifi_create_auth(&auth, bcast, to, to, 0, 100, STATUS_SUCCESS); if (ret != 0) { fprintf(stderr, "Failed to create auth: %s\n", strerror(ret)); return ret; @@ -42,7 +42,7 @@ int test_auth_gen_full() { int test_auth_add_tag() { struct libwifi_auth auth = {0}; - int ret = libwifi_create_auth(&auth, bcast, to, 0, 100, STATUS_SUCCESS); + int ret = libwifi_create_auth(&auth, bcast, to, to, 0, 100, STATUS_SUCCESS); if (ret != 0) { fprintf(stderr, "Failed to create auth: %s\n", strerror(ret)); return ret; diff --git a/test/src/deauth_tests.c b/test/src/deauth_tests.c index 9033574..99df9f6 100644 --- a/test/src/deauth_tests.c +++ b/test/src/deauth_tests.c @@ -12,7 +12,7 @@ const unsigned char bcast[] = BCAST_MAC; int test_deauth_gen_full() { struct libwifi_deauth deauth = {0}; - int ret = libwifi_create_deauth(&deauth, bcast, to, REASON_STA_LEAVING); + int ret = libwifi_create_deauth(&deauth, bcast, to, to, REASON_STA_LEAVING); if (ret != 0) { fprintf(stderr, "Failed to create deauth: %s\n", strerror(ret)); return ret; @@ -42,7 +42,7 @@ int test_deauth_gen_full() { int test_deauth_add_tag() { struct libwifi_deauth deauth = {0}; - int ret = libwifi_create_deauth(&deauth, bcast, to, REASON_STA_LEAVING); + int ret = libwifi_create_deauth(&deauth, bcast, to, to, REASON_STA_LEAVING); if (ret != 0) { fprintf(stderr, "Failed to create deauth: %s\n", strerror(ret)); return ret; diff --git a/test/src/disassoc_tests.c b/test/src/disassoc_tests.c index c5e27de..2e3da77 100644 --- a/test/src/disassoc_tests.c +++ b/test/src/disassoc_tests.c @@ -12,7 +12,7 @@ const unsigned char bcast[] = BCAST_MAC; int test_disassoc_gen_full() { struct libwifi_disassoc disassoc = {0}; - int ret = libwifi_create_disassoc(&disassoc, bcast, to, REASON_STA_LEAVING); + int ret = libwifi_create_disassoc(&disassoc, bcast, to, to, REASON_STA_LEAVING); if (ret != 0) { fprintf(stderr, "Failed to create disassoc: %s\n", strerror(ret)); return ret; @@ -42,7 +42,7 @@ int test_disassoc_gen_full() { int test_disassoc_add_tag() { struct libwifi_disassoc disassoc = {0}; - int ret = libwifi_create_disassoc(&disassoc, bcast, to, REASON_STA_LEAVING); + int ret = libwifi_create_disassoc(&disassoc, bcast, to, to, REASON_STA_LEAVING); if (ret != 0) { fprintf(stderr, "Failed to create disassoc: %s\n", strerror(ret)); return ret; diff --git a/test/src/probe_resp_tests.c b/test/src/probe_resp_tests.c index 463a90a..4f4f650 100644 --- a/test/src/probe_resp_tests.c +++ b/test/src/probe_resp_tests.c @@ -12,7 +12,7 @@ const unsigned char bcast[] = BCAST_MAC; int test_probe_resp_gen_full() { struct libwifi_probe_resp probe_resp = {0}; - int ret = libwifi_create_probe_resp(&probe_resp, bcast, to, "Some SSID", 11); + int ret = libwifi_create_probe_resp(&probe_resp, bcast, to, to, "Some SSID", 11); if (ret != 0) { fprintf(stderr, "Failed to create probe_resp: %s\n", strerror(ret)); return ret; @@ -42,7 +42,7 @@ int test_probe_resp_gen_full() { int test_probe_resp_add_tag() { struct libwifi_probe_resp probe_resp = {0}; - int ret = libwifi_create_probe_resp(&probe_resp, bcast, to, "Some SSID", 11); + int ret = libwifi_create_probe_resp(&probe_resp, bcast, to, to, "Some SSID", 11); if (ret != 0) { fprintf(stderr, "Failed to create probe_resp: %s\n", strerror(ret)); return ret; diff --git a/test/src/reassoc_req_tests.c b/test/src/reassoc_req_tests.c index 00e2b53..53cf6b9 100644 --- a/test/src/reassoc_req_tests.c +++ b/test/src/reassoc_req_tests.c @@ -4,15 +4,17 @@ #include #include -#define BCAST_MAC "\xff\xff\xff\xff\xff\xff" -#define TO_MAC "\x00\x20\x91\xAA\xBB\xCC" +#define BCAST_MAC "\xff\xff\xff\xff\xff\xff" +#define TO_MAC "\x00\x20\x91\xAA\xBB\xCC" +#define CURRENT_AP "\x00\x20\x91\x00\x11\x22" const unsigned char to[] = TO_MAC; const unsigned char bcast[] = BCAST_MAC; +const unsigned char current_ap[] = CURRENT_AP; int test_reassoc_req_gen_full() { struct libwifi_reassoc_req reassoc_req = {0}; - int ret = libwifi_create_reassoc_req(&reassoc_req, bcast, to, to, "Some SSID", 11); + int ret = libwifi_create_reassoc_req(&reassoc_req, bcast, to, to, current_ap, "Some SSID", 11); if (ret != 0) { fprintf(stderr, "Failed to create reassoc_req: %s\n", strerror(ret)); return ret; @@ -42,7 +44,7 @@ int test_reassoc_req_gen_full() { int test_reassoc_req_add_tag() { struct libwifi_reassoc_req reassoc_req = {0}; - int ret = libwifi_create_reassoc_req(&reassoc_req, bcast, to, to, "Some SSID", 11); + int ret = libwifi_create_reassoc_req(&reassoc_req, bcast, to, to, current_ap, "Some SSID", 11); if (ret != 0) { fprintf(stderr, "Failed to create reassoc_req: %s\n", strerror(ret)); return ret; diff --git a/test/src/reassoc_resp_tests.c b/test/src/reassoc_resp_tests.c index 8167916..fbfd448 100644 --- a/test/src/reassoc_resp_tests.c +++ b/test/src/reassoc_resp_tests.c @@ -6,13 +6,15 @@ #define BCAST_MAC "\xff\xff\xff\xff\xff\xff" #define TO_MAC "\x00\x20\x91\xAA\xBB\xCC" +#define CURRENT_AP "\x00\x20\x91\x00\x11\x22" const unsigned char to[] = TO_MAC; const unsigned char bcast[] = BCAST_MAC; +const unsigned char current_ap[] = CURRENT_AP; int test_reassoc_resp_gen_full() { struct libwifi_reassoc_resp reassoc_resp = {0}; - int ret = libwifi_create_reassoc_resp(&reassoc_resp, bcast, to, 11); + int ret = libwifi_create_reassoc_resp(&reassoc_resp, bcast, to, current_ap, 11); if (ret != 0) { fprintf(stderr, "Failed to create reassoc_resp: %s\n", strerror(ret)); return ret; @@ -42,7 +44,7 @@ int test_reassoc_resp_gen_full() { int test_reassoc_resp_add_tag() { struct libwifi_reassoc_resp reassoc_resp = {0}; - int ret = libwifi_create_reassoc_resp(&reassoc_resp, bcast, to, 11); + int ret = libwifi_create_reassoc_resp(&reassoc_resp, bcast, to, current_ap, 11); if (ret != 0) { fprintf(stderr, "Failed to create reassoc_resp: %s\n", strerror(ret)); return ret; diff --git a/test/src/timing_ad_tests.c b/test/src/timing_ad_tests.c index 59d20eb..2e2e5ba 100644 --- a/test/src/timing_ad_tests.c +++ b/test/src/timing_ad_tests.c @@ -19,7 +19,7 @@ int test_timing_ad_gen_full() { memcpy(ad_fields.time_value, "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA", 10); - int ret = libwifi_create_timing_advert(&time_ad, to, to, &ad_fields, "GB", -56, -56, -30, -20); + int ret = libwifi_create_timing_advert(&time_ad, bcast, to, to, &ad_fields, "GB", -56, -56, -30, -20); if (ret != 0) { fprintf(stderr, "Failed to create timing advert\n"); return ret; -- cgit 1.4.1