[Android Q&A, Help & Troubleshooting] jonas2790:
Hi

I'm trying to compile cm12, but when it comes to libgui_test, there are several errors:

In file included from external/gtest/include/gtest/gtest.h:1929:0,
from frameworks/native/libs/gui/tests/Surface_test.cpp:17:
frameworks/native/libs/gui/tests/Surface_test.cpp: In member function 'virtual void android::SurfaceTest_ScreenshotsOfProtectedBuffersSucceed_Test::TestBody()':
frameworks/native/libs/gui/tests/Surface_test.cpp:99:41: error: no matching function for call to 'android::ISurfaceComposer::captureScreen(android::sp<android::IBinder>&, android::sp<android::IGraphicBufferProducer>&, android::Rect, int, int, int, int, bool)'
64, 64, 0, 0x7fffffff, false));
^
external/gtest/include/gtest/gtest_pred_impl.h:77:52: note: in definition of macro 'GTEST_ASSERT_'
if (const ::testing::AssertionResult gtest_ar = (expression)) \
^
external/gtest/include/gtest/gtest_pred_impl.h:166:3: note: in expansion of macro 'GTEST_PRED_FORMAT2_'
GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
^
external/gtest/include/gtest/gtest.h:1993:3: note: in expansion of macro 'ASSERT_PRED_FORMAT2'
ASSERT_PRED_FORMAT2(::testing::internal:: \
^
external/gtest/include/gtest/gtest.h:2011:32: note: in expansion of macro 'GTEST_ASSERT_EQ'
# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
^
frameworks/native/libs/gui/tests/Surface_test.cpp:98:5: note: in expansion of macro 'ASSERT_EQ'
ASSERT_EQ(NO_ERROR, sf->captureScreen(display, producer, Rect(),
^
frameworks/native/libs/gui/tests/Surface_test.cpp:99:41: note: candidate is:
64, 64, 0, 0x7fffffff, false));
^
external/gtest/include/gtest/gtest_pred_impl.h:77:52: note: in definition of macro 'GTEST_ASSERT_'
if (const ::testing::AssertionResult gtest_ar = (expression)) \
^
external/gtest/include/gtest/gtest_pred_impl.h:166:3: note: in expansion of macro 'GTEST_PRED_FORMAT2_'
GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
^
external/gtest/include/gtest/gtest.h:1993:3: note: in expansion of macro 'ASSERT_PRED_FORMAT2'
ASSERT_PRED_FORMAT2(::testing::internal:: \
^
external/gtest/include/gtest/gtest.h:2011:32: note: in expansion of macro 'GTEST_ASSERT_EQ'
# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
^
frameworks/native/libs/gui/tests/Surface_test.cpp:98:5: note: in expansion of macro 'ASSERT_EQ'
ASSERT_EQ(NO_ERROR, sf->captureScreen(display, producer, Rect(),
^
In file included from frameworks/native/libs/gui/tests/Surface_test.cpp:20:0:
frameworks/native/include/gui/ISurfaceComposer.h:143:22: note: virtual android::status_t android::ISurfaceComposer::captureScreen(const android::sp<android::IBinder>&, const android::sp<android::IGraphicBufferProducer>&, android::Rect, uint32_t, uint32_t, uint32_t, uint32_t, bool, android::ISurfaceComposer::Rotation, bool)
virtual status_t captureScreen(const sp<IBinder>& display,
^
frameworks/native/include/gui/ISurfaceComposer.h:143:22: note: candidate expects 10 arguments, 8 provided
In file included from external/gtest/include/gtest/gtest.h:1929:0,
from frameworks/native/libs/gui/tests/Surface_test.cpp:17:
frameworks/native/libs/gui/tests/Surface_test.cpp:128:41: error: no matching function for call to 'android::ISurfaceComposer::captureScreen(android::sp<android::IBinder>&, android::sp<android::IGraphicBufferProducer>&, android::Rect, int, int, int, int, bool)'
64, 64, 0, 0x7fffffff, false));
^
external/gtest/include/gtest/gtest_pred_impl.h:77:52: note: in definition of macro 'GTEST_ASSERT_'
if (const ::testing::AssertionResult gtest_ar = (expression)) \
^
external/gtest/include/gtest/gtest_pred_impl.h:166:3: note: in expansion of macro 'GTEST_PRED_FORMAT2_'
GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
^
external/gtest/include/gtest/gtest.h:1993:3: note: in expansion of macro 'ASSERT_PRED_FORMAT2'
ASSERT_PRED_FORMAT2(::testing::internal:: \
^
external/gtest/include/gtest/gtest.h:2011:32: note: in expansion of macro 'GTEST_ASSERT_EQ'
# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
^
frameworks/native/libs/gui/tests/Surface_test.cpp:127:5: note: in expansion of macro 'ASSERT_EQ'
ASSERT_EQ(NO_ERROR, sf->captureScreen(display, producer, Rect(),
^
frameworks/native/libs/gui/tests/Surface_test.cpp:128:41: note: candidate is:
64, 64, 0, 0x7fffffff, false));
^
external/gtest/include/gtest/gtest_pred_impl.h:77:52: note: in definition of macro 'GTEST_ASSERT_'
if (const ::testing::AssertionResult gtest_ar = (expression)) \
^
external/gtest/include/gtest/gtest_pred_impl.h:166:3: note: in expansion of macro 'GTEST_PRED_FORMAT2_'
GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
^
external/gtest/include/gtest/gtest.h:1993:3: note: in expansion of macro 'ASSERT_PRED_FORMAT2'
ASSERT_PRED_FORMAT2(::testing::internal:: \
^
external/gtest/include/gtest/gtest.h:2011:32: note: in expansion of macro 'GTEST_ASSERT_EQ'
# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
^
frameworks/native/libs/gui/tests/Surface_test.cpp:127:5: note: in expansion of macro 'ASSERT_EQ'
ASSERT_EQ(NO_ERROR, sf->captureScreen(display, producer, Rect(),

The problem seems to be in the gtest library, does anyone know how to fix this or had similar errors.

The only useful things I found about this, but I don't really know how to apply the workaround there:

https://github.com/google/libkml/issues/2

http://stackoverflow.com/questions/...bug-assert-eq-and-assert-true-compile-failure