Skip to content
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

Add tests for AnimationPlayer #92649

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

JustSascha
Copy link

@JustSascha JustSascha commented Jun 1, 2024

Added file test_animation_player.h under tests/scene.

File contains tests cases for methods set_default_blend_time, get_default_blend_time, set_blend_time and get_blend_time.

Modified test_main.cpp to include the new test file.

EDIT: forgot to link to issue #43440 (sorry).

@JustSascha JustSascha requested a review from a team as a code owner June 1, 2024 15:04
@AThousandShips AThousandShips changed the title Added test file for animation_player Add test file for AnimationPlayer Jun 1, 2024
@AThousandShips AThousandShips requested a review from a team June 1, 2024 15:06
@AThousandShips AThousandShips added this to the 4.x milestone Jun 1, 2024
@AThousandShips
Copy link
Member

Since most of your code is commented out I'd suggest making this a draft until you're done, or remove the commented out code

@@ -100,6 +100,8 @@
#include "tests/core/variant/test_variant.h"
#include "tests/core/variant/test_variant_utility.h"
#include "tests/scene/test_animation.h"
#include "tests/scene/test_animation_player.h"
#include "tests/scene/test_arraymesh.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include "tests/scene/test_arraymesh.h"

Don't move this here it's below to prevent errors

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't see that, it copied it there when I synced with main repo, my bad.

namespace TestAnimationPlayer {

TEST_CASE("[AnimationPlayer] get & set default_blend_time") {
AnimationPlayer *animationPlayer = memnew(AnimationPlayer);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
AnimationPlayer *animationPlayer = memnew(AnimationPlayer);
AnimationPlayer *animation_player = memnew(AnimationPlayer);

Please use snake_case, for all

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, correcting and updating now.

@AThousandShips AThousandShips changed the title Add test file for AnimationPlayer Add tests for AnimationPlayer Jun 1, 2024
Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding [SceneTree] will allow you to call more godot functionaility.

@EAinsley
Copy link
Contributor

EAinsley commented Oct 3, 2024

I need to add a test to guard #97760. Should I add my test there, since this thread seems still ongoing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants