Skip to content

CTEST_ASSERT_ARE_EQUAL doesn't work with array type #18

@mattdurak

Description

@mattdurak

Example:

typedef unsigned char my_type[32];

// … test code
ASSERT_ARE_EQUAL(my_type, a, b);

Fails to compile in CTEST_ASSERT_ARE_EQUAL because the code tries to cast/assign an array type:

#define CTEST_ASSERT_ARE_EQUAL(type, A, B, ...) \
do { \
    const type A_value = (const type)(A); \
    const type B_value = (const type)(B); \

error C2067: cast to array type is illegal

Instead, this does work:

typedef unsigned char my_type[32];
typedef my_type* my_type_ptr;

// … test code
ASSERT_ARE_EQUAL(my_type_ptr, &a, &b);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions