Skip to content
Snippets Groups Projects
  1. Jun 29, 2023
  2. Jun 20, 2023
  3. Jun 19, 2023
  4. Jun 03, 2023
    • Jonathan Schöbel's avatar
      configure: added automatic depency checking for check · db0618d9
      Jonathan Schöbel authored
      Until now, the configure script just checked for check to be installed,
      which is needed to compile the tests.
      Now, configure provides a conditional (MISSING_CHECK) depending on its
      presence for use by automake. If check is missing, the tests aren't
      compiled. Instead a special script is executed to inform the user of the
      problem and stops the testsuite. Note, that it was not possible to
      directly stop the generation of the testsuite by injecting a rule to a
      Makefile without relying on implementation details of automake.
      See:
      https://stackoverflow.com/questions/76376806/automake-how-to-portably-throw-an-error-and-aborting-the-target/76382437
      To allow the script to issue messages to stderr, AM_TESTS_FD_REDIRECT is
      used, because the parallel test harness redirects output of its tests to
      logfiles. This isn't used for the serial test harness, because there is
      no redirection to logfiles, but there AM_TESTS_FD_REDIRECT is also not
      taken into account.
      See:
      https://www.gnu.org/software/automake/manual/html_node/Testsuite-Environment-Overrides.html
      Additionaly configure also provides an argument to enforce both
      behaviours. When specifying --enable-tests=no the tests are not compiled
      regardless of the presence of check. If --enable-tests=yes, it is
      assumed, that tests are really needed and the mandantory check for check
      is performed thus providing the former behaviour. If not specified
      --enable-tests default to auto, which results in the same behaviour as
      --enable-tests=yes, if check is present, and like --enable-tests=no
      otherwise.
      db0618d9
  5. Nov 16, 2022
    • Jonathan Schöbel's avatar
      Validator: restructured internal data · a0c9bb25
      Jonathan Schöbel authored
      The Validator saves the tags as an array. Now also another information
      is added, which slots aren't used currently to spare expensive calls to
      realloc. This led to a mere reimplementation of the functions. Tags
      can't be deleted by now, but the adding function supports reusing empty
      slots. Also the reading functions have to determine, whether a slot can
      be read or is empty.
      The tests were adjusted, but are buggy, so they should be rewritten in
      the future.
      
      Additionaly some annotations for splint were added.
      a0c9bb25
  6. Oct 17, 2022
    • Jonathan Schöbel's avatar
      setup library (make & API) · f86bd5cf
      Jonathan Schöbel authored
      The make process was restructured to create a library. For this libtool
      is used to provide both static and dynamic linking. Also header
      inclusion guards were introduced, to prevent clients of the library to
      include some single file without including others. The types were
      exported with forward declarations for better abstraction. When
      compiling the library, the macro LIB_SEFHT_COMPILATION is defined and
      symbol declarations are exported fully. For compiling the tests this
      macro is also defined, as the tests not only tests the API, but also the
      internal state, because a lot of errors couldn't be detected otherwise.
      f86bd5cf
  7. Jun 21, 2022
    • Jonathan Schöbel's avatar
      look for duplicate tags in Validator · 47407f2d
      Jonathan Schöbel authored
      When a tag is made known to the Validator, which it already knows, the
      old id is returned and nothing is added.
      As this has to be checked by iterating over all known tags, a new helper
      function is written for both SH_Validator_check_tag and
      SH_Validator_register_tag: SH_Validator_get_tag.
      
      Because we want also to test this function, we have to include
      validator.c in the test file and override the static keyword by an empty
      macro. It isn't possible any more to check for correct overflowdetection
      by setting the index to UINT_MAX, because it will be iterated over all
      data, thus raising an SIGSEGV when doing so. This is solved by filling
      garbage unil UINT_MAX is really reached. As there would be an timeout
      and it would fill RAM with around 40 GB of garbage, UINT_MAX is
      overriden prior to inclusion of validator.c .
      47407f2d
    • Jonathan Schöbel's avatar
      added Validator · 7c9a245e
      Jonathan Schöbel authored
      Validator serves as an syntax checker, i. e. it can be requested whether
      a tag is allowed.
      7c9a245e
  8. Jun 20, 2022
    • Jonathan Schöbel's avatar
      added test for CMS · 46436e8a
      Jonathan Schöbel authored
      Tests are done using check, allowing to integrate the tests into the
      Autotools.
      Methods that are part of another unit, but are called in this unit
      aren't tested as this would interfere with the idea of unittests. This
      also applies for purely wrapper functions, where a call is passed to
      another unit.
      46436e8a
  9. Jun 21, 2022
    • Jonathan Schöbel's avatar
      error handling added · 6a592b8d
      Jonathan Schöbel authored
      Error handling is done by passing an Error structure as inout parameter
      to functions that can fail on runtime predictable. This parameter is
      always the last one. Methods, where this is not the case, doesn't have an
      error parameter.
      When an Error is detected, also an ERROR is passed to the log. Because
      this isn't implemented yet, it is replaced by a nop.
      The macro EXIT becomes now useless. It was used earlier in case of an
      error, to terminate the program in the first place. This behaviour is not
      userfriendly, but it can't be decided on the library's side, whether
      there is an option to inform the user, something must be cleaned up or
      even that recovering is possible at all.
      Often these recognized errors are a non-working malloc or an over-/underflow.
      
      Error handling can be ignored by the caller by passing NULL to the Error
      parameter. Whether an error had occured, is also always possible to be
      determined, by examining the return value. If the error occours in a
      function returning a pointer, NULL will be returned. If it returns an value,
      a special error value of that type is returned, i.e. PAGE_ERR in
      SH_Data_register_page. If the return type would be void, a boolean is returned,
      which tells, whether the method has succeeded.
      (False means, that an error has occured.)
      
      The error may have occured in an intern method and is passed upwards (the stack).
      Internally errors are handled by an enum, but this must be considered an
      implementation detail and can be changed in later versions.
      It is in the responsibility of the caller to recover gracefully. It has
      to be assumed that the requested operation have neither worked, nor
      actually took place. Those the operation can be retried (hopefully).
      6a592b8d
  10. Jun 20, 2022
Loading