1. 24 Jul, 2020 1 commit
  2. 21 Feb, 2020 1 commit
  3. 13 Feb, 2020 2 commits
    • Evan Hunt's avatar
      apply the modified style · e851ed0b
      Evan Hunt authored
    • Ondřej Surý's avatar
      Use clang-tidy to add curly braces around one-line statements · 056e133c
      Ondřej Surý authored
      The command used to reformat the files in this commit was:
      ./util/run-clang-tidy \
      	-clang-tidy-binary clang-tidy-11
      	-clang-apply-replacements-binary clang-apply-replacements-11 \
      	-checks=-*,readability-braces-around-statements \
      	-j 9 \
      	-fix \
      	-format \
      	-style=file \
      clang-format -i --style=format $(git ls-files '*.c' '*.h')
      uncrustify -c .uncrustify.cfg --replace --no-backup $(git ls-files '*.c' '*.h')
      clang-format -i --style=format $(git ls-files '*.c' '*.h')
  4. 12 Feb, 2020 1 commit
  5. 14 Jan, 2020 3 commits
  6. 30 Jul, 2019 1 commit
    • Michał Kępień's avatar
      Include <sched.h> where necessary for musl libc · 59528d0e
      Michał Kępień authored
      All unit tests define the UNIT_TESTING macro, which causes <cmocka.h> to
      replace malloc(), calloc(), realloc(), and free() with its own functions
      tracking memory allocations.  In order for this not to break
      compilation, the system header declaring the prototypes for these
      standard functions must be included before <cmocka.h>.
      Normally, these prototypes are only present in <stdlib.h>, so we make
      sure it is included before <cmocka.h>.  However, musl libc also defines
      the prototypes for calloc() and free() in <sched.h>, which is included
      by <pthread.h>, which is included e.g. by <isc/mutex.h>.  Thus, unit
      tests including "dnstest.h" (which includes <isc/mem.h>, which includes
      <isc/mutex.h>) after <cmocka.h> will not compile with musl libc as for
      these programs, <sched.h> will be included after <cmocka.h>.
      Always including <cmocka.h> after all other header files is not a
      feasible solution as that causes the mock assertion macros defined in
      <isc/util.h> to mangle the contents of <cmocka.h>, thus breaking
      compilation.  We cannot really use the __noreturn__ or analyzer_noreturn
      attributes with cmocka assertion functions because they do return if the
      tested condition is true.  The problem is that what BIND unit tests do
      is incompatible with Clang Static Analyzer's assumptions: since we use
      cmocka, our custom assertion handlers are present in a shared library
      (i.e. it is the cmocka library that checks the assertion condition, not
      a macro in unit test code).  Redefining cmocka's assertion macros in
      <isc/util.h> is an ugly hack to overcome that problem - unfortunately,
      this is the only way we can think of to make Clang Static Analyzer
      properly process unit test code.  Giving up on Clang Static Analyzer
      being able to properly process unit test code is not a satisfactory
      Undefining _GNU_SOURCE for unit test code could work around the problem
      (musl libc's <sched.h> only defines the prototypes for calloc() and
      free() when _GNU_SOURCE is defined), but doing that could introduce
      discrepancies for unit tests including entire *.c files, so it is also
      not a good solution.
      All in all, including <sched.h> before <cmocka.h> for all affected unit
      tests seems to be the most benign way of working around this musl libc
      quirk.  While quite an ugly solution, it achieves our goals here, which
      are to keep the benefit of proper static analysis of unit test code and
      to fix compilation against musl libc.
  7. 19 Jun, 2019 1 commit
    • Ondřej Surý's avatar
      Rename mctx in dnstest.c to dt_mctx to prevent any global/local name clashes · 52f98c57
      Ondřej Surý authored
      The common construct seen in the BIND 9 source is func(isc_mem_t *mctx, ...).
      Unfortunately, the dnstest.{h,c} has been using mctx as a global symbol, which
      in turn generated a lot of errors when update.c got included in update_test.c.
      As a rule of thumb, we should avoid naming global symbols with generic names
      (like mctx) and we should prefix them with "namespace" (like dt_mctx).
  8. 08 May, 2019 1 commit
  9. 11 Apr, 2019 5 commits
  10. 10 Apr, 2019 2 commits
  11. 09 Apr, 2019 2 commits
  12. 21 Mar, 2019 1 commit
  13. 08 Mar, 2019 1 commit
  14. 08 Feb, 2019 1 commit
  15. 07 Feb, 2019 3 commits
  16. 14 Dec, 2018 1 commit
  17. 15 Nov, 2018 1 commit
    • Evan Hunt's avatar
      convert rdata_test · bb5ed5a4
      Evan Hunt authored
      - also added code to dnstest.c to optionally suppress printing of errors
        from dns_rdata_fromtxt()
  18. 30 Oct, 2018 2 commits
  19. 25 Oct, 2018 2 commits
  20. 08 Aug, 2018 1 commit
  21. 04 Jun, 2018 1 commit
  22. 09 May, 2018 1 commit
  23. 06 Mar, 2018 1 commit
  24. 23 Feb, 2018 1 commit
  25. 23 Nov, 2017 1 commit
  26. 25 Oct, 2017 1 commit
  27. 09 Oct, 2017 1 commit