mirror of
https://github.com/thunderbrewhq/typhoon.git
synced 2025-12-12 02:22:30 +00:00
feat(vector): add C2Vector constructors
This commit is contained in:
parent
0ebe6450a0
commit
51ccc49265
2 changed files with 20 additions and 0 deletions
|
|
@ -6,6 +6,12 @@ class C2Vector {
|
|||
// Member variables
|
||||
float x = 0.0f;
|
||||
float y = 0.0f;
|
||||
|
||||
// Member functions
|
||||
C2Vector() = default;
|
||||
C2Vector(float x, float y)
|
||||
: x(x)
|
||||
, y(y) {};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,20 @@
|
|||
#include "tempest/Vector.hpp"
|
||||
#include "test/Test.hpp"
|
||||
|
||||
TEST_CASE("C2Vector", "[vector]") {
|
||||
SECTION("constructs with default constructor") {
|
||||
C2Vector vector;
|
||||
REQUIRE(vector.x == 0.0f);
|
||||
REQUIRE(vector.y == 0.0f);
|
||||
}
|
||||
|
||||
SECTION("constructs with xy constructor") {
|
||||
auto vector = C2Vector(1.0f, 2.0f);
|
||||
REQUIRE(vector.x == 1.0f);
|
||||
REQUIRE(vector.y == 2.0f);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("C3Vector", "[vector]") {
|
||||
SECTION("constructs with default constructor") {
|
||||
C3Vector vector;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue