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

FakeIt doesn't support packed classes #185

Open
oriolarcas opened this issue Sep 27, 2019 · 1 comment
Open

FakeIt doesn't support packed classes #185

oriolarcas opened this issue Sep 27, 2019 · 1 comment

Comments

@oriolarcas
Copy link

Hi,

I am trying to mock a class that manages binary data, and is compiled with the packed attribute to avoid padding between data fields.

For instance:

struct Test {
    int a;
    char b;

    virtual int get_a() = 0;
    virtual char get_b() = 0;
} __attribute__((packed));

The compile will fail in this assert:

static_assert(sizeof(C) == sizeof(FakeObject<C, baseclasses...>), "This is a problem");

I didn't find any documentation or issues, any ideas on how to solve it?

@hedayat
Copy link
Contributor

hedayat commented Sep 28, 2019

Well, I guess this is not supported currently. It seems that special code for packed classes is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants