Merge lp:~compiz-team/compiz/new-gmock into lp:compiz/0.9.10
- new-gmock
- Merge into 0.9.10
Status: | Merged |
---|---|
Approved by: | Brandon Schaefer |
Approved revision: | 3763 |
Merged at revision: | 3760 |
Proposed branch: | lp:~compiz-team/compiz/new-gmock |
Merge into: | lp:compiz/0.9.10 |
Diff against target: |
1136 lines (+568/-164) 20 files modified
CMakeLists.txt (+1/-4) cmake/GoogleTest.cmake (+0/-20) cmake/src/compiz/compiz_discover_gtest_tests.cpp (+5/-3) compizconfig/libcompizconfig/tests/compizconfig_test_ccs_mock_backend_conformance.cpp (+11/-10) compizconfig/libcompizconfig/tests/compizconfig_test_ccs_object.cpp (+21/-10) compizconfig/libcompizconfig/tests/compizconfig_test_ccs_setting.cpp (+0/-2) compizconfig/mocks/libcompizconfig/CMakeLists.txt (+10/-0) compizconfig/mocks/libcompizconfig/compizconfig_ccs_setting_stub.cpp (+425/-0) compizconfig/mocks/libcompizconfig/compizconfig_ccs_setting_stub.h (+44/-0) compizconfig/tests/CMakeLists.txt (+2/-1) compizconfig/tests/compizconfig_backend_concept_test.cpp (+31/-16) compizconfig/tests/compizconfig_ccs_list_wrapper.cpp (+12/-17) compizconfig/tests/compizconfig_ccs_list_wrapper.h (+4/-5) plugins/composite/src/pixmapbinding/tests/CMakeLists.txt (+0/-12) plugins/grid/src/grabhandler/tests/CMakeLists.txt (+0/-12) plugins/opengl/src/doublebuffer/tests/CMakeLists.txt (+0/-12) plugins/opengl/src/glxtfpbind/tests/CMakeLists.txt (+0/-12) plugins/resize/src/logic/tests/CMakeLists.txt (+0/-12) plugins/wall/src/offset_movement/tests/CMakeLists.txt (+0/-12) src/region/tests/test-region.cpp (+2/-4) |
To merge this branch: | bzr merge lp:~compiz-team/compiz/new-gmock |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Brandon Schaefer (community) | Approve | ||
Review via email: mp+174981@code.launchpad.net |
Commit message
Port to new gmock. Disable some faling tests because of weird leaks.
Description of the change
Port to new gmock. Disable some faling tests because of weird leaks.
PS Jenkins bot (ps-jenkins) wrote : | # |
Francis Ginther (fginther) wrote : | # |
The gles test appears to have hit this error:
CMake Error at cmake/FindGoogl
add_subdirectory given source "/usr/src/gmock" which is not an existing
directory.
Call Stack (most recent call first):
CMakeLists.
Sam Spilsbury (smspillaz) wrote : | # |
Heya, thanks for doing this. The exact CMake implementation strikes me as a bit odd, so I'll leave some comments. If they're nontrivial then don't worry about them - I'll fix them later as the autolander is blocked.
1. The organisation of the Find* and GoogleTest* stuff is a bit strange:
7 # Google Test and Xorg-GTest
8 -include (GoogleTest)
...
60 +add_subdirecto
61 +
62 +include_
Generally speaking, GoogleTest.cmake was added so that we could encapsulate away the code that actually builds gtest/gmock from the code that finds it. Putting code that has side effects (eg, adding a subdirectory) in a Find* is considered bad practice in CMake. If it is easier to have everything in one file, then FindGoogleTest.
This is the only one that needs to be discussed, the rest are trivial and I'll propose a branch to fix them:
----
2. Hardcoded paths
56 +set (GMOCK_INCLUDE_DIR "/usr/include/
57 +set (GMOCK_SOURCE_DIR "/usr/src/gmock" CACHE PATH "gmock source directory")
58 +set (GTEST_INCLUDE_DIR "${GMOCK_
Hardcoding the paths here is a bit inflexible - I'd suggest using find_path in order to find the gmock headers and then working from there. An example of this can be found here: (https:/
3. Odd indent
150 + std::string testName = jt->substr(0, jt->find("#"));
151 +
I'm sure that was unintentional :)
4. Repeated setting of GMOCK_LIBRARY and GMOCK_MAIN_LIBRARY
198 -find_library (GMOCK_LIBRARY gmock)
199 -find_library (GMOCK_MAIN_LIBRARY gmock_main)
200 +set (GMOCK_LIBRARY gmock)
201 +set (GMOCK_MAIN_LIBRARY gmock_main)
Setting GMOCK_LIBRARY and GMOCK_MAIN_LIBRARY in GoogleTest.cmake as CACHE STRING "" FORCE should help remove a lot of that duplication.
5. Disabled tests
171 - compiz_
172 + #compiz_
173
183 -compiz_
184 +#compiz_
185 compiz_
186 compiz_
187 compiz_
188 -compiz_
189 +#compiz_
I've figured out a way to make these not leak. Basically, this code falls into the undefined-
Sam Spilsbury (smspillaz) wrote : | # |
- 3763. By Andrea Azzarone
-
Merge Sam's branch.
Brandon Schaefer (brandontschaefer) wrote : | # |
LGTM :)
Yay:
100% tests passed, 0 tests failed out of 1474
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3763
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Sam Spilsbury (smspillaz) wrote : | # |
Francis: the gles-ci job is failing because it is on raring and google-mock does not ship with sources on raring.
My opinion is that we should just kill it - the armhf job builds with BUILD_GLES anyways.
Francis Ginther (fginther) wrote : | # |
> Francis: the gles-ci job is failing because it is on raring and google-mock
> does not ship with sources on raring.
>
> My opinion is that we should just kill it - the armhf job builds with
> BUILD_GLES anyways.
Agreed, I'll remove this build until someone determines it's needed. I'll also re-enable autolanding.
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2013-05-12 08:20:10 +0000 |
3 | +++ CMakeLists.txt 2013-07-17 22:02:28 +0000 |
4 | @@ -23,7 +23,6 @@ |
5 | include (CompizGSettings) |
6 | |
7 | # Google Test and Xorg-GTest |
8 | -include (GoogleTest) |
9 | include (XorgGTest) |
10 | |
11 | include (cmake/base.cmake) |
12 | @@ -157,12 +156,10 @@ |
13 | |
14 | if (COMPIZ_BUILD_TESTING) |
15 | |
16 | - find_package (GoogleTest) |
17 | + include (GoogleTest) |
18 | |
19 | if (GOOGLE_TEST_AND_MOCK_FOUND) |
20 | |
21 | - build_google_test_locally (${CMAKE_BINARY_DIR}/__gtest) |
22 | - |
23 | if (BUILD_XORG_GTEST) |
24 | |
25 | find_package (XorgGTest) |
26 | |
27 | === renamed file 'cmake/FindGoogleTest.cmake' => 'cmake/GoogleTest.cmake' |
28 | --- cmake/FindGoogleTest.cmake 2013-04-25 05:08:25 +0000 |
29 | +++ cmake/GoogleTest.cmake 2013-07-17 22:02:28 +0000 |
30 | @@ -1,50 +1,58 @@ |
31 | -# Find Google Test and Google Mock, either with pkg-config or by |
32 | -# searching the system install paths. This sets: |
33 | -# |
34 | -# GOOGLE_TEST_AND_MOCK_FOUND |
35 | -# GTEST_INCLUDE_DIR |
36 | -# GTEST_ROOT_DIR |
37 | -# GMOCK_LIBRARY |
38 | -# GMOCK_MAIN_LIBRARY |
39 | - |
40 | -find_package (GTest) |
41 | find_package (Threads REQUIRED) |
42 | |
43 | -if (NOT GTEST_FOUND) |
44 | - |
45 | - # Check for google test and build it locally |
46 | - set (GTEST_ROOT_DIR |
47 | - "/usr/src/gtest" # Default value, adjustable by user with e.g., ccmake |
48 | - CACHE |
49 | - PATH |
50 | - "Path to Google Test srcs" |
51 | - FORCE) |
52 | - |
53 | - find_path (GTEST_INCLUDE_DIR gtest/gtest.h) |
54 | - |
55 | - set (GTEST_BOTH_LIBRARIES gtest gtest_main ${CMAKE_THREAD_LIBS_INIT}) |
56 | +# Find the the Google Mock include directory |
57 | +# by searching the system-wide include directory |
58 | +# paths |
59 | +find_path (GMOCK_INCLUDE_DIR |
60 | + gmock/gmock.h) |
61 | + |
62 | +if (GMOCK_INCLUDE_DIR) |
63 | + set (GMOCK_INCLUDE_BASE "include/") |
64 | + string (LENGTH ${GMOCK_INCLUDE_BASE} GMOCK_INCLUDE_BASE_LENGTH) |
65 | + string (LENGTH ${GMOCK_INCLUDE_DIR} GMOCK_INCLUDE_DIR_LENGTH) |
66 | + |
67 | + math (EXPR |
68 | + GMOCK_INCLUDE_PREFIX_LENGTH |
69 | + "${GMOCK_INCLUDE_DIR_LENGTH} - ${GMOCK_INCLUDE_BASE_LENGTH}") |
70 | + string (SUBSTRING |
71 | + ${GMOCK_INCLUDE_DIR} |
72 | + 0 |
73 | + ${GMOCK_INCLUDE_PREFIX_LENGTH} |
74 | + GMOCK_INCLUDE_PREFIX) |
75 | + |
76 | + set (GMOCK_SRC_DIR ${GMOCK_INCLUDE_PREFIX}/src/gmock CACHE PATH "Path to Google Mock Sources") |
77 | + set (GMOCK_INCLUDE_DIR ${GMOCK_INCLUDE_DIR} CACHE PATH "Path to Google Mock Headers") |
78 | + set (GTEST_INCLUDE_DIR ${GMOCK_SRC_DIR}/gtest/include CACHE PATH "Path to Google Test Headers") |
79 | + |
80 | + set (GMOCK_LIBRARY "gmock" CACHE STRING "Name of the Google Mock library") |
81 | + set (GMOCK_MAIN_LIBRARY "gmock_main" CACHE STIRNG "Name of the Google Mock main () library") |
82 | + set (GTEST_BOTH_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} gtest gtest_main) |
83 | + |
84 | +endif (GMOCK_INCLUDE_DIR) |
85 | + |
86 | +if (NOT GTEST_BOTH_LIBRARIES) |
87 | + |
88 | + set (GTEST_FOUND FALSE) |
89 | + |
90 | +else (NOT GTEST_BOTH_LIBRARIES) |
91 | + |
92 | set (GTEST_FOUND TRUE) |
93 | - set (GTEST_LOCAL_BUILD_REQUIRED TRUE) |
94 | - |
95 | -else (NOT GTEST_FOUND) |
96 | - |
97 | - set (GTEST_LOCAL_BUILD_REQUIRED FALSE) |
98 | - |
99 | - # We found gtest. Append CMAKE_THREAD_LIBS_INIT to the provided libraries. |
100 | - set (GTEST_BOTH_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) |
101 | - |
102 | -endif (NOT GTEST_FOUND) |
103 | - |
104 | -find_library (GMOCK_LIBRARY gmock) |
105 | -find_library (GMOCK_MAIN_LIBRARY gmock_main) |
106 | + |
107 | +endif (NOT GTEST_BOTH_LIBRARIES) |
108 | |
109 | if (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
110 | |
111 | message ("Google Mock and Google Test not found - cannot build tests!") |
112 | - set (GOOGLE_TEST_AND_MOCK_FOUND OFF CACHE BOOL "" FORCE) |
113 | + set (GOOGLE_TEST_AND_MOCK_FOUND FALSE) |
114 | |
115 | else (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
116 | |
117 | - set (GOOGLE_TEST_AND_MOCK_FOUND ON CACHE BOOL "" FORCE) |
118 | + set (GOOGLE_TEST_AND_MOCK_FOUND TRUE) |
119 | + |
120 | + add_definitions(-DGTEST_USE_OWN_TR1_TUPLE=0) |
121 | + add_subdirectory (${GMOCK_SRC_DIR} ${CMAKE_BINARY_DIR}/__gmock) |
122 | + include_directories (${GMOCK_INCLUDE_DIR} |
123 | + ${GTEST_INCLUDE_DIR}) |
124 | + |
125 | |
126 | endif (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
127 | |
128 | === removed file 'cmake/GoogleTest.cmake' |
129 | --- cmake/GoogleTest.cmake 2013-02-12 04:30:52 +0000 |
130 | +++ cmake/GoogleTest.cmake 1970-01-01 00:00:00 +0000 |
131 | @@ -1,20 +0,0 @@ |
132 | -# GoogleTest.cmake |
133 | -# build_google_test_locally (dir) takes a subdirectory |
134 | -# and builds Google Test in there locally if required |
135 | - |
136 | -function (build_google_test_locally build_directory) |
137 | - |
138 | - if (GOOGLE_TEST_AND_MOCK_FOUND) |
139 | - |
140 | - if (GTEST_LOCAL_BUILD_REQUIRED) |
141 | - |
142 | - add_subdirectory (${GTEST_ROOT_DIR} |
143 | - ${build_directory}) |
144 | - |
145 | - endif (GTEST_LOCAL_BUILD_REQUIRED) |
146 | - |
147 | - include_directories (${GTEST_INCLUDE_DIRS}) |
148 | - |
149 | - endif (GOOGLE_TEST_AND_MOCK_FOUND) |
150 | - |
151 | -endfunction () |
152 | |
153 | === modified file 'cmake/src/compiz/compiz_discover_gtest_tests.cpp' |
154 | --- cmake/src/compiz/compiz_discover_gtest_tests.cpp 2013-02-15 14:45:25 +0000 |
155 | +++ cmake/src/compiz/compiz_discover_gtest_tests.cpp 2013-07-17 22:02:28 +0000 |
156 | @@ -13,7 +13,7 @@ |
157 | |
158 | int usage () |
159 | { |
160 | - cout << "Usage: PATH_TO_TEST_BINARY --gtest_list_tests | ./build_test_cases PATH_TO_TEST_BINARY --wrapper PATH_TO_WRAPPER"; |
161 | + cout << "Usage: PATH_TO_TEST_BINARY --gtest_list_tests | ./build_test_cases PATH_TO_TEST_BINARY --wrapper PATH_TO_WRAPPER" << endl; |
162 | return 1; |
163 | } |
164 | |
165 | @@ -75,12 +75,14 @@ |
166 | gTestFilter << " \"--gtest_filter="; |
167 | endParen << "\")"; |
168 | |
169 | + std::string testName = jt->substr(0, jt->find("#")); |
170 | + |
171 | testfilecmake << |
172 | addTest.str () << |
173 | - *jt << |
174 | + testName << |
175 | testExec.str () << |
176 | gTestFilter.str () << |
177 | - *jt << |
178 | + testName << |
179 | endParen.str () << |
180 | endl; |
181 | } |
182 | |
183 | === modified file 'compizconfig/libcompizconfig/tests/compizconfig_test_ccs_mock_backend_conformance.cpp' |
184 | --- compizconfig/libcompizconfig/tests/compizconfig_test_ccs_mock_backend_conformance.cpp 2012-11-24 10:01:33 +0000 |
185 | +++ compizconfig/libcompizconfig/tests/compizconfig_test_ccs_mock_backend_conformance.cpp 2013-07-17 22:02:28 +0000 |
186 | @@ -701,11 +701,10 @@ |
187 | case TypeList: |
188 | ccsSetList (setting, |
189 | cci::SettingValueListWrapper (ReadListAtKey (plugin, key, setting), |
190 | - cci::Deep, |
191 | - ccsSettingGetInfo (setting)->forList.listType, |
192 | - boost::shared_ptr <CCSSettingInfo> (), |
193 | - boost::shared_ptr <CCSSetting> (setting, |
194 | - boost::bind (doNothingWithCCSSetting, _1))), |
195 | + cci::Deep, |
196 | + ccsSettingGetInfo (setting)->forList.listType, |
197 | + boost::shared_ptr <CCSSetting> (setting, |
198 | + boost::bind (doNothingWithCCSSetting, _1))), |
199 | FALSE); |
200 | break; |
201 | |
202 | @@ -799,11 +798,13 @@ |
203 | ccsGetList (setting, &vList); |
204 | listCopy = ccsCopyList (vList, setting); |
205 | |
206 | - WriteListAtKey (plugin, key, VariantTypes (boost::make_shared <cci::SettingValueListWrapper> (listCopy, |
207 | - cci::Deep, |
208 | - ccsSettingGetInfo (setting)->forList.listType, |
209 | - boost::shared_ptr <CCSSettingInfo> (), |
210 | - boost::shared_ptr <CCSSetting> (setting, boost::bind (doNothingWithCCSSetting, _1))))); |
211 | + WriteListAtKey (plugin, |
212 | + key, |
213 | + VariantTypes (boost::make_shared <cci::SettingValueListWrapper> (listCopy, |
214 | + cci::Deep, |
215 | + ccsSettingGetInfo (setting)->forList.listType, |
216 | + boost::shared_ptr <CCSSetting> (setting, |
217 | + boost::bind (doNothingWithCCSSetting, _1))))); |
218 | break; |
219 | } |
220 | default: |
221 | |
222 | === modified file 'compizconfig/libcompizconfig/tests/compizconfig_test_ccs_object.cpp' |
223 | --- compizconfig/libcompizconfig/tests/compizconfig_test_ccs_object.cpp 2012-11-05 06:57:05 +0000 |
224 | +++ compizconfig/libcompizconfig/tests/compizconfig_test_ccs_object.cpp 2013-07-17 22:02:28 +0000 |
225 | @@ -13,6 +13,8 @@ |
226 | using ::testing::StrictMock; |
227 | using ::testing::Invoke; |
228 | |
229 | +class GoogleMockDummy; |
230 | + |
231 | class CCSObjectTest : |
232 | public ::testing::Test |
233 | { |
234 | @@ -23,7 +25,7 @@ |
235 | CCSObject object; |
236 | }; |
237 | |
238 | -typedef void (*dummyFunc) (void); |
239 | +typedef void (*dummyFunc) (GoogleMockDummy *); |
240 | |
241 | struct DummyInterface |
242 | { |
243 | @@ -54,11 +56,14 @@ |
244 | MOCK_METHOD1 (freeTestingObjectWrapper, void (TestingObjectWrapper *)); |
245 | public: |
246 | |
247 | - static void thunkDummyFunc () { return _mockDummy.dummyFunc (); } |
248 | - static GoogleMockDummy _mockDummy; |
249 | + static void thunkDummyFunc (GoogleMockDummy *mock); |
250 | }; |
251 | |
252 | -GoogleMockDummy GoogleMockDummy::_mockDummy; |
253 | +void |
254 | +GoogleMockDummy::thunkDummyFunc (GoogleMockDummy *mock) |
255 | +{ |
256 | + mock->dummyFunc (); |
257 | +} |
258 | |
259 | const struct DummyInterface SomeDummyInterface = |
260 | { |
261 | @@ -163,10 +168,11 @@ |
262 | EXPECT_EQ (*((CCSObject *) to)->interface_types, 1); |
263 | |
264 | const DummyInterface *myDummyInterface = (const DummyInterface *) ccsObjectGetInterface (to, 1); |
265 | - |
266 | - EXPECT_CALL (GoogleMockDummy::_mockDummy, dummyFunc ()); |
267 | - |
268 | - (*myDummyInterface->dummy) (); |
269 | + GoogleMockDummy mockDummy; |
270 | + |
271 | + EXPECT_CALL (mockDummy, dummyFunc ()); |
272 | + |
273 | + (*myDummyInterface->dummy) (&mockDummy); |
274 | |
275 | ccsObjectRemoveInterface (to, 1); |
276 | |
277 | @@ -196,7 +202,9 @@ |
278 | |
279 | void ccsFreeTestingObjectWrapper (TestingObjectWrapper *wrapper) |
280 | { |
281 | - GoogleMockDummy::_mockDummy.freeTestingObjectWrapper (wrapper); |
282 | + GoogleMockDummy *dummy = |
283 | + reinterpret_cast <GoogleMockDummy *> (reinterpret_cast <CCSObject *> (ccsObjectGetPrivate (wrapper))); |
284 | + dummy->freeTestingObjectWrapper (wrapper); |
285 | } |
286 | |
287 | #define CCSREF_OBJ(type,dtype) \ |
288 | @@ -217,10 +225,13 @@ |
289 | { |
290 | TestingObjectWrapper *to = (TestingObjectWrapper *) calloc (1, sizeof (TestingObjectWrapper)); |
291 | |
292 | + GoogleMockDummy dummy; |
293 | + |
294 | ccsObjectInit (to, &ccsDefaultObjectAllocator); |
295 | + ccsObjectSetPrivate (to, reinterpret_cast <CCSPrivate *> (&dummy)); |
296 | ccsTestingObjectWrapperRef (to); |
297 | |
298 | - EXPECT_CALL (GoogleMockDummy::_mockDummy, freeTestingObjectWrapper (to)); |
299 | + EXPECT_CALL (dummy, freeTestingObjectWrapper (to)); |
300 | |
301 | ccsTestingObjectWrapperUnref (to); |
302 | |
303 | |
304 | === modified file 'compizconfig/libcompizconfig/tests/compizconfig_test_ccs_setting.cpp' |
305 | --- compizconfig/libcompizconfig/tests/compizconfig_test_ccs_setting.cpp 2013-02-13 01:40:35 +0000 |
306 | +++ compizconfig/libcompizconfig/tests/compizconfig_test_ccs_setting.cpp 2013-07-17 22:02:28 +0000 |
307 | @@ -766,7 +766,6 @@ |
308 | mWrapper.reset (new cci::SettingValueListWrapper (NULL, |
309 | cci::Deep, |
310 | type, |
311 | - info, |
312 | setting)); |
313 | mWrapper->append (value); |
314 | } |
315 | @@ -799,7 +798,6 @@ |
316 | mWrapper.reset (new cci::SettingValueListWrapper (ccsCopyList (mRawValueList, setting.get ()), |
317 | cci::Deep, |
318 | type, |
319 | - info, |
320 | setting)); |
321 | } |
322 | |
323 | |
324 | === modified file 'compizconfig/mocks/libcompizconfig/CMakeLists.txt' |
325 | --- compizconfig/mocks/libcompizconfig/CMakeLists.txt 2013-05-13 13:50:31 +0000 |
326 | +++ compizconfig/mocks/libcompizconfig/CMakeLists.txt 2013-07-17 22:02:28 +0000 |
327 | @@ -19,6 +19,9 @@ |
328 | add_library (compizconfig_ccs_setting_mock |
329 | ${CMAKE_CURRENT_SOURCE_DIR}/compizconfig_ccs_setting_mock.cpp) |
330 | |
331 | +add_library (compizconfig_ccs_setting_stub |
332 | + ${CMAKE_CURRENT_SOURCE_DIR}/compizconfig_ccs_setting_stub.cpp) |
333 | + |
334 | add_library (compizconfig_ccs_backend_mock |
335 | ${CMAKE_CURRENT_SOURCE_DIR}/compizconfig_ccs_backend_mock.cpp) |
336 | |
337 | @@ -64,6 +67,13 @@ |
338 | ${LIBCOMPIZCONFIG_LIBRARIES} |
339 | compizconfig) |
340 | |
341 | +target_link_libraries (compizconfig_ccs_setting_stub |
342 | + ${GTEST_BOTH_LIBRARIES} |
343 | + ${GMOCK_LIBRARY} |
344 | + ${GMOCK_MAIN_LIBRARY} |
345 | + ${LIBCOMPIZCONFIG_LIBRARIES} |
346 | + compizconfig) |
347 | + |
348 | target_link_libraries (compizconfig_ccs_backend_mock |
349 | ${GTEST_BOTH_LIBRARIES} |
350 | ${GMOCK_LIBRARY} |
351 | |
352 | === added file 'compizconfig/mocks/libcompizconfig/compizconfig_ccs_setting_stub.cpp' |
353 | --- compizconfig/mocks/libcompizconfig/compizconfig_ccs_setting_stub.cpp 1970-01-01 00:00:00 +0000 |
354 | +++ compizconfig/mocks/libcompizconfig/compizconfig_ccs_setting_stub.cpp 2013-07-17 22:02:28 +0000 |
355 | @@ -0,0 +1,425 @@ |
356 | +/* |
357 | + * Compiz configuration system library |
358 | + * |
359 | + * Copyright (C) 2013 Sam Spilsbury <smspillaz@gmail.com>. |
360 | + * |
361 | + * This library is free software; you can redistribute it and/or |
362 | + * modify it under the terms of the GNU Lesser General Public |
363 | + * License as published by the Free Software Foundation; either |
364 | + * version 2.1 of the License, or (at your option) any later version. |
365 | + |
366 | + * This library is distributed in the hope that it will be useful, |
367 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
368 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
369 | + * Lesser General Public License for more details. |
370 | + |
371 | + * You should have received a copy of the GNU Lesser General Public |
372 | + * License along with this library; if not, write to the Free Software |
373 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
374 | + * |
375 | + * Authored By: |
376 | + * Sam Spilsbury <smspillaz@gmail.com> |
377 | + */ |
378 | + |
379 | +#include <gtest/gtest.h> |
380 | +#include <gmock/gmock.h> |
381 | + |
382 | +#include <ccs.h> |
383 | + |
384 | +#include "compizconfig_ccs_setting_stub.h" |
385 | + |
386 | +typedef struct _Private |
387 | +{ |
388 | + Bool integrated; |
389 | + Bool readOnly; |
390 | + const char *name; |
391 | + const char *shortDesc; |
392 | + const char *longDesc; |
393 | + const char *hints; |
394 | + const char *group; |
395 | + const char *subGroup; |
396 | + CCSSettingType type; |
397 | + CCSPlugin *parent; |
398 | + CCSSettingValue *value; |
399 | + CCSSettingValue *defaultValue; |
400 | + CCSSettingInfo info; |
401 | +} Private; |
402 | + |
403 | +static Bool ccsStubSettingGetInt (CCSSetting *setting, |
404 | + int *data) |
405 | +{ |
406 | + *data = ((Private *) ccsObjectGetPrivate (setting))->value->value.asInt; |
407 | + return TRUE; |
408 | +} |
409 | + |
410 | +static Bool ccsStubSettingGetFloat (CCSSetting *setting, |
411 | + float *data) |
412 | +{ |
413 | + *data = ((Private *) ccsObjectGetPrivate (setting))->value->value.asFloat; |
414 | + return TRUE; |
415 | +} |
416 | + |
417 | +static Bool ccsStubSettingGetBool (CCSSetting *setting, |
418 | + Bool *data) |
419 | +{ |
420 | + *data = ((Private *) ccsObjectGetPrivate (setting))->value->value.asBool; |
421 | + return TRUE; |
422 | +} |
423 | + |
424 | +static Bool ccsStubSettingGetString (CCSSetting *setting, |
425 | + const char **data) |
426 | +{ |
427 | + *data = ((Private *) ccsObjectGetPrivate (setting))->value->value.asString; |
428 | + return TRUE; |
429 | +} |
430 | + |
431 | +static Bool ccsStubSettingGetColor (CCSSetting *setting, |
432 | + CCSSettingColorValue *data) |
433 | +{ |
434 | + *data = ((Private *) ccsObjectGetPrivate (setting))->value->value.asColor; |
435 | + return TRUE; |
436 | +} |
437 | + |
438 | +static Bool ccsStubSettingGetMatch (CCSSetting *setting, |
439 | + const char **data) |
440 | +{ |
441 | + *data = ((Private *) ccsObjectGetPrivate (setting))->value->value.asMatch; |
442 | + return TRUE; |
443 | +} |
444 | + |
445 | +static Bool ccsStubSettingGetKey (CCSSetting *setting, |
446 | + CCSSettingKeyValue *data) |
447 | +{ |
448 | + *data = ((Private *) ccsObjectGetPrivate (setting))->value->value.asKey; |
449 | + return TRUE; |
450 | +} |
451 | + |
452 | +static Bool ccsStubSettingGetButton (CCSSetting *setting, |
453 | + CCSSettingButtonValue *data) |
454 | +{ |
455 | + *data = ((Private *) ccsObjectGetPrivate (setting))->value->value.asButton; |
456 | + return TRUE; |
457 | +} |
458 | + |
459 | +static Bool ccsStubSettingGetEdge (CCSSetting *setting, |
460 | + unsigned int *data) |
461 | +{ |
462 | + *data = ((Private *) ccsObjectGetPrivate (setting))->value->value.asEdge; |
463 | + return TRUE; |
464 | +} |
465 | + |
466 | +static Bool ccsStubSettingGetBell (CCSSetting *setting, |
467 | + Bool *data) |
468 | +{ |
469 | + *data = ((Private *) ccsObjectGetPrivate (setting))->value->value.asBell; |
470 | + return TRUE; |
471 | +} |
472 | + |
473 | +static Bool ccsStubSettingGetList (CCSSetting *setting, |
474 | + CCSSettingValueList *data) |
475 | +{ |
476 | + *data = ((Private *) ccsObjectGetPrivate (setting))->value->value.asList; |
477 | + return TRUE; |
478 | +} |
479 | + |
480 | +static CCSSetStatus ccsStubSettingSetInt (CCSSetting *setting, |
481 | + int data, |
482 | + Bool processChanged) |
483 | +{ |
484 | + ((Private *) ccsObjectGetPrivate (setting))->value->value.asInt = data; |
485 | + return SetToNewValue; |
486 | +} |
487 | + |
488 | +static CCSSetStatus ccsStubSettingSetFloat (CCSSetting *setting, |
489 | + float data, |
490 | + Bool processChanged) |
491 | +{ |
492 | + ((Private *) ccsObjectGetPrivate (setting))->value->value.asFloat = data; |
493 | + return SetToNewValue; |
494 | +} |
495 | + |
496 | +static CCSSetStatus ccsStubSettingSetBool (CCSSetting *setting, |
497 | + Bool data, |
498 | + Bool processChanged) |
499 | +{ |
500 | + ((Private *) ccsObjectGetPrivate (setting))->value->value.asBool = data; |
501 | + return SetToNewValue; |
502 | +} |
503 | + |
504 | +static CCSSetStatus ccsStubSettingSetString (CCSSetting *setting, |
505 | + const char *data, |
506 | + Bool processChanged) |
507 | +{ |
508 | + ((Private *) ccsObjectGetPrivate (setting))->value->value.asString = (char *) data; |
509 | + return SetToNewValue; |
510 | +} |
511 | + |
512 | +static CCSSetStatus ccsStubSettingSetColor (CCSSetting *setting, |
513 | + CCSSettingColorValue data, |
514 | + Bool processChanged) |
515 | +{ |
516 | + ((Private *) ccsObjectGetPrivate (setting))->value->value.asColor = data; |
517 | + return SetToNewValue; |
518 | +} |
519 | + |
520 | +static CCSSetStatus ccsStubSettingSetMatch (CCSSetting *setting, |
521 | + const char *data, |
522 | + Bool processChanged) |
523 | +{ |
524 | + ((Private *) ccsObjectGetPrivate (setting))->value->value.asMatch = (char *) data; |
525 | + return SetToNewValue; |
526 | +} |
527 | + |
528 | +static CCSSetStatus ccsStubSettingSetKey (CCSSetting *setting, |
529 | + CCSSettingKeyValue data, |
530 | + Bool processChanged) |
531 | +{ |
532 | + ((Private *) ccsObjectGetPrivate (setting))->value->value.asKey = data; |
533 | + return SetToNewValue; |
534 | +} |
535 | + |
536 | +static CCSSetStatus ccsStubSettingSetButton (CCSSetting *setting, |
537 | + CCSSettingButtonValue data, |
538 | + Bool processChanged) |
539 | +{ |
540 | + ((Private *) ccsObjectGetPrivate (setting))->value->value.asButton = data; |
541 | + return SetToNewValue; |
542 | +} |
543 | + |
544 | +static CCSSetStatus ccsStubSettingSetEdge (CCSSetting *setting, |
545 | + unsigned int data, |
546 | + Bool processChanged) |
547 | +{ |
548 | + ((Private *) ccsObjectGetPrivate (setting))->value->value.asEdge = data; |
549 | + return SetToNewValue; |
550 | +} |
551 | + |
552 | +static CCSSetStatus ccsStubSettingSetBell (CCSSetting *setting, |
553 | + Bool data, |
554 | + Bool processChanged) |
555 | +{ |
556 | + ((Private *) ccsObjectGetPrivate (setting))->value->value.asBell = data; |
557 | + return SetToNewValue; |
558 | +} |
559 | + |
560 | +static CCSSetStatus ccsStubSettingSetList (CCSSetting *setting, |
561 | + CCSSettingValueList data, |
562 | + Bool processChanged) |
563 | +{ |
564 | + ((Private *) ccsObjectGetPrivate (setting))->value->value.asList = data; |
565 | + return SetToNewValue; |
566 | +} |
567 | + |
568 | +static CCSSetStatus ccsStubSettingSetValue (CCSSetting *setting, |
569 | + CCSSettingValue *data, |
570 | + Bool processChanged) |
571 | +{ |
572 | + Private *priv = (Private *) ccsObjectGetPrivate (setting); |
573 | + |
574 | + ccsCopyValueInto (data, |
575 | + priv->value, |
576 | + priv->type, |
577 | + &priv->info); |
578 | + return SetToNewValue; |
579 | +} |
580 | + |
581 | +static void ccsStubSettingResetToDefault (CCSSetting * setting, Bool processChanged) |
582 | +{ |
583 | +} |
584 | + |
585 | +static Bool ccsStubSettingIsIntegrated (CCSSetting *setting) |
586 | +{ |
587 | + return ((Private *) ccsObjectGetPrivate (setting))->integrated; |
588 | +} |
589 | + |
590 | +static Bool ccsStubSettingReadOnly (CCSSetting *setting) |
591 | +{ |
592 | + return ((Private *) ccsObjectGetPrivate (setting))->readOnly; |
593 | +} |
594 | + |
595 | +static const char * ccsStubSettingGetName (CCSSetting *setting) |
596 | +{ |
597 | + return ((Private *) ccsObjectGetPrivate (setting))->name; |
598 | +} |
599 | + |
600 | +static const char * ccsStubSettingGetShortDesc (CCSSetting *setting) |
601 | +{ |
602 | + return ((Private *) ccsObjectGetPrivate (setting))->shortDesc; |
603 | +} |
604 | + |
605 | +static const char * ccsStubSettingGetLongDesc (CCSSetting *setting) |
606 | +{ |
607 | + return ((Private *) ccsObjectGetPrivate (setting))->longDesc; |
608 | +} |
609 | + |
610 | +static CCSSettingType ccsStubSettingGetType (CCSSetting *setting) |
611 | +{ |
612 | + return ((Private *) ccsObjectGetPrivate (setting))->type; |
613 | +} |
614 | + |
615 | +static CCSSettingInfo * ccsStubSettingGetInfo (CCSSetting *setting) |
616 | +{ |
617 | + return &((Private *) ccsObjectGetPrivate (setting))->info; |
618 | +} |
619 | + |
620 | +static const char * ccsStubSettingGetGroup (CCSSetting *setting) |
621 | +{ |
622 | + return ((Private *) ccsObjectGetPrivate (setting))->group; |
623 | +} |
624 | + |
625 | +static const char * ccsStubSettingGetSubGroup (CCSSetting *setting) |
626 | +{ |
627 | + return ((Private *) ccsObjectGetPrivate (setting))->subGroup; |
628 | +} |
629 | + |
630 | +static const char * ccsStubSettingGetHints (CCSSetting *setting) |
631 | +{ |
632 | + return ((Private *) ccsObjectGetPrivate (setting))->hints; |
633 | +} |
634 | + |
635 | +static CCSSettingValue * ccsStubSettingGetDefaultValue (CCSSetting *setting) |
636 | +{ |
637 | + return ((Private *) ccsObjectGetPrivate (setting))->defaultValue; |
638 | +} |
639 | + |
640 | +static CCSSettingValue * ccsStubSettingGetValue (CCSSetting *setting) |
641 | +{ |
642 | + return ((Private *) ccsObjectGetPrivate (setting))->value; |
643 | +} |
644 | + |
645 | +static Bool ccsStubSettingIsDefault (CCSSetting *setting) |
646 | +{ |
647 | + Private *priv = (Private *) ccsObjectGetPrivate (setting); |
648 | + |
649 | + return ccsCheckValueEq (priv->value, |
650 | + priv->type, |
651 | + &priv->info, |
652 | + priv->defaultValue, |
653 | + priv->type, |
654 | + &priv->info); |
655 | +} |
656 | + |
657 | +static CCSPlugin * ccsStubSettingGetParent (CCSSetting *setting) |
658 | +{ |
659 | + return ((Private *) ccsObjectGetPrivate (setting))->parent; |
660 | +} |
661 | + |
662 | +static void * ccsStubSettingGetPrivatePtr (CCSSetting *setting) |
663 | +{ |
664 | + return NULL; |
665 | +} |
666 | + |
667 | +static void ccsStubSettingSetPrivatePtr (CCSSetting *setting, void *ptr) |
668 | +{ |
669 | +} |
670 | + |
671 | +static Bool ccsStubSettingIsReadableByBackend (CCSSetting *setting) |
672 | +{ |
673 | + return TRUE; |
674 | +} |
675 | + |
676 | +static void ccsFreeSettingTypeStub (CCSSetting *setting) |
677 | +{ |
678 | + Private *priv = (Private *) ccsObjectGetPrivate (setting); |
679 | + |
680 | + ccsFreeSettingValueWithType (priv->value, priv->type); |
681 | + ccsFreeSettingValueWithType (priv->defaultValue, priv->type); |
682 | + ccsCleanupSettingInfo (&priv->info, priv->type); |
683 | + |
684 | + ccsObjectFinalize (setting); |
685 | + |
686 | + free (setting); |
687 | +} |
688 | + |
689 | +static const CCSSettingInterface ccsStubSettingInterface = |
690 | +{ |
691 | + ccsStubSettingGetName, |
692 | + ccsStubSettingGetShortDesc, |
693 | + ccsStubSettingGetLongDesc, |
694 | + ccsStubSettingGetType, |
695 | + ccsStubSettingGetInfo, |
696 | + ccsStubSettingGetGroup, |
697 | + ccsStubSettingGetSubGroup, |
698 | + ccsStubSettingGetHints, |
699 | + ccsStubSettingGetDefaultValue, |
700 | + ccsStubSettingGetValue, |
701 | + ccsStubSettingIsDefault, |
702 | + ccsStubSettingGetParent, |
703 | + ccsStubSettingGetPrivatePtr, |
704 | + ccsStubSettingSetPrivatePtr, |
705 | + ccsStubSettingSetInt, |
706 | + ccsStubSettingSetFloat, |
707 | + ccsStubSettingSetBool, |
708 | + ccsStubSettingSetString, |
709 | + ccsStubSettingSetColor, |
710 | + ccsStubSettingSetMatch, |
711 | + ccsStubSettingSetKey, |
712 | + ccsStubSettingSetButton, |
713 | + ccsStubSettingSetEdge, |
714 | + ccsStubSettingSetBell, |
715 | + ccsStubSettingSetList, |
716 | + ccsStubSettingSetValue, |
717 | + ccsStubSettingGetInt, |
718 | + ccsStubSettingGetFloat, |
719 | + ccsStubSettingGetBool, |
720 | + ccsStubSettingGetString, |
721 | + ccsStubSettingGetColor, |
722 | + ccsStubSettingGetMatch, |
723 | + ccsStubSettingGetKey, |
724 | + ccsStubSettingGetButton, |
725 | + ccsStubSettingGetEdge, |
726 | + ccsStubSettingGetBell, |
727 | + ccsStubSettingGetList, |
728 | + ccsStubSettingResetToDefault, |
729 | + ccsStubSettingIsIntegrated, |
730 | + ccsStubSettingReadOnly, |
731 | + ccsStubSettingIsReadableByBackend, |
732 | + ccsFreeSettingTypeStub |
733 | +}; |
734 | + |
735 | +CCSSetting * |
736 | +ccsSettingTypeStubNew (CCSSettingType type, |
737 | + Bool integrated, |
738 | + Bool readOnly, |
739 | + const char *name, |
740 | + const char *shortDesc, |
741 | + const char *longDesc, |
742 | + const char *hints, |
743 | + const char *group, |
744 | + const char *subGroup, |
745 | + CCSSettingValue *value, |
746 | + CCSSettingValue *defaultValue, |
747 | + CCSSettingInfo *info, |
748 | + CCSObjectAllocationInterface *ai) |
749 | +{ |
750 | + Private *priv = (Private *) calloc (1, sizeof (Private)); |
751 | + priv->integrated = integrated; |
752 | + priv->readOnly = readOnly; |
753 | + priv->name = name; |
754 | + priv->shortDesc = shortDesc; |
755 | + priv->longDesc = longDesc; |
756 | + priv->hints = hints; |
757 | + priv->group = group; |
758 | + priv->subGroup = subGroup; |
759 | + priv->type = type; |
760 | + |
761 | + priv->value = (CCSSettingValue *) calloc (1, sizeof (CCSSettingValue)); |
762 | + priv->defaultValue = (CCSSettingValue *) calloc (1, sizeof (CCSSettingValue)); |
763 | + |
764 | + if (value) |
765 | + ccsCopyValueInto (value, priv->value, priv->type, info); |
766 | + if (defaultValue) |
767 | + ccsCopyValueInto (defaultValue, priv->defaultValue, priv->type, info); |
768 | + if (info) |
769 | + ccsCopyInfo (info, &priv->info, priv->type); |
770 | + |
771 | + CCSSetting *setting = (CCSSetting *) calloc (1, sizeof (CCSSetting)); |
772 | + ccsObjectInit (setting, ai); |
773 | + ccsObjectSetPrivate (setting, (CCSPrivate *) priv); |
774 | + ccsObjectAddInterface (setting, |
775 | + (CCSInterface *) &ccsStubSettingInterface, |
776 | + GET_INTERFACE_TYPE (CCSSettingInterface)); |
777 | + ccsSettingRef (setting); |
778 | + |
779 | + return setting; |
780 | +} |
781 | |
782 | === added file 'compizconfig/mocks/libcompizconfig/compizconfig_ccs_setting_stub.h' |
783 | --- compizconfig/mocks/libcompizconfig/compizconfig_ccs_setting_stub.h 1970-01-01 00:00:00 +0000 |
784 | +++ compizconfig/mocks/libcompizconfig/compizconfig_ccs_setting_stub.h 2013-07-17 22:02:28 +0000 |
785 | @@ -0,0 +1,44 @@ |
786 | +/* |
787 | + * Compiz configuration system library |
788 | + * |
789 | + * Copyright (C) 2013 Sam Spilsbury <smspillaz@gmail.com>. |
790 | + * |
791 | + * This library is free software; you can redistribute it and/or |
792 | + * modify it under the terms of the GNU Lesser General Public |
793 | + * License as published by the Free Software Foundation; either |
794 | + * version 2.1 of the License, or (at your option) any later version. |
795 | + |
796 | + * This library is distributed in the hope that it will be useful, |
797 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
798 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
799 | + * Lesser General Public License for more details. |
800 | + |
801 | + * You should have received a copy of the GNU Lesser General Public |
802 | + * License along with this library; if not, write to the Free Software |
803 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
804 | + * |
805 | + * Authored By: |
806 | + * Sam Spilsbury <smspillaz@gmail.com> |
807 | + */ |
808 | + |
809 | +#ifndef _COMPIZCONFIG_CCS_SETTING_STUB |
810 | +#define _COMPIZCONFIG_CCS_SETTING_STUB |
811 | + |
812 | +#include <ccs.h> |
813 | + |
814 | +CCSSetting * |
815 | +ccsSettingTypeStubNew (CCSSettingType type, |
816 | + Bool integrated, |
817 | + Bool readOnly, |
818 | + const char *name, |
819 | + const char *shortDesc, |
820 | + const char *longDesc, |
821 | + const char *hints, |
822 | + const char *group, |
823 | + const char *subGroup, |
824 | + CCSSettingValue *value, |
825 | + CCSSettingValue *defaultValue, |
826 | + CCSSettingInfo *info, |
827 | + CCSObjectAllocationInterface *ai); |
828 | + |
829 | +#endif |
830 | |
831 | === modified file 'compizconfig/tests/CMakeLists.txt' |
832 | --- compizconfig/tests/CMakeLists.txt 2012-09-29 04:40:41 +0000 |
833 | +++ compizconfig/tests/CMakeLists.txt 2013-07-17 22:02:28 +0000 |
834 | @@ -69,4 +69,5 @@ |
835 | compizconfig_ccs_test_value_combinations |
836 | compizconfig_ccs_setting_value_operators |
837 | compizconfig_ccs_list_equality |
838 | - compizconfig_ccs_item_in_list_matcher) |
839 | + compizconfig_ccs_item_in_list_matcher |
840 | + compizconfig_ccs_setting_stub) |
841 | |
842 | === modified file 'compizconfig/tests/compizconfig_backend_concept_test.cpp' |
843 | --- compizconfig/tests/compizconfig_backend_concept_test.cpp 2012-09-17 15:39:11 +0000 |
844 | +++ compizconfig/tests/compizconfig_backend_concept_test.cpp 2013-07-17 22:02:28 +0000 |
845 | @@ -26,6 +26,7 @@ |
846 | #include <gtest_unspecified_bool_type_matcher.h> |
847 | |
848 | #include <compizconfig_ccs_setting_mock.h> |
849 | +#include <compizconfig_ccs_setting_stub.h> |
850 | |
851 | #include <boost/function.hpp> |
852 | #include <boost/bind.hpp> |
853 | @@ -56,19 +57,34 @@ |
854 | CCSSettingType type, |
855 | cci::ListStorageType storageType) |
856 | { |
857 | + CCSSettingInfo listInfo; |
858 | + |
859 | + listInfo.forList.listType = type; |
860 | + listInfo.forList.listInfo = |
861 | + (CCSSettingInfo *) calloc (1, sizeof (CCSSettingInfo)); |
862 | + |
863 | boost::function <void (CCSSetting *)> f (boost::bind (ccsSettingUnref, _1)); |
864 | - boost::shared_ptr <CCSSetting> mockSetting (ccsNiceMockSettingNew (), f); |
865 | - NiceMock <CCSSettingGMock> *gmockSetting = reinterpret_cast <NiceMock <CCSSettingGMock> *> (ccsObjectGetPrivate (mockSetting.get ())); |
866 | - |
867 | - ON_CALL (*gmockSetting, getType ()).WillByDefault (Return (TypeList)); |
868 | - |
869 | - boost::shared_ptr <CCSSettingInfo> listInfo (new CCSSettingInfo); |
870 | - |
871 | - listInfo->forList.listType = type; |
872 | - |
873 | - ON_CALL (*gmockSetting, getInfo ()).WillByDefault (Return (listInfo.get ())); |
874 | - ON_CALL (*gmockSetting, getDefaultValue ()).WillByDefault (ReturnNull ()); |
875 | - return boost::make_shared <cci::SettingValueListWrapper> (c (mockSetting.get ()), storageType, type, listInfo, mockSetting); |
876 | + boost::shared_ptr <CCSSetting> stubSetting (ccsSettingTypeStubNew (TypeList, |
877 | + TRUE, |
878 | + TRUE, |
879 | + NULL, |
880 | + NULL, |
881 | + NULL, |
882 | + NULL, |
883 | + NULL, |
884 | + NULL, |
885 | + NULL, |
886 | + NULL, |
887 | + &listInfo, |
888 | + &ccsDefaultObjectAllocator), |
889 | + f); |
890 | + |
891 | + ccsCleanupSettingInfo (&listInfo, TypeList); |
892 | + |
893 | + return boost::make_shared <cci::SettingValueListWrapper> (c (stubSetting.get ()), |
894 | + storageType, |
895 | + type, |
896 | + stubSetting); |
897 | } |
898 | |
899 | CCSSettingGMock * |
900 | @@ -287,10 +303,9 @@ |
901 | write (); |
902 | |
903 | EXPECT_THAT (cci::SettingValueListWrapper (env->ReadListAtKey (plugin, key, setting.get ()), |
904 | - cci::Deep, |
905 | - info->forList.listType, |
906 | - boost::shared_ptr <CCSSettingInfo> (), |
907 | - setting), |
908 | + cci::Deep, |
909 | + info->forList.listType, |
910 | + setting), |
911 | ListEqual (&info->forList, list)); |
912 | } |
913 | |
914 | |
915 | === modified file 'compizconfig/tests/compizconfig_ccs_list_wrapper.cpp' |
916 | --- compizconfig/tests/compizconfig_ccs_list_wrapper.cpp 2012-09-17 15:39:11 +0000 |
917 | +++ compizconfig/tests/compizconfig_ccs_list_wrapper.cpp 2013-07-17 22:02:28 +0000 |
918 | @@ -37,12 +37,10 @@ |
919 | public: |
920 | |
921 | PrivateSettingValueListWrapper (CCSSettingValueList list, |
922 | - cci::ListStorageType storageType, |
923 | - CCSSettingType type, |
924 | - const boost::shared_ptr <CCSSettingInfo> &listInfo, |
925 | - const boost::shared_ptr <CCSSetting> &settingReference) : |
926 | + cci::ListStorageType storageType, |
927 | + CCSSettingType type, |
928 | + const boost::shared_ptr <CCSSetting> &settingReference) : |
929 | mType (type), |
930 | - mListInfo (listInfo), |
931 | mSettingReference (settingReference), |
932 | mListWrapper (list, |
933 | ccsSettingValueListFree, |
934 | @@ -52,25 +50,22 @@ |
935 | { |
936 | } |
937 | |
938 | - CCSSettingType mType; |
939 | - boost::shared_ptr <CCSSettingInfo> mListInfo; |
940 | - boost::shared_ptr <CCSSetting> mSettingReference; |
941 | + CCSSettingType mType; |
942 | + boost::shared_ptr <CCSSetting> mSettingReference; |
943 | SettingValueListWrapper::InternalWrapperImpl mListWrapper; |
944 | }; |
945 | } |
946 | } |
947 | } |
948 | |
949 | -cci::SettingValueListWrapper::SettingValueListWrapper (CCSSettingValueList list, |
950 | - cci::ListStorageType storageType, |
951 | - CCSSettingType type, |
952 | - const boost::shared_ptr <CCSSettingInfo> &listInfo, |
953 | - const boost::shared_ptr <CCSSetting> &settingReference) : |
954 | +cci::SettingValueListWrapper::SettingValueListWrapper (CCSSettingValueList list, |
955 | + cci::ListStorageType storageType, |
956 | + CCSSettingType type, |
957 | + const boost::shared_ptr <CCSSetting> &settingReference) : |
958 | priv (new cci::PrivateSettingValueListWrapper (list, |
959 | - storageType, |
960 | - type, |
961 | - listInfo, |
962 | - settingReference)) |
963 | + storageType, |
964 | + type, |
965 | + settingReference)) |
966 | { |
967 | } |
968 | |
969 | |
970 | === modified file 'compizconfig/tests/compizconfig_ccs_list_wrapper.h' |
971 | --- compizconfig/tests/compizconfig_ccs_list_wrapper.h 2012-09-22 03:59:35 +0000 |
972 | +++ compizconfig/tests/compizconfig_ccs_list_wrapper.h 2013-07-17 22:02:28 +0000 |
973 | @@ -136,11 +136,10 @@ |
974 | typedef compiz::config::ListWrapper <CCSSettingValueList, CCSSettingValue *> InternalWrapper; |
975 | typedef compiz::config::impl::ListWrapper <CCSSettingValueList, CCSSettingValue *> InternalWrapperImpl; |
976 | |
977 | - SettingValueListWrapper (CCSSettingValueList list, |
978 | - ListStorageType storageType, |
979 | - CCSSettingType type, |
980 | - const boost::shared_ptr <CCSSettingInfo> &listInfo, |
981 | - const boost::shared_ptr <CCSSetting> &settingReference); |
982 | + SettingValueListWrapper (CCSSettingValueList list, |
983 | + ListStorageType storageType, |
984 | + CCSSettingType type, |
985 | + const boost::shared_ptr <CCSSetting> &settingReference); |
986 | |
987 | CCSSettingType type (); |
988 | |
989 | |
990 | === modified file 'plugins/composite/src/pixmapbinding/tests/CMakeLists.txt' |
991 | --- plugins/composite/src/pixmapbinding/tests/CMakeLists.txt 2013-04-22 14:30:55 +0000 |
992 | +++ plugins/composite/src/pixmapbinding/tests/CMakeLists.txt 2013-07-17 22:02:28 +0000 |
993 | @@ -1,15 +1,3 @@ |
994 | -find_library (GMOCK_LIBRARY gmock) |
995 | -find_library (GMOCK_MAIN_LIBRARY gmock_main) |
996 | - |
997 | -if (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
998 | - message ("Google Mock and Google Test not found - cannot build tests!") |
999 | - set (COMPIZ_BUILD_TESTING OFF) |
1000 | -endif (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
1001 | - |
1002 | -include_directories (${GTEST_INCLUDE_DIRS}) |
1003 | - |
1004 | -link_directories (${COMPIZ_LIBRARY_DIRS}) |
1005 | - |
1006 | add_executable (compiz_test_composite_pixmapbinding |
1007 | ${CMAKE_CURRENT_SOURCE_DIR}/test-composite-pixmapbinding.cpp) |
1008 | |
1009 | |
1010 | === modified file 'plugins/grid/src/grabhandler/tests/CMakeLists.txt' |
1011 | --- plugins/grid/src/grabhandler/tests/CMakeLists.txt 2013-05-08 16:56:18 +0000 |
1012 | +++ plugins/grid/src/grabhandler/tests/CMakeLists.txt 2013-07-17 22:02:28 +0000 |
1013 | @@ -1,15 +1,3 @@ |
1014 | -find_library (GMOCK_LIBRARY gmock) |
1015 | -find_library (GMOCK_MAIN_LIBRARY gmock_main) |
1016 | - |
1017 | -if (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
1018 | - message ("Google Mock and Google Test not found - cannot build tests!") |
1019 | - set (COMPIZ_BUILD_TESTING OFF) |
1020 | -endif (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
1021 | - |
1022 | -include_directories (${GTEST_INCLUDE_DIRS}) |
1023 | - |
1024 | -link_directories (${COMPIZ_LIBRARY_DIRS}) |
1025 | - |
1026 | add_executable (compiz_test_grid_grabhandler |
1027 | ${CMAKE_CURRENT_SOURCE_DIR}/test-grid-grab-handler.cpp) |
1028 | |
1029 | |
1030 | === modified file 'plugins/opengl/src/doublebuffer/tests/CMakeLists.txt' |
1031 | --- plugins/opengl/src/doublebuffer/tests/CMakeLists.txt 2013-04-22 14:30:55 +0000 |
1032 | +++ plugins/opengl/src/doublebuffer/tests/CMakeLists.txt 2013-07-17 22:02:28 +0000 |
1033 | @@ -1,15 +1,3 @@ |
1034 | -find_library (GMOCK_LIBRARY gmock) |
1035 | -find_library (GMOCK_MAIN_LIBRARY gmock_main) |
1036 | - |
1037 | -if (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
1038 | - message ("Google Mock and Google Test not found - cannot build tests!") |
1039 | - set (COMPIZ_BUILD_TESTING OFF) |
1040 | -endif (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
1041 | - |
1042 | -include_directories (${GTEST_INCLUDE_DIRS}) |
1043 | - |
1044 | -link_directories (${COMPIZ_LIBRARY_DIRS}) |
1045 | - |
1046 | add_executable (compiz_test_opengl_double_buffer |
1047 | ${CMAKE_CURRENT_SOURCE_DIR}/test-opengl-double-buffer.cpp) |
1048 | |
1049 | |
1050 | === modified file 'plugins/opengl/src/glxtfpbind/tests/CMakeLists.txt' |
1051 | --- plugins/opengl/src/glxtfpbind/tests/CMakeLists.txt 2013-04-22 14:30:55 +0000 |
1052 | +++ plugins/opengl/src/glxtfpbind/tests/CMakeLists.txt 2013-07-17 22:02:28 +0000 |
1053 | @@ -1,15 +1,3 @@ |
1054 | -find_library (GMOCK_LIBRARY gmock) |
1055 | -find_library (GMOCK_MAIN_LIBRARY gmock_main) |
1056 | - |
1057 | -if (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
1058 | - message ("Google Mock and Google Test not found - cannot build tests!") |
1059 | - set (COMPIZ_BUILD_TESTING OFF) |
1060 | -endif (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
1061 | - |
1062 | -include_directories (${GTEST_INCLUDE_DIRS}) |
1063 | - |
1064 | -link_directories (${COMPIZ_LIBRARY_DIRS}) |
1065 | - |
1066 | add_executable (compiz_test_opengl_glx_tfp_bind |
1067 | ${CMAKE_CURRENT_SOURCE_DIR}/test-opengl-glx-tfp-bind.cpp) |
1068 | |
1069 | |
1070 | === modified file 'plugins/resize/src/logic/tests/CMakeLists.txt' |
1071 | --- plugins/resize/src/logic/tests/CMakeLists.txt 2013-04-22 14:30:55 +0000 |
1072 | +++ plugins/resize/src/logic/tests/CMakeLists.txt 2013-07-17 22:02:28 +0000 |
1073 | @@ -1,15 +1,3 @@ |
1074 | -find_library (GMOCK_LIBRARY gmock) |
1075 | -find_library (GMOCK_MAIN_LIBRARY gmock_main) |
1076 | - |
1077 | -if (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
1078 | - message ("Google Mock and Google Test not found - cannot build tests!") |
1079 | - set (COMPIZ_BUILD_TESTING OFF) |
1080 | -endif (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
1081 | - |
1082 | -include_directories (${GTEST_INCLUDE_DIRS}) |
1083 | - |
1084 | -link_directories (${COMPIZ_LIBRARY_DIRS}) |
1085 | - |
1086 | add_executable (compiz_test_resize_logic |
1087 | test-logic.cpp |
1088 | resize-options-mock.cpp |
1089 | |
1090 | === modified file 'plugins/wall/src/offset_movement/tests/CMakeLists.txt' |
1091 | --- plugins/wall/src/offset_movement/tests/CMakeLists.txt 2013-04-22 14:30:55 +0000 |
1092 | +++ plugins/wall/src/offset_movement/tests/CMakeLists.txt 2013-07-17 22:02:28 +0000 |
1093 | @@ -1,15 +1,3 @@ |
1094 | -find_library (GMOCK_LIBRARY gmock) |
1095 | -find_library (GMOCK_MAIN_LIBRARY gmock_main) |
1096 | - |
1097 | -if (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
1098 | - message ("Google Mock and Google Test not found - cannot build tests!") |
1099 | - set (COMPIZ_BUILD_TESTING OFF) |
1100 | -endif (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
1101 | - |
1102 | -include_directories (${GTEST_INCLUDE_DIRS}) |
1103 | - |
1104 | -link_directories (${COMPIZ_LIBRARY_DIRS}) |
1105 | - |
1106 | add_executable (compiz_test_wall_offset_movement |
1107 | ${CMAKE_CURRENT_SOURCE_DIR}/test-wall-offset-movement.cpp) |
1108 | |
1109 | |
1110 | === modified file 'src/region/tests/test-region.cpp' |
1111 | --- src/region/tests/test-region.cpp 2012-05-27 04:32:55 +0000 |
1112 | +++ src/region/tests/test-region.cpp 2013-07-17 22:02:28 +0000 |
1113 | @@ -8,9 +8,6 @@ |
1114 | |
1115 | #include <iostream> |
1116 | |
1117 | -namespace { // DEBUG stuff |
1118 | -} |
1119 | - |
1120 | namespace { |
1121 | |
1122 | int const x1(13); |
1123 | @@ -28,7 +25,6 @@ |
1124 | |
1125 | int const dx(3); |
1126 | int const dy(5); |
1127 | -} |
1128 | |
1129 | TEST(RegionTest, create_and_destroy) |
1130 | { |
1131 | @@ -567,3 +563,5 @@ |
1132 | ASSERT_EQ(*p, r1); |
1133 | delete p; |
1134 | } |
1135 | + |
1136 | +} |
FAILED: Continuous integration, rev:3762 jenkins. qa.ubuntu. com/job/ compiz- ci/262/ jenkins. qa.ubuntu. com/job/ compiz- gles-ci/ ./build= pbuilder, distribution= raring, flavor= amd64/303/ console jenkins. qa.ubuntu. com/job/ compiz- saucy-amd64- ci/75 jenkins. qa.ubuntu. com/job/ compiz- saucy-armhf- ci/75 jenkins. qa.ubuntu. com/job/ compiz- saucy-i386- ci/75
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ compiz- ci/262/ rebuild
http://