Merge lp:~muktupavels/compiz/gtest into lp:compiz/0.9.13
- gtest
- Merge into 0.9.13
Proposed by
Alberts Muktupāvels
Status: | Merged |
---|---|
Approved by: | Marco Trevisan (Treviño) |
Approved revision: | 4177 |
Merged at revision: | 4171 |
Proposed branch: | lp:~muktupavels/compiz/gtest |
Merge into: | lp:compiz/0.9.13 |
Prerequisite: | lp:~muktupavels/compiz/gcc-8.1 |
Diff against target: |
1186 lines (+189/-176) 26 files modified
cmake/CompizCommon.cmake (+7/-1) cmake/GoogleTest.cmake (+51/-54) compizconfig/gsettings/tests/test_gsettings_tests.cpp (+7/-7) compizconfig/gsettings/tests/test_gsettings_wrapper.cpp (+1/-1) compizconfig/integration/gnome/gsettings/tests/compizconfig_test_ccs_gnome_gsettings_integrated_setting.cpp (+5/-6) compizconfig/integration/mate/gsettings/tests/compizconfig_test_ccs_mate_gsettings_integrated_setting.cpp (+5/-6) compizconfig/libcompizconfig/tests/compizconfig_test_ccs_object.cpp (+17/-17) compizconfig/libcompizconfig/tests/compizconfig_test_ccs_setting.cpp (+3/-5) compizconfig/tests/compizconfig_backend_concept_test.h (+4/-5) debian/control (+1/-0) plugins/composite/src/pixmapbinding/tests/test-composite-pixmapbinding.cpp (+11/-11) plugins/decor/tests/acceptance/xorg-gtest/compiz_decor_acceptance_tests.cpp (+12/-11) plugins/expo/src/wall_offset/tests/test-expo-wall-offset.cpp (+3/-4) plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp (+14/-13) plugins/place/src/screen-size-change/tests/screen-size-change/src/test-place-screen-size-change.cpp (+1/-1) src/option/tests/option.cpp (+2/-2) src/privatescreen/tests/test-privatescreen.cpp (+10/-4) src/region/tests/test-region.cpp (+2/-2) src/timer/tests/set-values/src/test-timer-set-values.cpp (+4/-4) src/window/geometry-saver/tests/window-geometry-saver/src/test-window-geometry-saver.cpp (+14/-7) src/window/geometry/tests/window-geometry/src/test-window-geometry.cpp (+4/-3) tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp (+1/-1) tests/system/xorg-gtest/tests/compiz_xorg_gtest_icccm.cpp (+1/-1) tests/system/xorg-gtest/tests/compiz_xorg_gtest_test_window_stacking.cpp (+8/-8) tests/xorg-gtest/plugins/testhelper/src/testhelper.cpp (+1/-1) tests/xorg-gtest/src/compiz_xorg_gtest_main.cpp (+0/-1) |
To merge this branch: | bzr merge lp:~muktupavels/compiz/gtest |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marco Trevisan (Treviño) | Approve | ||
Dmitry Shachnev | Pending | ||
Review via email: mp+349803@code.launchpad.net |
Commit message
Make tests build again with Google Test 1.8.0 and GCC 8.1.
Description of the change
Make tests build again with Google Test 1.8.0 and GCC 8.1.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'cmake/CompizCommon.cmake' |
2 | --- cmake/CompizCommon.cmake 2018-06-27 16:45:28 +0000 |
3 | +++ cmake/CompizCommon.cmake 2018-07-23 10:45:35 +0000 |
4 | @@ -52,12 +52,18 @@ |
5 | |
6 | # Almost everything is a shared library now, so almost everything needs -fPIC |
7 | set (COMMON_FLAGS "-fPIC -Wall") |
8 | +set (COMMON_CXX_FLAGS "-std=c++11") |
9 | |
10 | option (COMPIZ_UNUSED_PRIVATE_FIELD_WARNINGS "Warn unused private fields" OFF) |
11 | if (NOT COMPIZ_UNUSED_PRIVATE_FIELD_WARNINGS) |
12 | set (COMMON_FLAGS "${COMMON_FLAGS} -Wno-unused-private-field") |
13 | endif () |
14 | |
15 | +option (COMPIZ_SUBOBJECT_LINKAGE_WARNINGS "Warn about subobject linkage" OFF) |
16 | +if (NOT COMPIZ_SUBOBJECT_LINKAGE_WARNINGS) |
17 | + set (COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -Wno-subobject-linkage") |
18 | +endif () |
19 | + |
20 | option (COMPIZ_UNUSED_LOCAL_TYPEDEFS_WARNINGS "Warn about unused local typedefs" OFF) |
21 | if (NOT COMPIZ_UNUSED_LOCAL_TYPEDEFS_WARNINGS) |
22 | set (COMMON_FLAGS "${COMMON_FLAGS} -Wno-unused-local-typedefs") |
23 | @@ -84,7 +90,7 @@ |
24 | endif () |
25 | |
26 | set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAGS}") |
27 | -set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} -std=c++11") |
28 | +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} ${COMMON_CXX_FLAGS}") |
29 | |
30 | set (COMMON_LINKER_FLAGS "-Wl,-zdefs") |
31 | set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${COMMON_LINKER_FLAGS}") |
32 | |
33 | === modified file 'cmake/GoogleTest.cmake' |
34 | --- cmake/GoogleTest.cmake 2013-07-17 07:50:48 +0000 |
35 | +++ cmake/GoogleTest.cmake 2018-07-23 10:45:35 +0000 |
36 | @@ -1,58 +1,55 @@ |
37 | -find_package (Threads REQUIRED) |
38 | - |
39 | -# Find the the Google Mock include directory |
40 | -# by searching the system-wide include directory |
41 | -# paths |
42 | -find_path (GMOCK_INCLUDE_DIR |
43 | - gmock/gmock.h) |
44 | - |
45 | -if (GMOCK_INCLUDE_DIR) |
46 | - set (GMOCK_INCLUDE_BASE "include/") |
47 | - string (LENGTH ${GMOCK_INCLUDE_BASE} GMOCK_INCLUDE_BASE_LENGTH) |
48 | - string (LENGTH ${GMOCK_INCLUDE_DIR} GMOCK_INCLUDE_DIR_LENGTH) |
49 | - |
50 | - math (EXPR |
51 | - GMOCK_INCLUDE_PREFIX_LENGTH |
52 | - "${GMOCK_INCLUDE_DIR_LENGTH} - ${GMOCK_INCLUDE_BASE_LENGTH}") |
53 | - string (SUBSTRING |
54 | - ${GMOCK_INCLUDE_DIR} |
55 | - 0 |
56 | - ${GMOCK_INCLUDE_PREFIX_LENGTH} |
57 | - GMOCK_INCLUDE_PREFIX) |
58 | - |
59 | - set (GMOCK_SRC_DIR ${GMOCK_INCLUDE_PREFIX}/src/gmock CACHE PATH "Path to Google Mock Sources") |
60 | - set (GMOCK_INCLUDE_DIR ${GMOCK_INCLUDE_DIR} CACHE PATH "Path to Google Mock Headers") |
61 | - set (GTEST_INCLUDE_DIR ${GMOCK_SRC_DIR}/gtest/include CACHE PATH "Path to Google Test Headers") |
62 | - |
63 | - set (GMOCK_LIBRARY "gmock" CACHE STRING "Name of the Google Mock library") |
64 | - set (GMOCK_MAIN_LIBRARY "gmock_main" CACHE STIRNG "Name of the Google Mock main () library") |
65 | - set (GTEST_BOTH_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} gtest gtest_main) |
66 | - |
67 | -endif (GMOCK_INCLUDE_DIR) |
68 | - |
69 | -if (NOT GTEST_BOTH_LIBRARIES) |
70 | +set (GOOGLETEST_DIR "/usr/src/googletest" CACHE PATH "Path to Google Test") |
71 | + |
72 | +if (EXISTS "${GOOGLETEST_DIR}") |
73 | + |
74 | + find_package (Threads REQUIRED) |
75 | + |
76 | + set (GMOCK_SRC_DIR "${GOOGLETEST_DIR}/googlemock" CACHE PATH "Path to Google Mock Sources") |
77 | + set (GMOCK_INCLUDE_DIR "${GMOCK_SRC_DIR}/include" CACHE PATH "Path to Google Mock Headers") |
78 | + set (GTEST_INCLUDE_DIR "${GOOGLETEST_DIR}/googletest/include" CACHE PATH "Path to Google Test Headers") |
79 | + set (GMOCK_BIN_DIR "${CMAKE_BINARY_DIR}/gmock") |
80 | + |
81 | + include (ExternalProject) |
82 | + ExternalProject_Add (GMock |
83 | + SOURCE_DIR "${GMOCK_SRC_DIR}" |
84 | + BINARY_DIR "${GMOCK_BIN_DIR}" |
85 | + STAMP_DIR "${GMOCK_BIN_DIR}/stamp" |
86 | + TMP_DIR "${GMOCK_BIN_DIR}/tmp" |
87 | + INSTALL_COMMAND "") |
88 | + |
89 | + add_library (gtest INTERFACE) |
90 | + target_include_directories (gtest INTERFACE ${GTEST_INCLUDE_DIR}) |
91 | + target_link_libraries (gtest INTERFACE "${GMOCK_BIN_DIR}/gtest/libgtest.a" ${CMAKE_THREAD_LIBS_INIT}) |
92 | + add_dependencies (gtest GMock) |
93 | + |
94 | + add_library (gtest_main INTERFACE) |
95 | + target_include_directories (gtest_main INTERFACE ${GTEST_INCLUDE_DIR}) |
96 | + target_link_libraries (gtest_main INTERFACE "${GMOCK_BIN_DIR}/gtest/libgtest_main.a" gtest) |
97 | + |
98 | + add_library (gmock INTERFACE) |
99 | + target_include_directories (gmock INTERFACE ${GMOCK_INCLUDE_DIR}) |
100 | + target_link_libraries (gmock INTERFACE "${GMOCK_BIN_DIR}/libgmock.a" gtest) |
101 | + |
102 | + add_library (gmock_main INTERFACE) |
103 | + target_include_directories (gmock_main INTERFACE ${GMOCK_INCLUDE_DIR}) |
104 | + target_link_libraries (gmock_main INTERFACE "${GMOCK_BIN_DIR}/libgmock_main.a" gmock) |
105 | + |
106 | + set (GMOCK_LIBRARY gmock) |
107 | + set (GMOCK_MAIN_LIBRARY gmock_main) |
108 | + set (GTEST_BOTH_LIBRARIES gtest gtest_main) |
109 | + |
110 | + add_definitions (-DGTEST_USE_OWN_TR1_TUPLE=0) |
111 | + include_directories (${GMOCK_INCLUDE_DIR} |
112 | + ${GTEST_INCLUDE_DIR}) |
113 | + |
114 | + set (GTEST_FOUND TRUE) |
115 | + set (GOOGLE_TEST_AND_MOCK_FOUND TRUE) |
116 | + |
117 | +else () |
118 | + |
119 | + message ("Google Test not found - cannot build tests!") |
120 | |
121 | set (GTEST_FOUND FALSE) |
122 | - |
123 | -else (NOT GTEST_BOTH_LIBRARIES) |
124 | - |
125 | - set (GTEST_FOUND TRUE) |
126 | - |
127 | -endif (NOT GTEST_BOTH_LIBRARIES) |
128 | - |
129 | -if (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
130 | - |
131 | - message ("Google Mock and Google Test not found - cannot build tests!") |
132 | set (GOOGLE_TEST_AND_MOCK_FOUND FALSE) |
133 | |
134 | -else (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
135 | - |
136 | - set (GOOGLE_TEST_AND_MOCK_FOUND TRUE) |
137 | - |
138 | - add_definitions(-DGTEST_USE_OWN_TR1_TUPLE=0) |
139 | - add_subdirectory (${GMOCK_SRC_DIR} ${CMAKE_BINARY_DIR}/__gmock) |
140 | - include_directories (${GMOCK_INCLUDE_DIR} |
141 | - ${GTEST_INCLUDE_DIR}) |
142 | - |
143 | - |
144 | -endif (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
145 | +endif () |
146 | |
147 | === modified file 'compizconfig/gsettings/tests/test_gsettings_tests.cpp' |
148 | --- compizconfig/gsettings/tests/test_gsettings_tests.cpp 2016-07-26 14:10:06 +0000 |
149 | +++ compizconfig/gsettings/tests/test_gsettings_tests.cpp 2018-07-23 10:45:35 +0000 |
150 | @@ -262,7 +262,7 @@ |
151 | |
152 | size_t pos = schemaNameStr.find (PLUGIN_SCHEMA_ID_PREFIX, 0); |
153 | |
154 | - EXPECT_EQ (pos, 0); |
155 | + EXPECT_EQ (pos, 0u); |
156 | |
157 | g_free (schemaName); |
158 | } |
159 | @@ -430,7 +430,7 @@ |
160 | |
161 | ASSERT_TRUE (decomposeGSettingsPath (compiz_gsettings_path.c_str (), &pluginName, &screenNum)); |
162 | EXPECT_EQ (std::string (pluginName), "PLUGINNAME"); |
163 | - EXPECT_EQ (screenNum, 0); |
164 | + EXPECT_EQ (screenNum, 0u); |
165 | |
166 | g_free (pluginName); |
167 | } |
168 | @@ -448,7 +448,7 @@ |
169 | |
170 | EXPECT_FALSE (decomposeGSettingsPath (compiz_gsettings_path.c_str (), &pluginNameC, &screenNum)); |
171 | EXPECT_EQ (std::string (pluginNameC), "aaa"); |
172 | - EXPECT_EQ (screenNum, 1); |
173 | + EXPECT_EQ (screenNum, 1u); |
174 | } |
175 | |
176 | TEST_F(CCSGSettingsTestIndependent, TestMakeCompizProfilePath) |
177 | @@ -698,7 +698,7 @@ |
178 | &newWrittenPlugins, |
179 | &newWrittenPluginsSize)); |
180 | |
181 | - EXPECT_EQ (newWrittenPluginsSize, 3); |
182 | + EXPECT_EQ (newWrittenPluginsSize, 3u); |
183 | EXPECT_EQ (std::string (newWrittenPlugins[0]), std::string ("foo")); |
184 | EXPECT_EQ (std::string (newWrittenPlugins[1]), std::string ("bar")); |
185 | EXPECT_EQ (std::string (newWrittenPlugins[2]), std::string ("plugin")); |
186 | @@ -711,7 +711,7 @@ |
187 | &newWrittenPlugins, |
188 | &newWrittenPluginsSize)); |
189 | |
190 | - EXPECT_EQ (newWrittenPluginsSize, 2); |
191 | + EXPECT_EQ (newWrittenPluginsSize, 2u); |
192 | EXPECT_EQ (std::string (newWrittenPlugins[0]), std::string ("foo")); |
193 | EXPECT_EQ (std::string (newWrittenPlugins[1]), std::string ("bar")); |
194 | } |
195 | @@ -849,7 +849,7 @@ |
196 | |
197 | /* Needs to be expressed in terms of a boolean expression */ |
198 | ASSERT_THAT (filteredList, NotNull ()); |
199 | - EXPECT_EQ (ccsSettingListLength (filteredList), 1); |
200 | + EXPECT_EQ (ccsSettingListLength (filteredList), 1u); |
201 | EXPECT_EQ (filteredList->data, s1); |
202 | EXPECT_NE (filteredList->data, s2); |
203 | EXPECT_EQ (NULL, filteredList->next); |
204 | @@ -878,7 +878,7 @@ |
205 | settingList); |
206 | |
207 | ASSERT_THAT (filteredList, NotNull ()); |
208 | - ASSERT_EQ (ccsSettingListLength (filteredList), 2); |
209 | + ASSERT_EQ (ccsSettingListLength (filteredList), 2u); |
210 | EXPECT_EQ (filteredList->data, s1); |
211 | EXPECT_NE (filteredList->data, s3); |
212 | ASSERT_THAT (filteredList->next, NotNull ()); |
213 | |
214 | === modified file 'compizconfig/gsettings/tests/test_gsettings_wrapper.cpp' |
215 | --- compizconfig/gsettings/tests/test_gsettings_wrapper.cpp 2014-01-15 20:49:33 +0000 |
216 | +++ compizconfig/gsettings/tests/test_gsettings_wrapper.cpp 2018-07-23 10:45:35 +0000 |
217 | @@ -139,7 +139,7 @@ |
218 | |
219 | TEST_F (CCSGSettingsWrapperWithMemoryBackendEnvGoodAllocatorAutoInitTest, TestSetValueOnWrapper) |
220 | { |
221 | - const unsigned int VALUE = 2; |
222 | + const int VALUE = 2; |
223 | const std::string KEY ("integer-setting"); |
224 | boost::shared_ptr <GVariant> variant (g_variant_new ("i", VALUE, NULL), |
225 | boost::bind (g_variant_unref, _1)); |
226 | |
227 | === modified file 'compizconfig/integration/gnome/gsettings/tests/compizconfig_test_ccs_gnome_gsettings_integrated_setting.cpp' |
228 | --- compizconfig/integration/gnome/gsettings/tests/compizconfig_test_ccs_gnome_gsettings_integrated_setting.cpp 2012-09-25 05:13:24 +0000 |
229 | +++ compizconfig/integration/gnome/gsettings/tests/compizconfig_test_ccs_gnome_gsettings_integrated_setting.cpp 2018-07-23 10:45:35 +0000 |
230 | @@ -25,7 +25,6 @@ |
231 | |
232 | #include <map> |
233 | #include <memory> |
234 | -#include <tr1/tuple> |
235 | #include <boost/shared_ptr.hpp> |
236 | |
237 | #include <glib_gslice_off_env.h> |
238 | @@ -158,7 +157,7 @@ |
239 | namespace ccvalg = compiz::config::integration::test::value_generators; |
240 | namespace ccex = compiz::config::integration::test::expectations; |
241 | |
242 | -typedef std::tr1::tuple <CCSSettingType, |
243 | +typedef testing::tuple <CCSSettingType, |
244 | ccit::GSettingsIntegratedSettingInfo> CCSGSettingsIntegratedSettingTestInfo; |
245 | |
246 | class CCSGSettingsIntegratedSettingTest : |
247 | @@ -359,9 +358,9 @@ |
248 | { |
249 | const std::string keyName ("mock"); |
250 | const ccit::GSettingsIntegratedSettingInfo &integratedSettingInfo = |
251 | - std::tr1::get <1> (GetParam ()); |
252 | + testing::get <1> (GetParam ()); |
253 | const CCSSettingType createSettingType = |
254 | - std::tr1::get <0> (GetParam ()); |
255 | + testing::get <0> (GetParam ()); |
256 | |
257 | /* The GSettings Integrated setting takes ownership of these */ |
258 | CCSIntegratedSettingInfo *integratedSetting = ccsSharedIntegratedSettingInfoNew (keyName.c_str (), |
259 | @@ -401,9 +400,9 @@ |
260 | { |
261 | const std::string keyName ("mock"); |
262 | const ccit::GSettingsIntegratedSettingInfo &integratedSettingInfo = |
263 | - std::tr1::get <1> (GetParam ()); |
264 | + testing::get <1> (GetParam ()); |
265 | const CCSSettingType createSettingType = |
266 | - std::tr1::get <0> (GetParam ()); |
267 | + testing::get <0> (GetParam ()); |
268 | |
269 | CCSIntegratedSettingInfo *integratedSetting = ccsSharedIntegratedSettingInfoNew (keyName.c_str (), |
270 | keyName.c_str (), |
271 | |
272 | === modified file 'compizconfig/integration/mate/gsettings/tests/compizconfig_test_ccs_mate_gsettings_integrated_setting.cpp' |
273 | --- compizconfig/integration/mate/gsettings/tests/compizconfig_test_ccs_mate_gsettings_integrated_setting.cpp 2015-02-04 22:20:18 +0000 |
274 | +++ compizconfig/integration/mate/gsettings/tests/compizconfig_test_ccs_mate_gsettings_integrated_setting.cpp 2018-07-23 10:45:35 +0000 |
275 | @@ -25,7 +25,6 @@ |
276 | |
277 | #include <map> |
278 | #include <memory> |
279 | -#include <tr1/tuple> |
280 | #include <boost/shared_ptr.hpp> |
281 | |
282 | #include <glib_gslice_off_env.h> |
283 | @@ -158,7 +157,7 @@ |
284 | namespace ccvalg = compiz::config::integration::test::value_generators; |
285 | namespace ccex = compiz::config::integration::test::expectations; |
286 | |
287 | -typedef std::tr1::tuple <CCSSettingType, |
288 | +typedef testing::tuple <CCSSettingType, |
289 | ccit::GSettingsIntegratedSettingInfo> CCSGSettingsIntegratedSettingTestInfo; |
290 | |
291 | class CCSGSettingsIntegratedSettingTest : |
292 | @@ -359,9 +358,9 @@ |
293 | { |
294 | const std::string keyName ("mock"); |
295 | const ccit::GSettingsIntegratedSettingInfo &integratedSettingInfo = |
296 | - std::tr1::get <1> (GetParam ()); |
297 | + testing::get <1> (GetParam ()); |
298 | const CCSSettingType createSettingType = |
299 | - std::tr1::get <0> (GetParam ()); |
300 | + testing::get <0> (GetParam ()); |
301 | |
302 | /* The GSettings Integrated setting takes ownership of these */ |
303 | CCSIntegratedSettingInfo *integratedSetting = ccsSharedIntegratedSettingInfoNew (keyName.c_str (), |
304 | @@ -401,9 +400,9 @@ |
305 | { |
306 | const std::string keyName ("mock"); |
307 | const ccit::GSettingsIntegratedSettingInfo &integratedSettingInfo = |
308 | - std::tr1::get <1> (GetParam ()); |
309 | + testing::get <1> (GetParam ()); |
310 | const CCSSettingType createSettingType = |
311 | - std::tr1::get <0> (GetParam ()); |
312 | + testing::get <0> (GetParam ()); |
313 | |
314 | CCSIntegratedSettingInfo *integratedSetting = ccsSharedIntegratedSettingInfoNew (keyName.c_str (), |
315 | keyName.c_str (), |
316 | |
317 | === modified file 'compizconfig/libcompizconfig/tests/compizconfig_test_ccs_object.cpp' |
318 | --- compizconfig/libcompizconfig/tests/compizconfig_test_ccs_object.cpp 2013-07-17 01:32:38 +0000 |
319 | +++ compizconfig/libcompizconfig/tests/compizconfig_test_ccs_object.cpp 2018-07-23 10:45:35 +0000 |
320 | @@ -82,9 +82,9 @@ |
321 | unsigned int j = CCS_INTERFACE_TYPE_DUMMY; |
322 | unsigned int k = CCS_INTERFACE_TYPE_DUMMY2; |
323 | |
324 | - EXPECT_EQ (i, 1); |
325 | - EXPECT_EQ (j ,1); |
326 | - EXPECT_EQ (k, 2); |
327 | + EXPECT_EQ (i, 1u); |
328 | + EXPECT_EQ (j, 1u); |
329 | + EXPECT_EQ (k, 2u); |
330 | } |
331 | |
332 | TEST(CCSObjectTest, InterfaceAdd) |
333 | @@ -95,7 +95,7 @@ |
334 | ccsObjectAddInterface (to, (const CCSInterface *) &SomeDummyInterface, 1); |
335 | |
336 | EXPECT_EQ (*((CCSObject *) to)->interfaces, (const CCSInterface *) (&SomeDummyInterface)); |
337 | - EXPECT_EQ (((CCSObject *) to)->n_interfaces, 1); |
338 | + EXPECT_EQ (((CCSObject *) to)->n_interfaces, 1u); |
339 | EXPECT_EQ (*((CCSObject *) to)->interface_types, 1); |
340 | |
341 | ccsObjectFinalize (to); |
342 | @@ -144,13 +144,13 @@ |
343 | ccsObjectAddInterface (to, (const CCSInterface *) &SomeDummyInterface, 1); |
344 | |
345 | EXPECT_EQ (*((CCSObject *) to)->interfaces, (const CCSInterface *) (&SomeDummyInterface)); |
346 | - EXPECT_EQ (((CCSObject *) to)->n_interfaces, 1); |
347 | + EXPECT_EQ (((CCSObject *) to)->n_interfaces, 1u); |
348 | EXPECT_EQ (*((CCSObject *) to)->interface_types, 1); |
349 | |
350 | ccsObjectRemoveInterface (to, 1); |
351 | |
352 | EXPECT_EQ (NULL, ((CCSObject *) to)->interfaces); |
353 | - EXPECT_EQ (((CCSObject *) to)->n_interfaces, 0); |
354 | + EXPECT_EQ (((CCSObject *) to)->n_interfaces, 0u); |
355 | EXPECT_EQ (NULL, ((CCSObject *) to)->interface_types); |
356 | |
357 | free (to); |
358 | @@ -164,7 +164,7 @@ |
359 | ccsObjectAddInterface (to, (const CCSInterface *) &SomeDummyInterface, 1); |
360 | |
361 | EXPECT_EQ (*((CCSObject *) to)->interfaces, (const CCSInterface *) (&SomeDummyInterface)); |
362 | - EXPECT_EQ (((CCSObject *) to)->n_interfaces, 1); |
363 | + EXPECT_EQ (((CCSObject *) to)->n_interfaces, 1u); |
364 | EXPECT_EQ (*((CCSObject *) to)->interface_types, 1); |
365 | |
366 | const DummyInterface *myDummyInterface = (const DummyInterface *) ccsObjectGetInterface (to, 1); |
367 | @@ -177,7 +177,7 @@ |
368 | ccsObjectRemoveInterface (to, 1); |
369 | |
370 | EXPECT_EQ (NULL, ((CCSObject *) to)->interfaces); |
371 | - EXPECT_EQ (((CCSObject *) to)->n_interfaces, 0); |
372 | + EXPECT_EQ (((CCSObject *) to)->n_interfaces, 0u); |
373 | EXPECT_EQ (NULL, ((CCSObject *) to)->interface_types); |
374 | |
375 | free (to); |
376 | @@ -246,7 +246,7 @@ |
377 | ccsObjectAddInterface (to, (const CCSInterface *) &SomeDummyInterface, 1); |
378 | |
379 | EXPECT_EQ (*((CCSObject *) to)->interfaces, (const CCSInterface *) (&SomeDummyInterface)); |
380 | - EXPECT_EQ (((CCSObject *) to)->n_interfaces, 1); |
381 | + EXPECT_EQ (((CCSObject *) to)->n_interfaces, 1u); |
382 | EXPECT_EQ (*((CCSObject *) to)->interface_types, 1); |
383 | |
384 | int *i = (int *) malloc (sizeof (int)); |
385 | @@ -264,7 +264,7 @@ |
386 | |
387 | EXPECT_EQ (NULL, ((CCSObject *) to)->priv); |
388 | EXPECT_EQ (NULL, ((CCSObject *) to)->interfaces); |
389 | - EXPECT_EQ (((CCSObject *) to)->n_interfaces, 0); |
390 | + EXPECT_EQ (((CCSObject *) to)->n_interfaces, 0u); |
391 | EXPECT_EQ (NULL, ((CCSObject *) to)->interface_types); |
392 | |
393 | free (to); |
394 | @@ -292,7 +292,7 @@ |
395 | ccsObjectAddInterface (to, (const CCSInterface *) &SomeDummyInterface, 1); |
396 | |
397 | EXPECT_EQ (NULL, ((CCSObject *) to)->interfaces); |
398 | - EXPECT_EQ (((CCSObject *) to)->n_interfaces, 0); |
399 | + EXPECT_EQ (((CCSObject *) to)->n_interfaces, 0u); |
400 | EXPECT_EQ (NULL, ((CCSObject *) to)->interface_types); |
401 | |
402 | free (to); |
403 | @@ -306,27 +306,27 @@ |
404 | ccsObjectAddInterface (to, (const CCSInterface *) &SomeDummyInterface, 1); |
405 | |
406 | EXPECT_EQ (*((CCSObject *) to)->interfaces, (const CCSInterface *) (&SomeDummyInterface)); |
407 | - EXPECT_EQ (((CCSObject *) to)->n_interfaces, 1); |
408 | + EXPECT_EQ (((CCSObject *) to)->n_interfaces, 1u); |
409 | EXPECT_EQ (*((CCSObject *) to)->interface_types, 1); |
410 | |
411 | ccsObjectAddInterface (to, (const CCSInterface *) &SomeDummyInterface, 2); |
412 | |
413 | EXPECT_EQ (*((CCSObject *) to)->interfaces, (const CCSInterface *) (&SomeDummyInterface)); |
414 | - EXPECT_EQ (((CCSObject *) to)->n_interfaces, 2); |
415 | + EXPECT_EQ (((CCSObject *) to)->n_interfaces, 2u); |
416 | EXPECT_EQ (*((CCSObject *) to)->interface_types, 1); |
417 | |
418 | ccsObjectRemoveInterface (to, 1); |
419 | |
420 | EXPECT_EQ (*((CCSObject *) to)->interfaces, (const CCSInterface *) (&SomeDummyInterface)); |
421 | - EXPECT_EQ (((CCSObject *) to)->n_interfaces, 1); |
422 | - EXPECT_EQ (((CCSObject *) to)->n_allocated_interfaces, 2); |
423 | + EXPECT_EQ (((CCSObject *) to)->n_interfaces, 1u); |
424 | + EXPECT_EQ (((CCSObject *) to)->n_allocated_interfaces, 2u); |
425 | EXPECT_EQ (*((CCSObject *) to)->interface_types, 2); |
426 | |
427 | ccsObjectRemoveInterface (to, 2); |
428 | |
429 | EXPECT_EQ (NULL, ((CCSObject *) to)->interfaces); |
430 | - EXPECT_EQ (((CCSObject *) to)->n_interfaces, 0); |
431 | - EXPECT_EQ (((CCSObject *) to)->n_allocated_interfaces, 0); |
432 | + EXPECT_EQ (((CCSObject *) to)->n_interfaces, 0u); |
433 | + EXPECT_EQ (((CCSObject *) to)->n_allocated_interfaces, 0u); |
434 | EXPECT_EQ (NULL, ((CCSObject *) to)->interface_types); |
435 | |
436 | free (to); |
437 | |
438 | === modified file 'compizconfig/libcompizconfig/tests/compizconfig_test_ccs_setting.cpp' |
439 | --- compizconfig/libcompizconfig/tests/compizconfig_test_ccs_setting.cpp 2013-10-31 15:59:14 +0000 |
440 | +++ compizconfig/libcompizconfig/tests/compizconfig_test_ccs_setting.cpp 2018-07-23 10:45:35 +0000 |
441 | @@ -18,8 +18,6 @@ |
442 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
443 | */ |
444 | |
445 | -#include <tr1/tuple> |
446 | - |
447 | #include <gtest/gtest.h> |
448 | #include <gmock/gmock.h> |
449 | |
450 | @@ -1456,7 +1454,7 @@ |
451 | changeTo); |
452 | } |
453 | |
454 | -typedef std::tr1::tuple <SetParam::Ptr, |
455 | +typedef testing::tuple <SetParam::Ptr, |
456 | SetMethod> SettingDefaultImplSetParamType; |
457 | |
458 | class SettingDefaultImplSet : |
459 | @@ -1466,8 +1464,8 @@ |
460 | public: |
461 | |
462 | SettingDefaultImplSet () : |
463 | - setHarness (std::tr1::get <0> (GetParam ())), |
464 | - setMethod (std::tr1::get <1> (GetParam ())) |
465 | + setHarness (testing::get <0> (GetParam ())), |
466 | + setMethod (testing::get <1> (GetParam ())) |
467 | { |
468 | } |
469 | |
470 | |
471 | === modified file 'compizconfig/tests/compizconfig_backend_concept_test.h' |
472 | --- compizconfig/tests/compizconfig_backend_concept_test.h 2013-10-31 15:59:14 +0000 |
473 | +++ compizconfig/tests/compizconfig_backend_concept_test.h 2018-07-23 10:45:35 +0000 |
474 | @@ -840,7 +840,7 @@ |
475 | boost::shared_ptr <_CCSStringList> existingProfiles (ccsBackendGetExistingProfiles (backend, context.get ()), |
476 | boost::bind (ccsStringListFree, _1, TRUE)); |
477 | |
478 | - ASSERT_EQ (ccsStringListLength (existingProfiles.get ()), 4); |
479 | + ASSERT_EQ (ccsStringListLength (existingProfiles.get ()), 4u); |
480 | |
481 | /* Default profile must always be there */ |
482 | EXPECT_THAT (existingProfiles.get (), IsStringItemInStringCCSList (Eq (PROFILE_DEFAULT))); |
483 | @@ -874,7 +874,7 @@ |
484 | boost::shared_ptr <_CCSStringList> existingProfiles (ccsBackendGetExistingProfiles (backend, context.get ()), |
485 | boost::bind (ccsStringListFree, _1, TRUE)); |
486 | |
487 | - ASSERT_EQ (ccsStringListLength (existingProfiles.get ()), 3); |
488 | + ASSERT_EQ (ccsStringListLength (existingProfiles.get ()), 3u); |
489 | |
490 | /* Default profile must always be there */ |
491 | EXPECT_THAT (existingProfiles.get (), IsStringItemInStringCCSList (Eq (PROFILE_DEFAULT))); |
492 | @@ -911,7 +911,7 @@ |
493 | boost::shared_ptr <_CCSStringList> existingProfiles (ccsBackendGetExistingProfiles (backend, context.get ()), |
494 | boost::bind (ccsStringListFree, _1, TRUE)); |
495 | |
496 | - ASSERT_EQ (ccsStringListLength (existingProfiles.get ()), 4); |
497 | + ASSERT_EQ (ccsStringListLength (existingProfiles.get ()), 4u); |
498 | |
499 | /* Default profile must always be there */ |
500 | EXPECT_THAT (existingProfiles.get (), IsStringItemInStringCCSList (Eq (PROFILE_DEFAULT))); |
501 | @@ -952,7 +952,7 @@ |
502 | boost::shared_ptr <_CCSStringList> existingProfiles (ccsBackendGetExistingProfiles (backend, context.get ()), |
503 | boost::bind (ccsStringListFree, _1, TRUE)); |
504 | |
505 | - ASSERT_EQ (ccsStringListLength (existingProfiles.get ()), 2); |
506 | + ASSERT_EQ (ccsStringListLength (existingProfiles.get ()), 2u); |
507 | /* Default profile must always be there */ |
508 | EXPECT_THAT (existingProfiles.get (), IsStringItemInStringCCSList (Eq (PROFILE_DEFAULT))); |
509 | |
510 | @@ -966,4 +966,3 @@ |
511 | } |
512 | |
513 | #endif |
514 | - |
515 | |
516 | === modified file 'debian/control' |
517 | --- debian/control 2018-07-12 08:44:10 +0000 |
518 | +++ debian/control 2018-07-23 10:45:35 +0000 |
519 | @@ -8,6 +8,7 @@ |
520 | debhelper (>= 9~), |
521 | dh-migrations, |
522 | dh-translations, |
523 | + googletest (>= 1.8.0), |
524 | intltool, |
525 | libtool, |
526 | pkg-config, |
527 | |
528 | === modified file 'plugins/composite/src/pixmapbinding/tests/test-composite-pixmapbinding.cpp' |
529 | --- plugins/composite/src/pixmapbinding/tests/test-composite-pixmapbinding.cpp 2013-03-06 13:44:06 +0000 |
530 | +++ plugins/composite/src/pixmapbinding/tests/test-composite-pixmapbinding.cpp 2018-07-23 10:45:35 +0000 |
531 | @@ -178,7 +178,7 @@ |
532 | |
533 | EXPECT_CALL (*wp, pixmap ()).WillOnce (Return (1)); |
534 | |
535 | - EXPECT_EQ (pr.pixmap (), 1); |
536 | + EXPECT_EQ (pr.pixmap (), 1u); |
537 | EXPECT_EQ (pr.size (), CompSize (102, 202)); |
538 | |
539 | EXPECT_CALL (*wp, releasePixmap ()); |
540 | @@ -226,7 +226,7 @@ |
541 | |
542 | EXPECT_CALL (*wp, pixmap ()).WillOnce (Return (1)); |
543 | |
544 | - EXPECT_EQ (pr.pixmap (), 1); |
545 | + EXPECT_EQ (pr.pixmap (), 1u); |
546 | EXPECT_EQ (pr.size (), CompSize (102, 202)); |
547 | |
548 | EXPECT_CALL (*wp, releasePixmap ()); |
549 | @@ -274,7 +274,7 @@ |
550 | EXPECT_CALL (mpf, frozen ()).WillOnce (Return (false)); |
551 | EXPECT_CALL (*wp, pixmap ()).WillOnce (Return (1)); |
552 | |
553 | - EXPECT_EQ (pr.pixmap (), 1); |
554 | + EXPECT_EQ (pr.pixmap (), 1u); |
555 | EXPECT_EQ (pr.size (), CompSize (102, 202)); |
556 | |
557 | EXPECT_CALL (*wp, releasePixmap ()); |
558 | @@ -295,7 +295,7 @@ |
559 | |
560 | EXPECT_CALL (*wp, pixmap ()).WillOnce (Return (1)); |
561 | |
562 | - EXPECT_EQ (pr.pixmap (), 1); |
563 | + EXPECT_EQ (pr.pixmap (), 1u); |
564 | EXPECT_EQ (pr.size (), CompSize (102, 202)); |
565 | |
566 | EXPECT_CALL (*wp, releasePixmap ()); |
567 | @@ -343,7 +343,7 @@ |
568 | EXPECT_CALL (mpf, frozen ()).WillOnce (Return (true)); |
569 | EXPECT_CALL (*wp, pixmap ()).WillOnce (Return (1)); |
570 | |
571 | - EXPECT_EQ (pr.pixmap (), 1); |
572 | + EXPECT_EQ (pr.pixmap (), 1u); |
573 | EXPECT_EQ (pr.size (), CompSize (102, 202)); |
574 | |
575 | pr.release (); |
576 | @@ -352,7 +352,7 @@ |
577 | |
578 | EXPECT_CALL (*wp, pixmap ()).WillOnce (Return (1)); |
579 | |
580 | - EXPECT_EQ (pr.pixmap (), 1); |
581 | + EXPECT_EQ (pr.pixmap (), 1u); |
582 | EXPECT_EQ (pr.size (), CompSize (102, 202)); |
583 | |
584 | EXPECT_CALL (*wp, releasePixmap ()); |
585 | @@ -387,7 +387,7 @@ |
586 | |
587 | EXPECT_FALSE (pr.bind ()); |
588 | |
589 | - EXPECT_EQ (pr.pixmap (), 0); |
590 | + EXPECT_EQ (pr.pixmap (), 0u); |
591 | EXPECT_EQ (pr.size (), CompSize (0, 0)); |
592 | } |
593 | |
594 | @@ -420,7 +420,7 @@ |
595 | |
596 | EXPECT_FALSE (pr.bind ()); |
597 | |
598 | - EXPECT_EQ (pr.pixmap (), 0); |
599 | + EXPECT_EQ (pr.pixmap (), 0u); |
600 | EXPECT_EQ (pr.size (), CompSize (0, 0)); |
601 | } |
602 | |
603 | @@ -458,7 +458,7 @@ |
604 | |
605 | EXPECT_FALSE (pr.bind ()); |
606 | |
607 | - EXPECT_EQ (pr.pixmap (), 0); |
608 | + EXPECT_EQ (pr.pixmap (), 0u); |
609 | EXPECT_EQ (pr.size (), CompSize (0, 0)); |
610 | } |
611 | |
612 | @@ -493,7 +493,7 @@ |
613 | |
614 | EXPECT_FALSE (pr.bind ()); |
615 | |
616 | - EXPECT_EQ (pr.pixmap (), 0); |
617 | + EXPECT_EQ (pr.pixmap (), 0u); |
618 | EXPECT_EQ (pr.size (), CompSize (0, 0)); |
619 | |
620 | EXPECT_FALSE (pr.bind ()); |
621 | @@ -519,6 +519,6 @@ |
622 | EXPECT_TRUE (pr.bind ()); |
623 | |
624 | EXPECT_CALL (*wp, pixmap ()).WillOnce (Return (1)); |
625 | - EXPECT_EQ (pr.pixmap (), 1); |
626 | + EXPECT_EQ (pr.pixmap (), 1u); |
627 | EXPECT_EQ (pr.size (), CompSize (102, 202)); |
628 | } |
629 | |
630 | === modified file 'plugins/decor/tests/acceptance/xorg-gtest/compiz_decor_acceptance_tests.cpp' |
631 | --- plugins/decor/tests/acceptance/xorg-gtest/compiz_decor_acceptance_tests.cpp 2013-09-06 16:15:55 +0000 |
632 | +++ plugins/decor/tests/acceptance/xorg-gtest/compiz_decor_acceptance_tests.cpp 2018-07-23 10:45:35 +0000 |
633 | @@ -128,47 +128,47 @@ |
634 | "UTF8_STRING", |
635 | 1); |
636 | |
637 | - ASSERT_NE (0, mUtf8StringAtom); |
638 | + ASSERT_NE (0u, mUtf8StringAtom); |
639 | |
640 | mDecorationManagerNameAtom = XInternAtom (Display (), |
641 | "_COMPIZ_DM_NAME", |
642 | 0); |
643 | |
644 | - ASSERT_NE (0, mDecorationManagerNameAtom); |
645 | + ASSERT_NE (0u, mDecorationManagerNameAtom); |
646 | |
647 | mDecorationTypePixmap = XInternAtom (Display (), |
648 | DECOR_TYPE_PIXMAP_ATOM_NAME, |
649 | 0); |
650 | |
651 | - ASSERT_NE (0, mDecorationTypePixmap); |
652 | + ASSERT_NE (0u, mDecorationTypePixmap); |
653 | |
654 | mDecorationTypeWindow = XInternAtom (Display (), |
655 | DECOR_TYPE_WINDOW_ATOM_NAME, |
656 | 0); |
657 | |
658 | - ASSERT_NE (0, mDecorationTypeWindow); |
659 | + ASSERT_NE (0u, mDecorationTypeWindow); |
660 | |
661 | mDecorationTypeAtom = XInternAtom (Display (), |
662 | DECOR_TYPE_ATOM_NAME, |
663 | 0); |
664 | |
665 | - ASSERT_NE (0, mDecorationTypeAtom); |
666 | + ASSERT_NE (0u, mDecorationTypeAtom); |
667 | |
668 | mDecorationInputFrameAtom = XInternAtom (Display (), |
669 | DECOR_INPUT_FRAME_ATOM_NAME, |
670 | 0); |
671 | |
672 | - ASSERT_NE (0, mDecorationInputFrameAtom); |
673 | + ASSERT_NE (0u, mDecorationInputFrameAtom); |
674 | |
675 | mDecorationOutputFrameAtom = XInternAtom (Display (), |
676 | DECOR_OUTPUT_FRAME_ATOM_NAME, |
677 | 0); |
678 | |
679 | - ASSERT_NE (0, mDecorationOutputFrameAtom); |
680 | + ASSERT_NE (0u, mDecorationOutputFrameAtom); |
681 | |
682 | mRootWindow = DefaultRootWindow (Display ()); |
683 | |
684 | - ASSERT_NE (0, mRootWindow); |
685 | + ASSERT_NE (0u, mRootWindow); |
686 | } |
687 | |
688 | ct::CompizProcess::PluginList |
689 | @@ -1608,7 +1608,7 @@ |
690 | parent, |
691 | nChildren)); |
692 | |
693 | - EXPECT_EQ (2, nChildren); |
694 | + EXPECT_EQ (2u, nChildren); |
695 | } |
696 | |
697 | namespace |
698 | @@ -1647,13 +1647,14 @@ |
699 | parent, |
700 | nChildren)); |
701 | |
702 | - ASSERT_EQ (2, nChildren); |
703 | + ASSERT_EQ (2u, nChildren); |
704 | |
705 | + Window noneWindow = None; |
706 | Window decorationWindow = FindDecorationWindowFromChildren (Display (), |
707 | children, |
708 | nChildren); |
709 | |
710 | - ASSERT_NE (None, decorationWindow); |
711 | + ASSERT_NE (noneWindow, decorationWindow); |
712 | |
713 | decor_extents_t borderExtents (DecorationExtents (ActiveBorderExtent, |
714 | ActiveBorderExtent, |
715 | |
716 | === modified file 'plugins/expo/src/wall_offset/tests/test-expo-wall-offset.cpp' |
717 | --- plugins/expo/src/wall_offset/tests/test-expo-wall-offset.cpp 2013-08-21 20:12:13 +0000 |
718 | +++ plugins/expo/src/wall_offset/tests/test-expo-wall-offset.cpp 2018-07-23 10:45:35 +0000 |
719 | @@ -22,7 +22,6 @@ |
720 | * |
721 | * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com> |
722 | */ |
723 | -#include <tr1/tuple> |
724 | #include <gtest/gtest.h> |
725 | #include "wall-offset.h" |
726 | |
727 | @@ -170,7 +169,7 @@ |
728 | }, |
729 | }; |
730 | |
731 | - typedef std::tr1::tuple <OffsetParameters, unsigned int> AnimParam; |
732 | + typedef testing::tuple <OffsetParameters, unsigned int> AnimParam; |
733 | } |
734 | |
735 | class ExpoWallOffsetTestAnimations : |
736 | @@ -190,8 +189,8 @@ |
737 | |
738 | TEST_P (ExpoWallOffsetTestAnimations, TestAnimationValues) |
739 | { |
740 | - const OffsetParameters &offset (std::tr1::get <0> (GetParam ())); |
741 | - const unsigned int &index (std::tr1::get <1> (GetParam ())); |
742 | + const OffsetParameters &offset (testing::get <0> (GetParam ())); |
743 | + const unsigned int &index (testing::get <1> (GetParam ())); |
744 | |
745 | RecordProperty ("outputWidth", offset.outputWidth); |
746 | RecordProperty ("outputHeight", offset.outputHeight); |
747 | |
748 | === modified file 'plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp' |
749 | --- plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp 2013-06-26 21:59:35 +0000 |
750 | +++ plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp 2018-07-23 10:45:35 +0000 |
751 | @@ -23,7 +23,6 @@ |
752 | * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com> |
753 | */ |
754 | |
755 | -#include <tr1/tuple> |
756 | #include <test-constrain-to-workarea.h> |
757 | #include <constrain-to-workarea.h> |
758 | #include <iostream> |
759 | @@ -48,7 +47,7 @@ |
760 | workArea (50, 50, 900, 1900), |
761 | flags (0) |
762 | { |
763 | - memset (&extents, 0, sizeof (cwe::Extents)); |
764 | + extents = cwe::Extents (); |
765 | } |
766 | |
767 | protected: |
768 | @@ -180,22 +179,22 @@ |
769 | |
770 | namespace |
771 | { |
772 | -typedef std::tr1::tuple <cw::Geometry, cwe::Extents> ConstrainPositionToWorkAreaParam; |
773 | +typedef testing::tuple <cw::Geometry, cwe::Extents> ConstrainPositionToWorkAreaParam; |
774 | |
775 | const cw::Geometry & WindowGeometry (const ConstrainPositionToWorkAreaParam &p) |
776 | { |
777 | - return std::tr1::get <0> (p); |
778 | + return testing::get <0> (p); |
779 | } |
780 | |
781 | const cwe::Extents & WindowExtents (const ConstrainPositionToWorkAreaParam &p) |
782 | { |
783 | - return std::tr1::get <1> (p); |
784 | + return testing::get <1> (p); |
785 | } |
786 | |
787 | CompPoint InitialPosition (const ConstrainPositionToWorkAreaParam &p) |
788 | { |
789 | /* Initial position is where the window is right now */ |
790 | - return (std::tr1::get <0> (p)).pos (); |
791 | + return (testing::get <0> (p)).pos (); |
792 | } |
793 | |
794 | const CompRect WArea (50, 50, 900, 1900); |
795 | @@ -210,7 +209,7 @@ |
796 | |
797 | PlaceConstrainPositionToWorkArea () |
798 | { |
799 | - memset (&extents, 0, sizeof (cwe::Extents)); |
800 | + extents = cwe::Extents (); |
801 | } |
802 | |
803 | protected: |
804 | @@ -352,8 +351,8 @@ |
805 | |
806 | CompPoint position (cp::getViewportRelativeCoordinates (geom, |
807 | SCREEN_SIZE)); |
808 | - EXPECT_EQ (SCREEN_SIZE.width () - (WINDOW_SIZE + 1), |
809 | - position.x ()); |
810 | + int x = SCREEN_SIZE.width () - (WINDOW_SIZE + 1); |
811 | + EXPECT_EQ (x, position.x ()); |
812 | } |
813 | |
814 | TEST (PlaceGetViewportRelativeCoordinates, OutsideOuterScreenHeight) |
815 | @@ -377,8 +376,8 @@ |
816 | |
817 | CompPoint position (cp::getViewportRelativeCoordinates (geom, |
818 | SCREEN_SIZE)); |
819 | - EXPECT_EQ (SCREEN_SIZE.height () - (WINDOW_SIZE + 1), |
820 | - position.y ()); |
821 | + int y = SCREEN_SIZE.height () - (WINDOW_SIZE + 1); |
822 | + EXPECT_EQ (y, position.y ()); |
823 | } |
824 | |
825 | namespace |
826 | @@ -535,9 +534,10 @@ |
827 | CompWindowExtents edgePositions (100, 200, 100, 200); |
828 | XWindowChanges xwc; |
829 | unsigned int mask = 0; |
830 | + unsigned int expected_mask = CWWidth; |
831 | ASSERT_TRUE (cp::applyWidthChange(edgePositions, xwc, mask)); |
832 | EXPECT_EQ (edgePositions.right - edgePositions.left, xwc.width); |
833 | - EXPECT_EQ (CWWidth, mask); |
834 | + EXPECT_EQ (expected_mask, mask); |
835 | } |
836 | |
837 | TEST (PlaceApplyHeightChange, ReturnFalseIfNoChange) |
838 | @@ -554,7 +554,8 @@ |
839 | CompWindowExtents edgePositions (100, 200, 100, 200); |
840 | XWindowChanges xwc; |
841 | unsigned int mask = 0; |
842 | + unsigned int expected_mask = CWHeight; |
843 | ASSERT_TRUE (cp::applyHeightChange(edgePositions, xwc, mask)); |
844 | EXPECT_EQ (edgePositions.bottom - edgePositions.top, xwc.height); |
845 | - EXPECT_EQ (CWHeight, mask); |
846 | + EXPECT_EQ (expected_mask, mask); |
847 | } |
848 | |
849 | === modified file 'plugins/place/src/screen-size-change/tests/screen-size-change/src/test-place-screen-size-change.cpp' |
850 | --- plugins/place/src/screen-size-change/tests/screen-size-change/src/test-place-screen-size-change.cpp 2016-11-07 10:31:07 +0000 |
851 | +++ plugins/place/src/screen-size-change/tests/screen-size-change/src/test-place-screen-size-change.cpp 2018-07-23 10:45:35 +0000 |
852 | @@ -170,7 +170,7 @@ |
853 | mCurrentWorkArea (50, 50, 1000, 1000), |
854 | mCurrentGeometry (g) |
855 | { |
856 | - memset (&mCurrentExtents, 0, sizeof (cw::extents::Extents)); |
857 | + mCurrentExtents = cw::extents::Extents (); |
858 | } |
859 | |
860 | StubScreenSizeChangeObject::~StubScreenSizeChangeObject () |
861 | |
862 | === modified file 'src/option/tests/option.cpp' |
863 | --- src/option/tests/option.cpp 2012-12-10 13:01:00 +0000 |
864 | +++ src/option/tests/option.cpp 2018-07-23 10:45:35 +0000 |
865 | @@ -234,10 +234,10 @@ |
866 | |
867 | /* We don't care about the old action's state, so get |
868 | * rid of it */ |
869 | - ASSERT_EQ (option.value ().action ().state (), 0); |
870 | + ASSERT_EQ (option.value ().action ().state (), 0u); |
871 | |
872 | /* We do want to keep the non-stateful data which is |
873 | * pure info */ |
874 | ASSERT_EQ (option.value ().action ().button ().button (), 1); |
875 | - ASSERT_EQ (option.value ().action ().button ().modifiers (), 1 << 1); |
876 | + ASSERT_EQ (option.value ().action ().button ().modifiers (), 1u << 1); |
877 | } |
878 | |
879 | === modified file 'src/privatescreen/tests/test-privatescreen.cpp' |
880 | --- src/privatescreen/tests/test-privatescreen.cpp 2017-06-29 17:19:00 +0000 |
881 | +++ src/privatescreen/tests/test-privatescreen.cpp 2018-07-23 10:45:35 +0000 |
882 | @@ -636,7 +636,7 @@ |
883 | |
884 | CompOption::Value::Vector merged = ps.mergedPluginList(extra); |
885 | |
886 | - ASSERT_EQ(merged.size(), 6); |
887 | + ASSERT_EQ(merged.size(), 6u); |
888 | ASSERT_EQ(merged[0].s(), "core"); |
889 | ASSERT_EQ(merged[1].s(), "alice"); |
890 | ASSERT_EQ(merged[2].s(), "bob"); |
891 | @@ -992,12 +992,15 @@ |
892 | |
893 | grabList.grabsPush (new cps::Grab (None, "Nil")); |
894 | |
895 | - EXPECT_EQ (ce::processButtonPressOnEdgeWindow (edgeWindow, |
896 | + int edge = ce::processButtonPressOnEdgeWindow (edgeWindow, |
897 | rootWindow, |
898 | 0, |
899 | rootWindow, |
900 | grabList, |
901 | - screenEdges), topEdgeMask); |
902 | + screenEdges); |
903 | + |
904 | + EXPECT_GT (edge, 0); |
905 | + EXPECT_EQ (static_cast<unsigned int>(edge), topEdgeMask); |
906 | |
907 | grabList.grabsRemove (grabList.grabsBack ()); |
908 | } |
909 | @@ -1008,7 +1011,10 @@ |
910 | |
911 | ce::EventArguments arguments (2); |
912 | ce::setEventWindowInButtonPressArguments (arguments, activeWindow); |
913 | - EXPECT_EQ (arguments[1].value ().i (), activeWindow); |
914 | + |
915 | + Window window = arguments[1].value ().i (); |
916 | + |
917 | + EXPECT_EQ (window, activeWindow); |
918 | } |
919 | |
920 | namespace |
921 | |
922 | === modified file 'src/region/tests/test-region.cpp' |
923 | --- src/region/tests/test-region.cpp 2013-07-15 09:48:24 +0000 |
924 | +++ src/region/tests/test-region.cpp 2018-07-23 10:45:35 +0000 |
925 | @@ -325,7 +325,7 @@ |
926 | typedef std::vector<CompRect> vcr; |
927 | { |
928 | vcr const& rects = r1_r2.rects(); |
929 | - EXPECT_EQ(2, rects.size()); |
930 | + EXPECT_EQ(2u, rects.size()); |
931 | |
932 | for(vcr::const_iterator i = rects.begin(); i !=rects.end(); ++i) |
933 | { |
934 | @@ -358,7 +358,7 @@ |
935 | typedef std::vector<CompRect> vcr; |
936 | { |
937 | vcr const& rects = r1_rect2.rects(); |
938 | - EXPECT_EQ(2, rects.size()); |
939 | + EXPECT_EQ(2u, rects.size()); |
940 | |
941 | for(vcr::const_iterator i = rects.begin(); i !=rects.end(); ++i) |
942 | { |
943 | |
944 | === modified file 'src/timer/tests/set-values/src/test-timer-set-values.cpp' |
945 | --- src/timer/tests/set-values/src/test-timer-set-values.cpp 2013-02-26 11:56:10 +0000 |
946 | +++ src/timer/tests/set-values/src/test-timer-set-values.cpp 2018-07-23 10:45:35 +0000 |
947 | @@ -40,10 +40,10 @@ |
948 | * expiry time in order to check them |
949 | * for an accurate value of zero */ |
950 | |
951 | - ASSERT_EQ (t1->minTime(), 100); |
952 | - ASSERT_EQ (t1->maxTime(), 100); |
953 | - ASSERT_EQ (t1->minLeft(), 0); |
954 | - ASSERT_EQ (t1->maxLeft(), 0); |
955 | + ASSERT_EQ (t1->minTime(), 100u); |
956 | + ASSERT_EQ (t1->maxTime(), 100u); |
957 | + ASSERT_EQ (t1->minLeft(), 0u); |
958 | + ASSERT_EQ (t1->maxLeft(), 0u); |
959 | |
960 | delete t1; |
961 | } |
962 | |
963 | === modified file 'src/window/geometry-saver/tests/window-geometry-saver/src/test-window-geometry-saver.cpp' |
964 | --- src/window/geometry-saver/tests/window-geometry-saver/src/test-window-geometry-saver.cpp 2012-03-30 16:30:13 +0000 |
965 | +++ src/window/geometry-saver/tests/window-geometry-saver/src/test-window-geometry-saver.cpp 2018-07-23 10:45:35 +0000 |
966 | @@ -54,37 +54,42 @@ |
967 | /* g by default */ |
968 | compiz::window::Geometry rg; |
969 | unsigned int mask = saver.get (rg); |
970 | + unsigned int expected_mask; |
971 | |
972 | - EXPECT_EQ (mask, 0); |
973 | + EXPECT_EQ (mask, 0u); |
974 | EXPECT_EQ (rg, compiz::window::Geometry (100, 100, 300, 300, 5)); |
975 | |
976 | /* Push X value on to the saved geometry */ |
977 | saver.push (g, CHANGE_X); |
978 | mask = saver.get (rg); |
979 | + expected_mask = CHANGE_X; |
980 | |
981 | - EXPECT_EQ (mask, CHANGE_X); |
982 | + EXPECT_EQ (mask, expected_mask); |
983 | EXPECT_EQ (rg, compiz::window::Geometry (100, 100, 300, 300, 5)); |
984 | |
985 | /* Push Y and Width values on to the saved geometry */ |
986 | saver.push (g, CHANGE_Y | CHANGE_WIDTH); |
987 | mask = saver.get (rg); |
988 | + expected_mask = CHANGE_X | CHANGE_Y | CHANGE_WIDTH; |
989 | |
990 | - EXPECT_EQ (mask, CHANGE_X | CHANGE_Y | CHANGE_WIDTH); |
991 | + EXPECT_EQ (mask, expected_mask); |
992 | EXPECT_EQ (rg, compiz::window::Geometry (100, 100, 300, 300, 5)); |
993 | |
994 | /* Pop Y value off the saved geoemtry */ |
995 | rg = compiz::window::Geometry (); |
996 | mask = saver.pop (rg, CHANGE_Y); |
997 | + expected_mask = CHANGE_Y; |
998 | |
999 | - EXPECT_EQ (mask, CHANGE_Y); |
1000 | + EXPECT_EQ (mask, expected_mask); |
1001 | EXPECT_EQ (rg, compiz::window::Geometry (0, 100, 0, 0, 0)); |
1002 | |
1003 | /* Attempt to pop X Y and Height off the saved geometry, |
1004 | * but since Y is not saved, only expect X */ |
1005 | rg = compiz::window::Geometry (); |
1006 | mask = saver.pop (rg, CHANGE_X | CHANGE_Y | CHANGE_HEIGHT); |
1007 | + expected_mask = CHANGE_X; |
1008 | |
1009 | - EXPECT_EQ (mask, CHANGE_X); |
1010 | + EXPECT_EQ (mask, expected_mask); |
1011 | EXPECT_EQ (rg, compiz::window::Geometry (100, 0, 0, 0, 0)); |
1012 | |
1013 | /* Update the saved geometry (eg, workspace change) and |
1014 | @@ -93,8 +98,9 @@ |
1015 | g.setWidth (1200); |
1016 | saver.update (g, CHANGE_WIDTH); |
1017 | mask = saver.pop (rg, CHANGE_WIDTH); |
1018 | + expected_mask = CHANGE_WIDTH; |
1019 | |
1020 | - EXPECT_EQ (mask, CHANGE_WIDTH); |
1021 | + EXPECT_EQ (mask, expected_mask); |
1022 | EXPECT_EQ (rg, compiz::window::Geometry (0, 0, 1200, 0, 0)); |
1023 | |
1024 | /* Try to push twice, only allow the first value to be popped off */ |
1025 | @@ -105,7 +111,8 @@ |
1026 | saver.push (g, CHANGE_WIDTH); |
1027 | |
1028 | mask = saver.pop (rg, CHANGE_WIDTH); |
1029 | + expected_mask = CHANGE_WIDTH; |
1030 | |
1031 | - EXPECT_EQ (mask, CHANGE_WIDTH); |
1032 | + EXPECT_EQ (mask, expected_mask); |
1033 | EXPECT_EQ (rg, compiz::window::Geometry (0, 0, 1000, 0, 0)); |
1034 | } |
1035 | |
1036 | === modified file 'src/window/geometry/tests/window-geometry/src/test-window-geometry.cpp' |
1037 | --- src/window/geometry/tests/window-geometry/src/test-window-geometry.cpp 2012-04-04 04:47:00 +0000 |
1038 | +++ src/window/geometry/tests/window-geometry/src/test-window-geometry.cpp 2018-07-23 10:45:35 +0000 |
1039 | @@ -83,9 +83,10 @@ |
1040 | /* change mask for x | y | width | height */ |
1041 | rg = compiz::window::Geometry (49, 99, 199, 299, 5); |
1042 | unsigned int mask = rg.changeMask (g); |
1043 | + unsigned int expected_mask = CHANGE_X | CHANGE_Y | CHANGE_WIDTH | CHANGE_HEIGHT; |
1044 | |
1045 | EXPECT_EQ (rg, compiz::window::Geometry (49, 99, 199, 299, 5)); |
1046 | - EXPECT_EQ (mask, CHANGE_X | CHANGE_Y | CHANGE_WIDTH | CHANGE_HEIGHT); |
1047 | + EXPECT_EQ (mask, expected_mask); |
1048 | } |
1049 | |
1050 | TEST_F(CompWindowGeometryTestGeometry, TestBorders) |
1051 | @@ -94,6 +95,6 @@ |
1052 | |
1053 | EXPECT_EQ (g.xMinusBorder (), 0); |
1054 | EXPECT_EQ (g.yMinusBorder (), 0); |
1055 | - EXPECT_EQ (g.widthIncBorders (), 3); |
1056 | - EXPECT_EQ (g.heightIncBorders (), 3); |
1057 | + EXPECT_EQ (g.widthIncBorders (), 3u); |
1058 | + EXPECT_EQ (g.heightIncBorders (), 3u); |
1059 | } |
1060 | |
1061 | === modified file 'tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp' |
1062 | --- tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp 2015-10-26 17:15:43 +0000 |
1063 | +++ tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp 2018-07-23 10:45:35 +0000 |
1064 | @@ -133,7 +133,7 @@ |
1065 | |
1066 | ASSERT_EQ (XA_CARDINAL, actualType); |
1067 | ASSERT_EQ (32, actualFmt); |
1068 | - ASSERT_EQ (2, nItems); |
1069 | + ASSERT_EQ (2u, nItems); |
1070 | |
1071 | unsigned long *geometry = reinterpret_cast <unsigned long *> (property); |
1072 | |
1073 | |
1074 | === modified file 'tests/system/xorg-gtest/tests/compiz_xorg_gtest_icccm.cpp' |
1075 | --- tests/system/xorg-gtest/tests/compiz_xorg_gtest_icccm.cpp 2013-10-31 15:59:14 +0000 |
1076 | +++ tests/system/xorg-gtest/tests/compiz_xorg_gtest_icccm.cpp 2018-07-23 10:45:35 +0000 |
1077 | @@ -267,7 +267,7 @@ |
1078 | /* Check the client list to see that w1 > w2 */ |
1079 | std::list <Window> clientList = ct::NET_CLIENT_LIST_STACKING (dpy); |
1080 | |
1081 | - ASSERT_EQ (2, clientList.size ()); |
1082 | + ASSERT_EQ (2u, clientList.size ()); |
1083 | EXPECT_EQ (w2, clientList.front ()); |
1084 | EXPECT_EQ (w1, clientList.back ()); |
1085 | } |
1086 | |
1087 | === modified file 'tests/system/xorg-gtest/tests/compiz_xorg_gtest_test_window_stacking.cpp' |
1088 | --- tests/system/xorg-gtest/tests/compiz_xorg_gtest_test_window_stacking.cpp 2013-06-26 11:03:32 +0000 |
1089 | +++ tests/system/xorg-gtest/tests/compiz_xorg_gtest_test_window_stacking.cpp 2018-07-23 10:45:35 +0000 |
1090 | @@ -141,7 +141,7 @@ |
1091 | /* Check the client list to see that w2 > w1 */ |
1092 | std::list <Window> clientList = ct::NET_CLIENT_LIST_STACKING (dpy); |
1093 | |
1094 | - ASSERT_EQ (clientList.size (), 2); |
1095 | + ASSERT_EQ (clientList.size (), 2u); |
1096 | EXPECT_EQ (clientList.front (), w1); |
1097 | EXPECT_EQ (clientList.back (), w2); |
1098 | } |
1099 | @@ -170,7 +170,7 @@ |
1100 | -1, |
1101 | matcher))); |
1102 | std::list <Window> clientList = ct::NET_CLIENT_LIST_STACKING (dpy); |
1103 | - ASSERT_EQ (clientList.size (), 1); |
1104 | + ASSERT_EQ (clientList.size (), 1u); |
1105 | |
1106 | Window w1 = ct::CreateNormalWindow (dpy); |
1107 | Window w2 = ct::CreateNormalWindow (dpy); |
1108 | @@ -202,7 +202,7 @@ |
1109 | clientList = ct::NET_CLIENT_LIST_STACKING (dpy); |
1110 | |
1111 | /* Check the client list to see that dock > w2 > w1 */ |
1112 | - ASSERT_EQ (clientList.size (), 3); |
1113 | + ASSERT_EQ (clientList.size (), 3u); |
1114 | |
1115 | std::list <Window>::iterator it = clientList.begin (); |
1116 | |
1117 | @@ -247,7 +247,7 @@ |
1118 | |
1119 | /* Check the client list to see that w2 > w3 > w1 */ |
1120 | std::list <Window> clientList = ct::NET_CLIENT_LIST_STACKING (dpy); |
1121 | - ASSERT_EQ (clientList.size (), 3); |
1122 | + ASSERT_EQ (clientList.size (), 3u); |
1123 | |
1124 | std::list <Window>::iterator it = clientList.begin (); |
1125 | EXPECT_EQ (*it++, w1); |
1126 | @@ -292,7 +292,7 @@ |
1127 | matcher))); |
1128 | /* Check the client list to see that w2 > w3 > w1 */ |
1129 | std::list <Window> clientList = ct::NET_CLIENT_LIST_STACKING (dpy); |
1130 | - ASSERT_EQ (clientList.size (), 3); |
1131 | + ASSERT_EQ (clientList.size (), 3u); |
1132 | |
1133 | std::list <Window>::iterator it = clientList.begin (); |
1134 | EXPECT_EQ (*it++, w1); |
1135 | @@ -324,7 +324,7 @@ |
1136 | -1, |
1137 | matcher))); |
1138 | std::list <Window> clientList = ct::NET_CLIENT_LIST_STACKING (dpy); |
1139 | - ASSERT_EQ (clientList.size (), 1); |
1140 | + ASSERT_EQ (clientList.size (), 1u); |
1141 | |
1142 | Window w1 = ct::CreateNormalWindow (dpy); |
1143 | Window w2 = ct::CreateNormalWindow (dpy); |
1144 | @@ -374,7 +374,7 @@ |
1145 | |
1146 | std::list <Window>::iterator it = clientList.begin (); |
1147 | |
1148 | - EXPECT_EQ (3, clientList.size ()); |
1149 | + EXPECT_EQ (3u, clientList.size ()); |
1150 | EXPECT_EQ (w1, (*it++)); |
1151 | EXPECT_EQ (w3, (*it++)); |
1152 | EXPECT_EQ (dock, (*it++)); |
1153 | @@ -429,7 +429,7 @@ |
1154 | std::list <Window>::iterator it = clientList.begin (); |
1155 | |
1156 | /* Assert, w1 > dock > w2 */ |
1157 | - EXPECT_EQ (3, clientList.size ()); |
1158 | + EXPECT_EQ (3u, clientList.size ()); |
1159 | |
1160 | EXPECT_EQ (w2, (*it++)); |
1161 | EXPECT_EQ (dock, (*it++)); |
1162 | |
1163 | === modified file 'tests/xorg-gtest/plugins/testhelper/src/testhelper.cpp' |
1164 | --- tests/xorg-gtest/plugins/testhelper/src/testhelper.cpp 2013-07-18 13:06:24 +0000 |
1165 | +++ tests/xorg-gtest/plugins/testhelper/src/testhelper.cpp 2018-07-23 10:45:35 +0000 |
1166 | @@ -103,7 +103,7 @@ |
1167 | void |
1168 | TestHelperWindow::configureAndReport (long *data) |
1169 | { |
1170 | - XWindowChanges xwc; |
1171 | + XWindowChanges xwc = { 0 }; |
1172 | XWindowChanges saved; |
1173 | |
1174 | xwc.x = data[0]; |
1175 | |
1176 | === modified file 'tests/xorg-gtest/src/compiz_xorg_gtest_main.cpp' |
1177 | --- tests/xorg-gtest/src/compiz_xorg_gtest_main.cpp 2013-05-11 01:04:45 +0000 |
1178 | +++ tests/xorg-gtest/src/compiz_xorg_gtest_main.cpp 2018-07-23 10:45:35 +0000 |
1179 | @@ -125,7 +125,6 @@ |
1180 | SIGSTKFLT, |
1181 | SIGIO, |
1182 | SIGPWR, |
1183 | - SIGUNUSED, |
1184 | }; |
1185 | |
1186 | struct sigaction action; |
As for the unsigned checks on EXPECT's in unity we ended up on ignoring them, since they were too many to fix, but fine here.