Skip to content
This repository was archived by the owner on Sep 23, 2024. It is now read-only.
This repository was archived by the owner on Sep 23, 2024. It is now read-only.

Add array-testing assertions #2

@matatk

Description

@matatk

We discussed and @MarkWithall suggested these offline; they ought to be noted here too :-)...

  • ASSERT_ARRAY_EQUAL(actual, expected, length, message)
  • ASSERT_ARRAY_LENGTH(array, expected_length, message)

I'm not able to 100% guarantee that I'd have the cycles or be able to do it correctly, but I might be able to have a go at this, so feel free to assign to me if you would like a PR.

Currently @tomfinnie and I are testing arrays and will be using a for loop, which I gather will work in the sense that we can have more than one ASSERT per TEST, but I gather that it would only break on the first ASSERT as-is. Specifically the thing we're trying to do is assert that one (and only one) element in the array has been set to NULL -- that's actually not quite covered by the above, I think (we don't know/care what the other values are), so this specific behaviour looks like it'll be extra to the above-listed assertions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions