google / cmockery

A lightweight library to simplify and generalize the process of writing unit tests for C applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mock generated code runs failed on ARM

bzhaoopenstack opened this issue · comments

commented

When I test a software whose code is based on cmockery. The software is greenplum database.
The genarated file is
~/src/gpdb$ vi src/test/unit/mock/backend/libpq/pqexpbuffer_mock.c

bool
appendPQExpBufferVA(PQExpBuffer str, const char * fmt, va_list args)
{
check_expected(str);
check_expected(fmt);
check_expected(args);
optional_assignment(fmt);
return (bool) mock();
}

I exec 'make -s unittest-check' amd get error.
../../../../../src/test/unit/mock/backend/libpq/pqexpbuffer_mock.c: In function 'appendPQExpBufferVA':
../../../../../src/test/unit/mock/backend/libpq/pqexpbuffer_mock.c:110:2: error: aggregate value used where an integer was expected
check_expected(args);
^~~~~~~~~~~~~~
: recipe for target '../../../../../src/test/unit/mock/backend/libpq/pqexpbuffer_mock.o' failed
make[4]: *** [../../../../../src/test/unit/mock/backend/libpq/pqexpbuffer_mock.o] Error 1
../../../../src/backend/common.mk:52: recipe for target 'unittest-check-local' failed
make[3]: *** [unittest-check-local] Error 2
../../../src/backend/common.mk:49: recipe for target 'unittest-check-dispatcher-recurse' failed
make[2]: *** [unittest-check-dispatcher-recurse] Error 2
common.mk:49: recipe for target 'unittest-check-cdb-recurse' failed
make[1]: *** [unittest-check-cdb-recurse] Error 2
GNUmakefile:173: recipe for target 'unittest-check' failed
make: *** [unittest-check] Error 2

I run this test on both X86 and ARM machines. So I guess it might be different on these different ARCH.

Any idea to fix it? Thanks

commented

Any people maintain this repo?

@mbrukman and I have been part time maintaining, happy to review a pull request.

commented

Thanks sir, @stewartmiles . @mbrukman
To be honest, I'm not sure I can fix it. Could you please give some suggests? Thanks very much