-
Notifications
You must be signed in to change notification settings - Fork 7
added more unit tests
- Loading branch information
commit a33ee638b9715d606594ebbce93402a223bfac06
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,12 @@ | |
|
||
namespace omath::pathfinding | ||
{ | ||
|
||
enum Error | ||
{ | ||
|
||
}; | ||
|
||
class NavigationMesh final | ||
{ | ||
public: | ||
|
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,38 @@ | ||
// | ||
// Created by Orange on 11/30/2024. | ||
// | ||
#include <gtest/gtest.h> | ||
#include <omath/Angles.hpp> | ||
|
||
|
||
TEST(UnitTestAngles, RadiansToDeg) | ||
{ | ||
constexpr float rad = 67; | ||
|
||
EXPECT_NEAR(omath::angles::RadiansToDegrees(rad), 3838.82f, 0.01f); | ||
} | ||
|
||
TEST(UnitTestAngles, DegreesToRadians) | ||
{ | ||
constexpr float degree = 90; | ||
|
||
EXPECT_NEAR(omath::angles::DegreesToRadians(degree), 1.5708f, 0.01f); | ||
} | ||
|
||
TEST(UnitTestAngles, HorizontalFovToVerical) | ||
{ | ||
constexpr float hFov = 90; | ||
constexpr float aspectRation = 16.0f / 9.0f; | ||
const auto verticalFov = omath::angles::HorizontalFovToVertical(hFov, aspectRation); | ||
|
||
EXPECT_NEAR(verticalFov, 58.71f, 0.01f); | ||
} | ||
|
||
TEST(UnitTestAngles, VerticalToHorizontal) | ||
{ | ||
constexpr float vFov = 58.71; | ||
constexpr float aspectRation = 16.0f / 9.0f; | ||
const auto horizontalFov = omath::angles::VerticalFovToHorizontal(vFov, aspectRation); | ||
|
||
EXPECT_NEAR(horizontalFov, 89.99f, 0.01f); | ||
} |
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.
Global improvement #15
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
Uh oh!
There was an error while loading. Please reload this page.
Global improvement #15
Changes from 1 commit
a25aef0
6e5f233
480d11d
6a9a51b
a33ee63
1fe5e6e
dac0684
7e29ea3
883d27e
f8e7faa
46b4eb9
339dbad
5473515
04a5535
9c0285e
0afa20b
db060e7
95c5073
e0dd432
0587ee4
4b50ac8
ecdd9ec
2488388
ce9da76
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.