From 8fba847b9d653aa17a5b6fc0125beccb40ecf746 Mon Sep 17 00:00:00 2001 From: Tomasz Bursztyka Date: Thu, 22 Jan 2015 17:58:22 +0200 Subject: [PATCH] unit: Update to the new mpdu_validate API mpdu_validate will directly return a const pointer if the validation succeeds. --- unit/test-mpdu.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/unit/test-mpdu.c b/unit/test-mpdu.c index 2a977d39..753845ce 100644 --- a/unit/test-mpdu.c +++ b/unit/test-mpdu.c @@ -63,13 +63,10 @@ static struct deauthentication_data deauthentication_test_1 = { static void deauthentication_test(const void *data) { const struct deauthentication_data *test = data; - struct mpdu *mpdu; - bool ret; + const struct mpdu *mpdu; - ret = mpdu_validate(test->frame, test->frame_len); - assert(ret); - - mpdu = (struct mpdu *)test->frame; + mpdu = mpdu_validate(test->frame, test->frame_len); + assert(mpdu); assert(mpdu->fc.type == MPDU_TYPE_MANAGEMENT); assert(mpdu->fc.subtype == MPDU_MANAGEMENT_SUBTYPE_DEAUTHENTICATION);