Merge branch 'each-style-tweak' into 'master'

adjust clang-format options to get closer to ISC style

See merge request isc-projects/bind9!3061

(cherry picked from commit d3b49b6675)

0255a974 revise .clang-format and add a C formatting script in util
e851ed0b apply the modified style
This commit is contained in:
Ondřej Surý
2020-02-14 05:35:17 +00:00
parent c646c20e79
commit cdef20bb66
672 changed files with 36044 additions and 42228 deletions

View File

@@ -36,17 +36,16 @@ static bool verbose = false;
/* test isc_regex_validate() */
static void
regex_validate(void **state)
{
regex_validate(void **state) {
/*
* test regex were generated using http://code.google.com/p/regfuzz/
* modified to use only printable characters
*/
struct {
const char *expression;
int expect;
int exception; /* regcomp accepts but is
* disallowed. */
int expect;
int exception; /* regcomp accepts but is
* disallowed. */
} tests[] = {
{ "", -1, 0 },
{ "*", -1, 0 },
@@ -2285,7 +2284,7 @@ regex_validate(void **state)
{ "}}}}}}}}}(}}){}[llll]^N|", -1, 0 },
};
unsigned int i;
int r;
int r;
UNUSED(state);
@@ -2300,7 +2299,8 @@ regex_validate(void **state)
r = regcomp(&preg, tests[i].expression, REG_EXTENDED);
if (((r != 0 && tests[i].expect != -1) ||
(r == 0 && tests[i].expect == -1)) &&
!tests[i].exception) {
!tests[i].exception)
{
if (verbose) {
print_error("regcomp(%s) -> %s expected %s\n",
tests[i].expression,
@@ -2310,7 +2310,8 @@ regex_validate(void **state)
}
} else if (r == 0 &&
preg.re_nsub != (unsigned int)tests[i].expect &&
!tests[i].exception) {
!tests[i].exception)
{
if (verbose) {
print_error("%s preg.re_nsub %lu expected %d\n",
tests[i].expression,
@@ -2339,8 +2340,7 @@ regex_validate(void **state)
}
int
main(int argc, char **argv)
{
main(int argc, char **argv) {
const struct CMUnitTest tests[] = {
cmocka_unit_test(regex_validate),
};
@@ -2364,8 +2364,7 @@ main(int argc, char **argv)
#include <stdio.h>
int
main(void)
{
main(void) {
printf("1..0 # Skipped: cmocka not available\n");
return (0);
}