Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mutator unittests #31

Merged
merged 3 commits into from Feb 7, 2020
Merged
Commits on Jan 19, 2020
  1. Add unit tests to check the behaviour of mutators matches expectations.

    gerph committed Jan 11, 2020
    The mutators weren't being tested so we only had to assume that they
    were doing the right thing. In my own tests I saw a lot of input that
    had NUL bytes in it, so I'm pretty sure that some of the mutations were
    not doing the right thing. With these tests, the copy method was found
    to have poorly named parameters.
    
    The pattern it's using is copy(a, b, posa, posb, lena, lenb) (where lena
    and lenb can be omitted). The 'a' parameter is where the update will
    take place, and the 'b' parameter is where the copy originates. However,
    the first parameter was called 'src' and the second parameter 'dst',
    which is the precise opposite of the expectation. The naming of the
    parameters was kept consistent (a named as src, despite being the
    destination) with the other named parameters and within the function.
    
    This has been corrected, and with the correct naming, it became obvious
    that the insert, remove and duplicate functions were not working as
    intended.
    
    It is unclear what the difference is intended to be for Duplicate and
    Copy bytes - I have 'fixed' Duplicate, but this means that it now works
    identically to Copy, so it's not clear to me what's meant to be done
    there.
  2. Update the Makefile to run unit tests.

    gerph committed Jan 11, 2020
    Now that we have unit tests, these can be invoked by the Makefile.
  3. Add annotations to each of the test systems to describe themselves.

    gerph committed Jan 11, 2020
    The test files have now been updated to include annotations, in the
    file prologue comment, which describe the test and its place in the
    testing environment.
    
    These are just a convention that I've used previously, but they help
    to focus anyone doing testing on describing where they fit into the
    testing of the system. Such descriptions make it obvious when reviewed
    where there are gaps in testing.
You can’t perform that action at this time.