-
Notifications
You must be signed in to change notification settings - Fork 314
moved find_clips function to superclass and added test case #1902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
darbyjohnston
merged 5 commits into
AcademySoftwareFoundation:main
from
cato-o:moveFindClips
Jun 20, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bd9d202
moved find_clips function to superclass and added test case
cato-o 2954641
added composition class test script and moved tests from subclass to …
cato-o f0f25e1
fixed semicolons
cato-o 7c62fac
code cleanup
cato-o 11ccc95
added check for track
cato-o File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // Copyright Contributors to the OpenTimelineIO project | ||
|
|
||
| #include "utils.h" | ||
|
|
||
| #include <opentimelineio/composition.h> | ||
| #include <opentimelineio/item.h> | ||
| #include <opentimelineio/clip.h> | ||
| #include <opentimelineio/stack.h> | ||
| #include <opentimelineio/track.h> | ||
| #include <opentimelineio/transition.h> | ||
|
|
||
| #include <iostream> | ||
|
|
||
| namespace otime = opentime::OPENTIME_VERSION; | ||
| namespace otio = opentimelineio::OPENTIMELINEIO_VERSION; | ||
|
|
||
| int | ||
| main(int argc, char** argv) | ||
| { | ||
| Tests tests; | ||
|
|
||
| // test a basic case of find_children | ||
| tests.add_test( | ||
| "test_find_children", [] { | ||
| using namespace otio; | ||
| SerializableObject::Retainer<Composition> comp = new Composition; | ||
| SerializableObject::Retainer<Item> item = new Item; | ||
|
|
||
| comp->append_child(item); | ||
| opentimelineio::v1_0::ErrorStatus err; | ||
| auto result = comp->find_children<>(&err); | ||
| assertEqual(result.size(), 1); | ||
| assertEqual(result[0].value, item.value); | ||
| }); | ||
|
|
||
| // test stack and track correctly calls find_clips from composition parent class | ||
| tests.add_test( | ||
| "test_find_clips", [] { | ||
| using namespace otio; | ||
| SerializableObject::Retainer<Stack> stack = new Stack(); | ||
| SerializableObject::Retainer<Track> track = new Track; | ||
| SerializableObject::Retainer<Clip> clip = new Clip; | ||
| SerializableObject::Retainer<Transition> transition = new Transition; | ||
|
|
||
| stack->append_child(track); | ||
| track->append_child(transition); | ||
| track->append_child(clip); | ||
|
|
||
| opentimelineio::v1_0::ErrorStatus err; | ||
| auto items = stack->find_clips(&err); | ||
| assertFalse(is_error(err)); | ||
| assertEqual(items.size(), 1); | ||
| assertEqual(items[0].value, clip.value); | ||
|
|
||
| items = track->find_clips(&err); | ||
| assertFalse(is_error(err)); | ||
| assertEqual(items.size(), 1); | ||
| assertEqual(items[0].value, clip.value); | ||
| }); | ||
|
|
||
| tests.run(argc, argv); | ||
| return 0; | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.