~ubuntu-branches/ubuntu/trusty/compiz/trusty

« back to all changes in this revision

Viewing changes to compizconfig/tests/compizconfig_backend_concept_test.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release
  • Date: 2013-08-22 06:58:07 UTC
  • mto: This revision was merged to the branch mainline in revision 3352.
  • Revision ID: package-import@ubuntu.com-20130822065807-17nlzez0d30y09so
Tags: upstream-0.9.10+13.10.20130822
ImportĀ upstreamĀ versionĀ 0.9.10+13.10.20130822

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <gtest_unspecified_bool_type_matcher.h>
27
27
 
28
28
#include <compizconfig_ccs_setting_mock.h>
 
29
#include <compizconfig_ccs_setting_stub.h>
29
30
 
30
31
#include <boost/function.hpp>
31
32
#include <boost/bind.hpp>
56
57
                                            CCSSettingType             type,
57
58
                                            cci::ListStorageType       storageType)
58
59
{
 
60
    CCSSettingInfo listInfo;
 
61
 
 
62
    listInfo.forList.listType = type;
 
63
    listInfo.forList.listInfo =
 
64
        (CCSSettingInfo *) calloc (1, sizeof (CCSSettingInfo));
 
65
 
59
66
    boost::function <void (CCSSetting *)> f (boost::bind (ccsSettingUnref, _1));
60
 
    boost::shared_ptr <CCSSetting> mockSetting (ccsNiceMockSettingNew (), f);
61
 
    NiceMock <CCSSettingGMock>     *gmockSetting = reinterpret_cast <NiceMock <CCSSettingGMock> *> (ccsObjectGetPrivate (mockSetting.get ()));
62
 
 
63
 
    ON_CALL (*gmockSetting, getType ()).WillByDefault (Return (TypeList));
64
 
 
65
 
    boost::shared_ptr <CCSSettingInfo> listInfo (new CCSSettingInfo);
66
 
 
67
 
    listInfo->forList.listType = type;
68
 
 
69
 
    ON_CALL (*gmockSetting, getInfo ()).WillByDefault (Return (listInfo.get ()));
70
 
    ON_CALL (*gmockSetting, getDefaultValue ()).WillByDefault (ReturnNull ());
71
 
    return boost::make_shared <cci::SettingValueListWrapper> (c (mockSetting.get ()), storageType, type, listInfo, mockSetting);
 
67
    boost::shared_ptr <CCSSetting> stubSetting (ccsSettingTypeStubNew (TypeList,
 
68
                                                                       TRUE,
 
69
                                                                       TRUE,
 
70
                                                                       NULL,
 
71
                                                                       NULL,
 
72
                                                                       NULL,
 
73
                                                                       NULL,
 
74
                                                                       NULL,
 
75
                                                                       NULL,
 
76
                                                                       NULL,
 
77
                                                                       NULL,
 
78
                                                                       &listInfo,
 
79
                                                                       &ccsDefaultObjectAllocator),
 
80
                                                f);
 
81
 
 
82
    ccsCleanupSettingInfo (&listInfo, TypeList);
 
83
 
 
84
    return boost::make_shared <cci::SettingValueListWrapper> (c (stubSetting.get ()),
 
85
                                                              storageType,
 
86
                                                              type,
 
87
                                                              stubSetting);
72
88
}
73
89
 
74
90
CCSSettingGMock *
287
303
    write ();
288
304
 
289
305
    EXPECT_THAT (cci::SettingValueListWrapper (env->ReadListAtKey (plugin, key, setting.get ()),
290
 
                                                  cci::Deep,
291
 
                                                  info->forList.listType,
292
 
                                                  boost::shared_ptr <CCSSettingInfo> (),
293
 
                                                  setting),
 
306
                                               cci::Deep,
 
307
                                               info->forList.listType,
 
308
                                               setting),
294
309
                 ListEqual (&info->forList, list));
295
310
}
296
311