• David Gow's avatar
    kunit: Do not typecheck binary assertions · 6e62dfa6
    David Gow authored
    The use of typecheck() in KUNIT_EXPECT_EQ() and friends is causing more
    problems than I think it's worth. Things like enums need to have their
    values explicitly cast, and literals all need to be very precisely
    typed, else a large warning will be printed.
    
    While typechecking does have its uses, the additional overhead of having
    lots of needless casts -- combined with the awkward error messages which
    don't mention which types are involved -- makes tests less readable and
    more difficult to write.
    
    By removing the typecheck() call, the two arguments still need to be of
    compatible types, but don't need to be of exactly the same time, which
    seems a less confusing and more useful compromise.
    Signed-off-by: default avatarDavid Gow <davidgow@google.com>
    Reviewed-by: default avatarDaniel Latypov <dlatypov@google.com>
    Reviewed-by: default avatarBrendan Higgins <brendanhiggins@google.com>
    Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
    6e62dfa6
test.h 60.6 KB