Add test programs for checking libwpa_client linking

libwpa_test1 and libwpa_test2 targets can now be used to check
libwpa_client linking for static and shared library cases respectively.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2015-10-31 19:11:09 +02:00
parent 736b7cb2da
commit 1f1e619282
3 changed files with 43 additions and 0 deletions

View file

@ -0,0 +1,32 @@
/*
* libwpa_test - Test program for libwpa_client.* library linking
* Copyright (c) 2015, Jouni Malinen <j@w1.fi>
*
* This software may be distributed under the terms of the BSD license.
* See README for more details.
*/
#include "includes.h"
#include "common/wpa_ctrl.h"
int main(int argc, char *argv[])
{
struct wpa_ctrl *ctrl;
ctrl = wpa_ctrl_open("foo");
if (!ctrl)
return -1;
if (wpa_ctrl_attach(ctrl) == 0)
wpa_ctrl_detach(ctrl);
if (wpa_ctrl_pending(ctrl)) {
char buf[10];
size_t len;
len = sizeof(buf);
wpa_ctrl_recv(ctrl, buf, &len);
}
wpa_ctrl_close(ctrl);
return 0;
}