test_storage: extend test harness; datastorage: two bug fixes

datastorage (bug fix): deleting expired array item would fail to test next item
test_storage: extended to cover all required datastorage entry points
test_storage: added ability to read script file
test_storage: added new and revised test scripts
TESTING.md: added to describe testing approach
general: added various TODO notes on things to come back to
general: revised #includes to make each "self-compiling"
general: revised #includes to minimise usage across source files
general: moved declarations and defintions to simplify and rationalise code
datastorage: refactor to support scalability testing
datastorage: made independent of time() calls to support testing
datastorage: fixed redundant use of both SORT_NUM and SORT_LENGTH defines
datastorage: fake kicking to test clients move between access points
msghandler: new module to reduce compile time interdependencies
mshhandler: (issue #100?) fixed SEGV memcpy() in dump_client() using strncpy()
ubus: merged uface into ubus
mac_utils: new module for MAC address utilites
test_header: added target to help #include rationalisation

Tested-by: Nick Hainke <vincent@systemli.org>
This commit is contained in:
Ian Clowes 2020-05-27 19:25:04 +01:00 committed by Polynomialdivision
parent 0f63e00c43
commit 67c3ed0d0a
46 changed files with 2947 additions and 1476 deletions

View file

@ -2,43 +2,13 @@
#define __DAWN_UTILS_H
#include <stdint.h>
#include <ctype.h>
#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
#define STR2MAC(a) &(a)[0], &(a)[1], &(a)[2], &(a)[3], &(a)[4], &(a)[5]
#define MACSTR "%02X:%02X:%02X:%02X:%02X:%02X"
#define MACSTRLOWER "%02x:%02x:%02x:%02x:%02x:%02x"
/**
* Convert char to binary.
* @param ch
* @return
*/
int hex_to_bin(char ch);
/**
* Convert mac adress string to mac adress.
* @param txt
* @param addr
* @return
*/
int hwaddr_aton(const char *txt, uint8_t *addr);
/**
* Convert mac to use big characters.
* @param in
* @param out
* @return
*/
int convert_mac(char *in, char *out);
/**
* Write mac to a file.
* @param path
* @param addr
*/
void write_mac_to_file(char *path, uint8_t addr[]);
int hex_to_dec(char ch);
/**
* Check if a string is greater than another one.
@ -48,6 +18,4 @@ void write_mac_to_file(char *path, uint8_t addr[]);
*/
int string_is_greater(uint8_t *str, uint8_t *str_2);
int rcpi_to_rssi(int rcpi);
#endif