Skip to content

Commit b8b39f7

Browse files
committed
Fix tests
1 parent f526886 commit b8b39f7

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

Core/tests/WholeProjectRefactorer-ApplyRefactoringForVariablesContainer.cpp

+12-5
Original file line numberDiff line numberDiff line change
@@ -1092,14 +1092,21 @@ TEST_CASE("WholeProjectRefactorer::ApplyRefactoringForVariablesContainer",
10921092
auto &variant = eventsBasedObject.GetVariants().InsertVariant(
10931093
eventsBasedObject.GetDefaultVariant(), 0);
10941094
gd::InitialInstance *variantInstance = nullptr;
1095-
eventsBasedObject.GetInitialInstances().IterateOverInstances(
1095+
variant.GetInitialInstances().IterateOverInstances(
10961096
[&variantInstance](gd::InitialInstance &instance) {
10971097
variantInstance = &instance;
1098+
return true;
10981099
});
1100+
variant.GetObjects()
1101+
.GetObject("MyObject")
1102+
.GetVariables()
1103+
.Get("MyVariable")
1104+
.SetValue(111);
1105+
variantInstance->GetVariables().Get("MyVariable").SetValue(222);
10991106

11001107
auto &objectFunction =
1101-
eventsBasedObject.GetEventsFunctions().GetEventsFunction(
1102-
"MyObjectEventsFunction");
1108+
eventsBasedObject.GetEventsFunctions().InsertNewEventsFunction(
1109+
"MyObjectEventsFunction", 0);
11031110
gd::StandardEvent &event = dynamic_cast<gd::StandardEvent &>(
11041111
objectFunction.GetEvents().InsertNewEvent(
11051112
project, "BuiltinCommonInstructions::Standard"));
@@ -1144,11 +1151,11 @@ TEST_CASE("WholeProjectRefactorer::ApplyRefactoringForVariablesContainer",
11441151
.GetObject("MyChildObject")
11451152
.GetVariables()
11461153
.Get("MyRenamedVariable")
1147-
.GetValue() == 456);
1154+
.GetValue() == 111);
11481155
REQUIRE(variantInstance != nullptr);
11491156
REQUIRE(
11501157
variantInstance->GetVariables().Get("MyRenamedVariable").GetValue() ==
1151-
456);
1158+
222);
11521159
}
11531160

11541161
SECTION("Can delete an object variable") {

0 commit comments

Comments
 (0)