Merge lp:~compiz-team/compiz/compiz.fix_1063617.9.1 into lp:compiz/0.9.9

Proposed by Sam Spilsbury
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: 3517
Merged at revision: 3610
Proposed branch: lp:~compiz-team/compiz/compiz.fix_1063617.9.1
Merge into: lp:compiz/0.9.9
Prerequisite: lp:~compiz-team/compiz/compiz.fix_1063617.8
Diff against target: 612 lines (+282/-79)
1 file modified
compizconfig/libcompizconfig/tests/compizconfig_test_ccs_setting.cpp (+282/-79)
To merge this branch: bzr merge lp:~compiz-team/compiz/compiz.fix_1063617.9.1
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+148003@code.launchpad.net

This proposal supersedes a proposal from 2013-02-12.

Commit message

Also allow the tests to run through ccsSetValue

Description of the change

Also allow the tests to run through ccsSetValue (increases coverage)

To post a comment you must log in.
Revision history for this message
MC Return (mc-return) wrote : Posted in a previous version of this proposal

Your commit message needs fixing here ^^

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
MC Return (mc-return) wrote :

There is a typo here:

246 + throw std::runtime_error ("called PerfomSet with unknown SetMethod");

it should probably read:

246 + throw std::runtime_error ("called performSet with unknown SetMethod");

3517. By Sam Spilsbury

Small typo fix

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Thanks, fixed.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'compizconfig/libcompizconfig/tests/compizconfig_test_ccs_setting.cpp'
--- compizconfig/libcompizconfig/tests/compizconfig_test_ccs_setting.cpp 2012-12-12 08:54:11 +0000
+++ compizconfig/libcompizconfig/tests/compizconfig_test_ccs_setting.cpp 2013-02-13 01:43:22 +0000
@@ -18,6 +18,8 @@
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19*/19*/
2020
21#include <tr1/tuple>
22
21#include <gtest/gtest.h>23#include <gtest/gtest.h>
22#include <gmock/gmock.h>24#include <gmock/gmock.h>
2325
@@ -45,6 +47,7 @@
45using ::testing::Invoke;47using ::testing::Invoke;
46using ::testing::ReturnNull;48using ::testing::ReturnNull;
47using ::testing::Values;49using ::testing::Values;
50using ::testing::Combine;
4851
49TEST(CCSSettingTest, TestMock)52TEST(CCSSettingTest, TestMock)
50{53{
@@ -497,7 +500,11 @@
497500
498 ReturnType operator () ()501 ReturnType operator () ()
499 {502 {
500 return strdup (Parent::mValue);503 /* Passing an illegal value is okay */
504 if (Parent::mValue)
505 return strdup (Parent::mValue);
506 else
507 return NULL;
501 }508 }
502509
503 private:510 private:
@@ -521,8 +528,11 @@
521528
522 ReturnType operator () ()529 ReturnType operator () ()
523 {530 {
524 return ccsCopyList (*Parent::mValue,531 if (Parent::mValue)
525 Parent::mValue->setting ().get ());532 return ccsCopyList (*Parent::mValue,
533 Parent::mValue->setting ().get ());
534 else
535 return NULL;
526 }536 }
527};537};
528538
@@ -732,7 +742,17 @@
732742
733 private:743 private:
734744
735 const cci::SettingValueListWrapper::Ptr &745 virtual const cci::SettingValueListWrapper::Ptr &
746 SetupWrapper (CCSSettingType type,
747 const CCSSettingInfoPtr &info) = 0;
748};
749
750class ListValueContainerFromChildValueBase :
751 public ListValueContainerBase
752{
753 private:
754
755 virtual const cci::SettingValueListWrapper::Ptr &
736 SetupWrapper (CCSSettingType type,756 SetupWrapper (CCSSettingType type,
737 const CCSSettingInfoPtr &info)757 const CCSSettingInfoPtr &info)
738 {758 {
@@ -757,13 +777,45 @@
757 virtual CCSSettingValue * GetValueForListWrapper () = 0;777 virtual CCSSettingValue * GetValueForListWrapper () = 0;
758};778};
759779
780class ListValueContainerFromList :
781 public ListValueContainerBase
782{
783 public:
784
785 ListValueContainerFromList (CCSSettingValueList rawValueList) :
786 mRawValueList (rawValueList)
787 {
788 }
789
790 private:
791
792 const cci::SettingValueListWrapper::Ptr &
793 SetupWrapper (CCSSettingType type,
794 const CCSSettingInfoPtr &info)
795 {
796 if (!mWrapper)
797 {
798 const CCSSettingPtr &setting (mContainedValueGenerator.GetSetting (type, info));
799 mWrapper.reset (new cci::SettingValueListWrapper (ccsCopyList (mRawValueList, setting.get ()),
800 cci::Deep,
801 type,
802 info,
803 setting));
804 }
805
806 return mWrapper;
807 }
808
809 CCSSettingValueList mRawValueList;
810};
811
760template <typename SettingValueType>812template <typename SettingValueType>
761class ListValueContainer :813class ChildValueListValueContainer :
762 public ListValueContainerBase814 public ListValueContainerFromChildValueBase
763{815{
764 public:816 public:
765817
766 ListValueContainer (const SettingValueType &value) :818 ChildValueListValueContainer (const SettingValueType &value) :
767 mRawChildValue (value)819 mRawChildValue (value)
768 {820 {
769 }821 }
@@ -782,8 +834,136 @@
782typename ValueContainer <CCSSettingValueList>::Ptr834typename ValueContainer <CCSSettingValueList>::Ptr
783ContainList (const SettingValueType &value)835ContainList (const SettingValueType &value)
784{836{
785 return boost::make_shared <ListValueContainer <SettingValueType> > (value);837 return boost::make_shared <ChildValueListValueContainer <SettingValueType> > (value);
786}838}
839
840typename ValueContainer <CCSSettingValueList>::Ptr
841ContainPrexistingList (const CCSSettingValueList &value)
842{
843 return boost::make_shared <ListValueContainerFromList> (value);
844}
845
846template <typename SettingValueType>
847struct SettingMutators
848{
849 typedef CCSSetStatus (*SetFunction) (CCSSetting *setting,
850 SettingValueType data,
851 Bool);
852 typedef Bool (*GetFunction) (CCSSetting *setting,
853 SettingValueType *);
854};
855
856typedef enum _SetMethod
857{
858 ThroughRaw,
859 ThroughValue
860} SetMethod;
861
862template <typename SettingValueType>
863CCSSetStatus performRawSet (const SettingValueType &rawValue,
864 const CCSSettingPtr &setting,
865 typename SettingMutators<SettingValueType>::SetFunction setFunction)
866{
867 return (*setFunction) (setting.get (), rawValue, FALSE);
868}
869
870template <typename SettingValueType>
871class RawValueContainmentPacker
872{
873 public:
874
875 RawValueContainmentPacker (const SettingValueType &value) :
876 mValue (value)
877 {
878 }
879
880 typename ValueContainer <SettingValueType>::Ptr
881 operator () ()
882 {
883 return ContainNormal (mValue);
884 }
885
886 private:
887
888 const SettingValueType &mValue;
889};
890
891template <>
892class RawValueContainmentPacker <CCSSettingValueList>
893{
894 public:
895
896 RawValueContainmentPacker (const CCSSettingValueList &value) :
897 mValue (value)
898 {
899 }
900
901 typename ValueContainer <CCSSettingValueList>::Ptr
902 operator () ()
903 {
904 return ContainPrexistingList (mValue);
905 }
906
907 private:
908
909 const CCSSettingValueList &mValue;
910};
911
912template <typename SettingValueType>
913typename ValueContainer <SettingValueType>::Ptr
914ContainRawValue (const SettingValueType &value)
915{
916 return RawValueContainmentPacker <SettingValueType> (value) ();
917}
918
919template <typename SettingValueType>
920CCSSetStatus performValueSet (const SettingValueType &rawValue,
921 const CCSSettingInfoPtr &info,
922 CCSSettingType type,
923 const CCSSettingPtr &setting)
924{
925 typename ValueContainer <SettingValueType>::Ptr container (ContainRawValue (rawValue));
926 const CCSSettingValuePtr &value (container->getContainedValue (type,
927 info));
928
929 return ccsSetValue (setting.get (), value.get (), FALSE);
930}
931
932template <typename SettingValueType>
933CCSSetStatus performSet (const SettingValueType &rawValue,
934 const CCSSettingPtr &setting,
935 const CCSSettingInfoPtr &info,
936 CCSSettingType type,
937 typename SettingMutators<SettingValueType>::SetFunction setFunction,
938 SetMethod method)
939{
940 /* XXX:
941 * This is really bad design because it effectively involves runtime
942 * switching on types. Unfortunately, there doesn't seem to be a better
943 * way to do this that's not hugely verbose - injecting the method
944 * as a class or a function would mean that we'd have to expose
945 * template parameters to areas where we can't do that because we
946 * want the tests to run once for ccsSetValue and once for
947 * ccsSet* . If we did that, we'd have to either write the tests
948 * twice, or write the INSTANTIATE_TEST_CASE_P sections twice and
949 * both are 200+ lines of copy-and-paste as opposed to this type-switch
950 * here
951 */
952 switch (method)
953 {
954 case ThroughRaw:
955 return performRawSet (rawValue, setting, setFunction);
956 break;
957 case ThroughValue:
958 return performValueSet (rawValue, info, type, setting);
959 break;
960 default:
961 throw std::runtime_error ("called perfomSet with unknown SetMethod");
962 }
963
964 throw std::runtime_error ("Unreachable");
965}
966
787967
788class SetParam968class SetParam
789{969{
@@ -798,10 +978,10 @@
798 virtual void TearDownSetting () = 0;978 virtual void TearDownSetting () = 0;
799 virtual CCSSettingType GetSettingType () = 0;979 virtual CCSSettingType GetSettingType () = 0;
800 virtual void SetUpParam (const CCSSettingPtr &) = 0;980 virtual void SetUpParam (const CCSSettingPtr &) = 0;
801 virtual CCSSetStatus setWithInvalidType () = 0;981 virtual CCSSetStatus setWithInvalidType (SetMethod) = 0;
802 virtual CCSSetStatus setToFailValue () = 0;982 virtual CCSSetStatus setToFailValue (SetMethod) = 0;
803 virtual CCSSetStatus setToNonDefaultValue () = 0;983 virtual CCSSetStatus setToNonDefaultValue (SetMethod) = 0;
804 virtual CCSSetStatus setToDefaultValue () = 0;984 virtual CCSSetStatus setToDefaultValue (SetMethod) = 0;
805};985};
806986
807void stubInitInfo (CCSSettingType type,987void stubInitInfo (CCSSettingType type,
@@ -871,16 +1051,6 @@
871 CCSSettingValue *mValue;1051 CCSSettingValue *mValue;
872};1052};
8731053
874template <typename SettingValueType>
875struct SettingMutators
876{
877 typedef CCSSetStatus (*SetFunction) (CCSSetting *setting,
878 SettingValueType data,
879 Bool);
880 typedef Bool (*GetFunction) (CCSSetting *setting,
881 SettingValueType *);
882};
883
884class InternalSetParam :1054class InternalSetParam :
885 public SetParam1055 public SetParam
886{1056{
@@ -895,8 +1065,6 @@
8951065
896 virtual void TearDownSetting ()1066 virtual void TearDownSetting ()
897 {1067 {
898 if (mSetting)
899 setToDefaultValue ();
900 }1068 }
9011069
902 void InitDefaultsForSetting (const SetUpSettingFunc &func)1070 void InitDefaultsForSetting (const SetUpSettingFunc &func)
@@ -944,7 +1112,7 @@
944 GET_INTERFACE_TYPE (CCSSettingInterface));1112 GET_INTERFACE_TYPE (CCSSettingInterface));
945 }1113 }
9461114
947 virtual CCSSetStatus setToFailValue ()1115 virtual CCSSetStatus setToFailValue (SetMethod method)
948 {1116 {
949 return SetFailed;1117 return SetFailed;
950 }1118 }
@@ -961,6 +1129,8 @@
961 CCSSettingType mType;1129 CCSSettingType mType;
962 CCSSettingPtr mSetting;1130 CCSSettingPtr mSetting;
9631131
1132 CCSSettingInterface tmpSettingInterface;
1133
964 private:1134 private:
9651135
966 static const CCSSettingType incorrectSettingType = TypeNum;1136 static const CCSSettingType incorrectSettingType = TypeNum;
@@ -1034,26 +1204,25 @@
1034 TakeReferenceToCreatedSetting (setting);1204 TakeReferenceToCreatedSetting (setting);
1035 }1205 }
10361206
1037 virtual CCSSetStatus setWithInvalidType ()1207 virtual CCSSetStatus setWithInvalidType (SetMethod method)
1038 {1208 {
1039 /* Temporarily redirect the setting interface to1209 /* Temporarily redirect the setting interface to
1040 * our own with an overloaded settingGetType function */1210 * our own with an overloaded settingGetType function */
1041
1042 const CCSSettingInterface *iface = RedirectSettingInterface ();1211 const CCSSettingInterface *iface = RedirectSettingInterface ();
1043 CCSSetStatus ret = (*mSetFunction) (mSetting.get (), mNonDefaultValue, FALSE);1212 CCSSetStatus ret = performSet (mNonDefaultValue, mSetting, mInfo, mType, mSetFunction, method);
1044 RestoreSettingInterface (iface);1213 RestoreSettingInterface (iface);
10451214
1046 return ret;1215 return ret;
1047 }1216 }
10481217
1049 virtual CCSSetStatus setToNonDefaultValue ()1218 virtual CCSSetStatus setToNonDefaultValue (SetMethod method)
1050 {1219 {
1051 return (*mSetFunction) (mSetting.get (), mNonDefaultValue, FALSE);1220 return performSet (mNonDefaultValue, mSetting, mInfo, mType, mSetFunction, method);
1052 }1221 }
10531222
1054 virtual CCSSetStatus setToDefaultValue ()1223 virtual CCSSetStatus setToDefaultValue (SetMethod method)
1055 {1224 {
1056 return (*mSetFunction) (mSetting.get (), mDefaultValue, FALSE);1225 return performSet (mDefaultValue, mSetting, mInfo, mType, mSetFunction, method);
1057 }1226 }
10581227
1059 private:1228 private:
@@ -1073,14 +1242,17 @@
1073 protected:1242 protected:
10741243
1075 SetWithDisallowedValueBase (const CCSSettingPtr &setting,1244 SetWithDisallowedValueBase (const CCSSettingPtr &setting,
1076 const CCSSettingInfoPtr &info) :1245 const CCSSettingInfoPtr &info,
1246 CCSSettingType type) :
1077 mSetting (setting),1247 mSetting (setting),
1078 mInfo (info)1248 mInfo (info),
1249 mType (type)
1079 {1250 {
1080 }1251 }
10811252
1082 CCSSettingPtr mSetting;1253 CCSSettingPtr mSetting;
1083 CCSSettingInfoPtr mInfo;1254 CCSSettingInfoPtr mInfo;
1255 CCSSettingType mType;
1084};1256};
10851257
1086template <typename SettingValueType>1258template <typename SettingValueType>
@@ -1093,8 +1265,9 @@
10931265
1094 SetWithDisallowedValueTemplatedBase (SetFunction setFunction,1266 SetWithDisallowedValueTemplatedBase (SetFunction setFunction,
1095 const CCSSettingPtr &setting,1267 const CCSSettingPtr &setting,
1096 const CCSSettingInfoPtr &info) :1268 const CCSSettingInfoPtr &info,
1097 SetWithDisallowedValueBase (setting, info),1269 CCSSettingType type) :
1270 SetWithDisallowedValueBase (setting, info, type),
1098 mSetFunction (setFunction)1271 mSetFunction (setFunction)
1099 {1272 {
1100 }1273 }
@@ -1112,12 +1285,13 @@
11121285
1113 SetWithDisallowedValue (SetFunction setFunction,1286 SetWithDisallowedValue (SetFunction setFunction,
1114 const CCSSettingPtr &setting,1287 const CCSSettingPtr &setting,
1115 const CCSSettingInfoPtr &info) :1288 const CCSSettingInfoPtr &info,
1116 SetWithDisallowedValueTemplatedBase <SettingValueType> (setFunction, setting, info)1289 CCSSettingType type) :
1290 SetWithDisallowedValueTemplatedBase <SettingValueType> (setFunction, setting, info, type)
1117 {1291 {
1118 }1292 }
11191293
1120 CCSSetStatus operator () ()1294 CCSSetStatus operator () (SetMethod method)
1121 {1295 {
1122 return SetFailed;1296 return SetFailed;
1123 }1297 }
@@ -1134,16 +1308,20 @@
11341308
1135 SetWithDisallowedValue (SetFunction setFunction,1309 SetWithDisallowedValue (SetFunction setFunction,
1136 const CCSSettingPtr &setting,1310 const CCSSettingPtr &setting,
1137 const CCSSettingInfoPtr &info) :1311 const CCSSettingInfoPtr &info,
1138 SetWithDisallowedValueTemplatedBase <int> (setFunction, setting, info)1312 CCSSettingType type) :
1313 SetWithDisallowedValueTemplatedBase <int> (setFunction, setting, info, type)
1139 {1314 {
1140 }1315 }
11411316
1142 CCSSetStatus operator () ()1317 CCSSetStatus operator () (SetMethod method)
1143 {1318 {
1144 return (*Parent::mSetFunction) (Parent::mSetting.get (),1319 return performSet <int> (Parent::mInfo->forInt.min - 1,
1145 Parent::mInfo->forInt.min - 1,1320 Parent::mSetting,
1146 FALSE);1321 Parent::mInfo,
1322 Parent::mType,
1323 Parent::mSetFunction,
1324 method);
1147 }1325 }
1148};1326};
11491327
@@ -1158,16 +1336,20 @@
11581336
1159 SetWithDisallowedValue (SetFunction setFunction,1337 SetWithDisallowedValue (SetFunction setFunction,
1160 const CCSSettingPtr &setting,1338 const CCSSettingPtr &setting,
1161 const CCSSettingInfoPtr &info) :1339 const CCSSettingInfoPtr &info,
1162 SetWithDisallowedValueTemplatedBase <float> (setFunction, setting, info)1340 CCSSettingType type) :
1341 SetWithDisallowedValueTemplatedBase <float> (setFunction, setting, info, type)
1163 {1342 {
1164 }1343 }
11651344
1166 CCSSetStatus operator () ()1345 CCSSetStatus operator () (SetMethod method)
1167 {1346 {
1168 return (*Parent::mSetFunction) (Parent::mSetting.get (),1347 return performSet <float> (Parent::mInfo->forFloat.min - 1.0f,
1169 Parent::mInfo->forFloat.min - 1,1348 Parent::mSetting,
1170 FALSE);1349 Parent::mInfo,
1350 Parent::mType,
1351 Parent::mSetFunction,
1352 method);
1171 }1353 }
1172};1354};
11731355
@@ -1182,16 +1364,20 @@
11821364
1183 SetWithDisallowedValue (SetFunction setFunction,1365 SetWithDisallowedValue (SetFunction setFunction,
1184 const CCSSettingPtr &setting,1366 const CCSSettingPtr &setting,
1185 const CCSSettingInfoPtr &info) :1367 const CCSSettingInfoPtr &info,
1186 SetWithDisallowedValueTemplatedBase <const char *> (setFunction, setting, info)1368 CCSSettingType type) :
1369 SetWithDisallowedValueTemplatedBase <const char *> (setFunction, setting, info, type)
1187 {1370 {
1188 }1371 }
11891372
1190 CCSSetStatus operator () ()1373 CCSSetStatus operator () (SetMethod method)
1191 {1374 {
1192 return (*Parent::mSetFunction) (Parent::mSetting.get (),1375 return performSet <const char *> (NULL,
1193 NULL,1376 Parent::mSetting,
1194 FALSE);1377 Parent::mInfo,
1378 Parent::mType,
1379 Parent::mSetFunction,
1380 method);
1195 }1381 }
1196};1382};
11971383
@@ -1221,12 +1407,13 @@
1221 {1407 {
1222 }1408 }
12231409
1224 virtual CCSSetStatus setToFailValue ()1410 virtual CCSSetStatus setToFailValue (SetMethod method)
1225 {1411 {
1226 typedef TypedSetParam <SettingValueType> Parent;1412 typedef TypedSetParam <SettingValueType> Parent;
1227 return SetWithDisallowedValue <SettingValueType> (Parent::mSetFunction,1413 return SetWithDisallowedValue <SettingValueType> (Parent::mSetFunction,
1228 Parent::mSetting,1414 Parent::mSetting,
1229 Parent::mInfo) ();1415 Parent::mInfo,
1416 Parent::mType) (method);
1230 }1417 }
1231};1418};
12321419
@@ -1264,27 +1451,41 @@
1264 changeTo);1451 changeTo);
1265}1452}
12661453
1454typedef std::tr1::tuple <SetParam::Ptr,
1455 SetMethod> SettingDefaultImplSetParamType;
1456
1267class SettingDefaultImplSet :1457class SettingDefaultImplSet :
1268 public CCSSettingDefaultImplTest,1458 public CCSSettingDefaultImplTest,
1269 public WithParamInterface <SetParam::Ptr>1459 public WithParamInterface <SettingDefaultImplSetParamType>
1270{1460{
1271 public:1461 public:
12721462
1463 SettingDefaultImplSet () :
1464 setHarness (std::tr1::get <0> (GetParam ())),
1465 setMethod (std::tr1::get <1> (GetParam ()))
1466 {
1467 }
1468
1273 virtual void SetUp ()1469 virtual void SetUp ()
1274 {1470 {
1275 GetParam ()->SetUpSetting (boost::bind (&CCSSettingDefaultImplTest::SetUpSetting, this, _1));1471 setHarness->SetUpSetting (boost::bind (&CCSSettingDefaultImplTest::SetUpSetting, this, _1));
1276 GetParam ()->SetUpParam (setting);1472 setHarness->SetUpParam (setting);
1277 }1473 }
12781474
1279 virtual void TearDown ()1475 virtual void TearDown ()
1280 {1476 {
1281 GetParam ()->TearDownSetting ();1477 setHarness->TearDownSetting ();
1282 }1478 }
12831479
1284 CCSSettingType GetSettingType ()1480 CCSSettingType GetSettingType ()
1285 {1481 {
1286 return GetParam ()->GetSettingType ();1482 return setHarness->GetSettingType ();
1287 }1483 }
1484
1485 protected:
1486
1487 SetParam::Ptr setHarness;
1488 SetMethod setMethod;
1288};1489};
12891490
1290class SettingDefaulImplSetFailure :1491class SettingDefaulImplSetFailure :
@@ -1302,41 +1503,41 @@
13021503
1303TEST_P (SettingDefaultImplSet, WithInvalidType)1504TEST_P (SettingDefaultImplSet, WithInvalidType)
1304{1505{
1305 EXPECT_EQ (SetFailed, GetParam ()->setWithInvalidType ());1506 EXPECT_EQ (SetFailed, setHarness->setWithInvalidType (setMethod));
1306}1507}
13071508
1308TEST_P (SettingDefaultImplSet, ToNewValue)1509TEST_P (SettingDefaultImplSet, ToNewValue)
1309{1510{
1310 EXPECT_EQ (SetToNewValue, GetParam ()->setToNonDefaultValue ());1511 EXPECT_EQ (SetToNewValue, setHarness->setToNonDefaultValue (setMethod));
1311}1512}
13121513
1313TEST_P (SettingDefaultImplSet, ToSameValue)1514TEST_P (SettingDefaultImplSet, ToSameValue)
1314{1515{
1315 EXPECT_EQ (SetToNewValue, GetParam ()->setToNonDefaultValue ());1516 EXPECT_EQ (SetToNewValue, setHarness->setToNonDefaultValue (setMethod));
1316 EXPECT_EQ (SetToSameValue, GetParam ()->setToNonDefaultValue ());1517 EXPECT_EQ (SetToSameValue, setHarness->setToNonDefaultValue (setMethod));
1317}1518}
13181519
1319TEST_P (SettingDefaultImplSet, ToDefaultValue)1520TEST_P (SettingDefaultImplSet, ToDefaultValue)
1320{1521{
1321 EXPECT_EQ (SetToNewValue, GetParam ()->setToNonDefaultValue ());1522 EXPECT_EQ (SetToNewValue, setHarness->setToNonDefaultValue (setMethod));
1322 EXPECT_EQ (SetToDefault, GetParam ()->setToDefaultValue ());1523 EXPECT_EQ (SetToDefault, setHarness->setToDefaultValue (setMethod));
1323}1524}
13241525
1325TEST_P (SettingDefaultImplSet, IsDefaultValue)1526TEST_P (SettingDefaultImplSet, IsDefaultValue)
1326{1527{
1327 EXPECT_EQ (SetToNewValue, GetParam ()->setToNonDefaultValue ());1528 EXPECT_EQ (SetToNewValue, setHarness->setToNonDefaultValue (setMethod));
1328 EXPECT_EQ (SetToDefault, GetParam ()->setToDefaultValue ());1529 EXPECT_EQ (SetToDefault, setHarness->setToDefaultValue (setMethod));
1329 EXPECT_EQ (SetIsDefault, GetParam ()->setToDefaultValue ());1530 EXPECT_EQ (SetIsDefault, setHarness->setToDefaultValue (setMethod));
1330}1531}
13311532
1332TEST_P (SettingDefaulImplSetFailure, ToFailValue)1533TEST_P (SettingDefaulImplSetFailure, ToFailValue)
1333{1534{
1334 EXPECT_EQ (SetFailed, GetParam ()->setToFailValue ());1535 EXPECT_EQ (SetFailed, setHarness->setToFailValue (setMethod));
1335}1536}
13361537
1337#define VALUE_TEST INSTANTIATE_TEST_CASE_P1538#define VALUE_TEST INSTANTIATE_TEST_CASE_P
13381539
1339VALUE_TEST (SetSemantics, SettingDefaulImplSetFailure,1540VALUE_TEST (SetSemantics, SettingDefaulImplSetFailure, Combine (
1340 Values (FailSParam <int> (ContainNormal (INTEGER_DEFAULT_VALUE),1541 Values (FailSParam <int> (ContainNormal (INTEGER_DEFAULT_VALUE),
1341 TypeInt,1542 TypeInt,
1342 ccsSetInt,1543 ccsSetInt,
@@ -1364,9 +1565,10 @@
1364 ccsGetMatch,1565 ccsGetMatch,
1365 AutoDestroyInfo (getGenericInfo (TypeMatch),1566 AutoDestroyInfo (getGenericInfo (TypeMatch),
1366 TypeMatch),1567 TypeMatch),
1367 ContainNormal (MATCH_VALUE))));1568 ContainNormal (MATCH_VALUE))),
1569 Values (ThroughRaw, ThroughValue)));
13681570
1369VALUE_TEST (SetSemantics, SettingDefaultImplSet,1571VALUE_TEST (SetSemantics, SettingDefaultImplSet, Combine (
1370 Values (SParam <int> (ContainNormal (INTEGER_DEFAULT_VALUE),1572 Values (SParam <int> (ContainNormal (INTEGER_DEFAULT_VALUE),
1371 TypeInt,1573 TypeInt,
1372 ccsSetInt,1574 ccsSetInt,
@@ -1506,4 +1708,5 @@
1506 ccsGetList,1708 ccsGetList,
1507 getListInfo (TypeBell,1709 getListInfo (TypeBell,
1508 getActionInfo (TypeBell)),1710 getActionInfo (TypeBell)),
1509 ContainList (BELL_VALUE))));1711 ContainList (BELL_VALUE))),
1712 Values (ThroughRaw, ThroughValue)));

Subscribers

People subscribed via source and target branches