Skip to content

Commit

Permalink
test animstate::operator==
Browse files Browse the repository at this point in the history
  • Loading branch information
no-lex committed Nov 29, 2024
1 parent 2472507 commit ddc4a57
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ endif
#list of source code files to be compiled
CLIENT_OBJS= \
main.o \
testanimmodel.o \
testcs.o \
testgeom.o \
testgeomexts.o \
Expand Down
2 changes: 2 additions & 0 deletions test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "testgeom.h"
#include "testgeomexts.h"
#include "testgltfloader.h"
#include "testanimmodel.h"
#include "testskel.h"
#include "testslot.h"
#include "testmd5.h"
Expand All @@ -27,6 +28,7 @@ int main()
test_gltf();
test_md5();
test_ragdoll();
test_animmodel();
test_skel();
test_slot();
test_geom();
Expand Down
48 changes: 48 additions & 0 deletions test/testanimmodel.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

#include "../src/libprimis-headers/cube.h"

#include "../src/shared/geomexts.h"
#include "../src/shared/glexts.h"

#include <optional>
#include <memory>

#include "../src/engine/interface/console.h"
#include "../src/engine/interface/cs.h"

#include "../src/engine/render/rendergl.h"
#include "../src/engine/render/rendermodel.h"
#include "../src/engine/render/shader.h"
#include "../src/engine/render/shaderparam.h"
#include "../src/engine/render/texture.h"

#include "../src/engine/world/entities.h"
#include "../src/engine/world/bih.h"

#include "../src/engine/model/model.h"
#include "../src/engine/model/ragdoll.h"
#include "../src/engine/model/animmodel.h"

namespace
{
void test_animstate_equals()
{
std::printf("testing animstate operator==\n");
animmodel::AnimPos p{1,1,1,1.f};
animmodel::AnimState s1{nullptr, p, p, 1.f};
animmodel::AnimState s2{nullptr, p, p, 0.f};
assert(s1 == s1);
assert(!(s2 == s1));
assert(!(s1 == s2));
}
}

void test_animmodel()
{
std::printf(
"===============================================================\n\
testing animmodel functionality\n\
===============================================================\n"
);
test_animstate_equals();
};
8 changes: 8 additions & 0 deletions test/testanimmodel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef TEST_ANIMMODEL_H_
#define TEST_ANIMMODEL_H_

extern void test_animmodel();

#endif


0 comments on commit ddc4a57

Please sign in to comment.