File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -74,9 +74,10 @@ _flatten_next_item(
74
74
}
75
75
76
76
auto children = track->children ();
77
- for (int i = 0 ; i < children.size (); i++)
77
+ int children_size = static_cast <int >(children.size ());
78
+ for (int i = 0 ; i < children_size; i++)
78
79
{
79
- std::optional<TimeRange> trim = std::nullopt;;
80
+ std::optional<TimeRange> trim = std::nullopt;
80
81
SerializableObject::Retainer<Composable> child = children[i];
81
82
82
83
// combine all non visible children into one continuous range
@@ -102,7 +103,7 @@ _flatten_next_item(
102
103
trim = child_trim;
103
104
}
104
105
105
- if (i+1 < children. size () )
106
+ if (i+1 < children_size )
106
107
{
107
108
child = children[i++];
108
109
}
Original file line number Diff line number Diff line change @@ -259,6 +259,9 @@ main(int argc, char** argv)
259
259
assertEqual (result->children ().size (), 1 );
260
260
assertEqual (result->children ()[0 ]->name (), std::string (" track2_C" ));
261
261
assertEqual (result->duration ().value (), 300 );
262
+ assertEqual (st->children ().size (), 2 );
263
+ assertEqual (dynamic_cast <otio::Track*>(st->children ()[0 ].value )->children ().size (), 1 );
264
+ assertEqual (dynamic_cast <otio::Track*>(st->children ()[1 ].value )->children ().size (), 2 );
262
265
});
263
266
264
267
tests.add_test (
@@ -309,8 +312,11 @@ main(int argc, char** argv)
309
312
assertEqual (result->children ()[0 ]->name (), std::string (" track2_C" ));
310
313
assertEqual (result->children ()[1 ]->name (), std::string (" track2_D" ));
311
314
assertEqual (result->duration ().value (), 300 );
315
+ assertEqual (st->children ().size (), 2 );
316
+ assertEqual (dynamic_cast <otio::Track*>(st->children ()[0 ].value )->children ().size (), 2 );
317
+ assertEqual (dynamic_cast <otio::Track*>(st->children ()[1 ].value )->children ().size (), 2 );
312
318
});
313
319
314
320
tests.run (argc, argv);
315
321
return 0 ;
316
- }
322
+ }
You can’t perform that action at this time.
0 commit comments