Fix develop build failures

The macro in testrules.cc needed to be chagned to use string literals to
work correctly with uncrustify. Also change <cmath> to <math.h> in C
headers.
This commit is contained in:
Markus Mäkelä 2018-09-10 11:34:09 +03:00
parent d16fbd4cdf
commit 03017c6aad
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
2 changed files with 11 additions and 11 deletions

View File

@ -20,7 +20,7 @@
#include <maxscale/cdefs.h>
#include <cmath>
#include <math.h>
#include <time.h>
#include <openssl/crypto.h>
#include <openssl/ssl.h>

View File

@ -62,21 +62,21 @@ struct user_test_case
};
#define USER_TEST_CASE(op_from, from, op_to, to) \
{"{ \"use\": [ { \"attribute\": \"user\", \"op\": \"" #op_from "\", \"value\": \"" #from "\" } ] }", \
{op_to, #to}}
{"{ \"use\": [ { \"attribute\": \"user\", \"op\": \"" op_from "\", \"value\": \"" from "\" } ] }", \
{op_to, to}}
#define COLUMN_
const struct user_test_case user_test_cases[] =
{
USER_TEST_CASE( =, bob, CACHE_OP_LIKE, bob@.*),
USER_TEST_CASE( =, 'bob', CACHE_OP_LIKE, bob@.*),
USER_TEST_CASE( =, bob@ %, CACHE_OP_LIKE, bob@.*),
USER_TEST_CASE( =, 'bob' @'%.52', CACHE_OP_LIKE, bob@.*\ \ .52),
USER_TEST_CASE( =, bob@127 .0 .0 .1, CACHE_OP_EQ, bob@127 .0 .0 .1),
USER_TEST_CASE( =, b * b@127 .0 .0 .1, CACHE_OP_EQ, b * b@127 .0 .0 .1),
USER_TEST_CASE( =, b * b@ % .0 .0 .1, CACHE_OP_LIKE, b \ \ * b@.*\ \ .0 \ \ .0 \ \ .1),
USER_TEST_CASE( =, b * b@ % .0.% .1, CACHE_OP_LIKE, b \ \ * b@.*\ \ .0 \ \..*\ \ .1),
USER_TEST_CASE("=", "bob", CACHE_OP_LIKE, "bob@.*"),
USER_TEST_CASE("=", "'bob'", CACHE_OP_LIKE, "bob@.*"),
USER_TEST_CASE("=", "bob@%", CACHE_OP_LIKE, "bob@.*"),
USER_TEST_CASE("=", "'bob'@'%.52'", CACHE_OP_LIKE, "bob@.*\\.52"),
USER_TEST_CASE("=", "bob@127.0.0.1", CACHE_OP_EQ, "bob@127.0.0.1"),
USER_TEST_CASE("=", "b*b@127.0.0.1", CACHE_OP_EQ, "b*b@127.0.0.1"),
USER_TEST_CASE("=", "b*b@%.0.0.1", CACHE_OP_LIKE, "b\\*b@.*\\.0\\.0\\.1"),
USER_TEST_CASE("=", "b*b@%.0.%.1", CACHE_OP_LIKE, "b\\*b@.*\\.0\\..*\\.1"),
};
const size_t n_user_test_cases = sizeof(user_test_cases) / sizeof(user_test_cases[0]);