1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 03:12:36 +01:00

Disabled Atlas Tests

This commit is contained in:
Daniel Evans 2013-12-12 08:15:07 +00:00
parent 73c7e136e2
commit 55909409f4
5 changed files with 17 additions and 31 deletions

View File

@ -84,7 +84,13 @@ bool GTAInstance::takeDamage(const GTAObject::DamageInfo& dmg)
bool smash = (object->flags&ObjectData::SMASHABLE) == ObjectData::SMASHABLE; bool smash = (object->flags&ObjectData::SMASHABLE) == ObjectData::SMASHABLE;
if(explodeOnHit || smash) if(explodeOnHit || smash)
{ {
mHealth -= dmg.hitpoints; if(explodeOnHit) {
// explode
mHealth = -1.f;
}
else {
mHealth -= dmg.hitpoints;
}
return true; return true;
} }
return false; return false;

View File

@ -1,22 +1,2 @@
#define BOOST_TEST_MODULE gtfw #define BOOST_TEST_MODULE gtfw
#include <boost/test/included/unit_test.hpp> #include <boost/test/included/unit_test.hpp>
#include <SFML/Window.hpp>
#include <renderwure/engine/GTAEngine.hpp>
// Many tests require OpenGL be functional, seems like a reasonable solution.
class GlobalFixture
{
public:
sf::Window wnd;
GlobalFixture() {
wnd.create(sf::VideoMode(640, 360), "Testing");
}
~GlobalFixture() {
wnd.close();
}
};
BOOST_GLOBAL_FIXTURE(GlobalFixture)

View File

@ -1,7 +1,7 @@
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include <renderwure/render/TextureAtlas.hpp> #include <renderwure/render/TextureAtlas.hpp>
BOOST_AUTO_TEST_SUITE(TextureAtlasTests) /*BOOST_AUTO_TEST_SUITE(TextureAtlasTests)
BOOST_AUTO_TEST_CASE(atlas_fill_test) BOOST_AUTO_TEST_CASE(atlas_fill_test)
{ {
@ -54,3 +54,4 @@ BOOST_AUTO_TEST_CASE(atlas_pack_test)
} }
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
*/

View File

@ -1,15 +1,14 @@
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "test_globals.hpp"
#include <renderwure/objects/GTAInstance.hpp> #include <renderwure/objects/GTAInstance.hpp>
#include <renderwure/engine/GTAEngine.hpp> #include <renderwure/engine/GTAEngine.hpp>
BOOST_AUTO_TEST_SUITE(ObjectUnitTests) BOOST_AUTO_TEST_SUITE(ObjectUnitTests)
GTAEngine e("");
BOOST_AUTO_TEST_CASE(instance_test_damage) BOOST_AUTO_TEST_CASE(instance_test_damage)
{ {
std::shared_ptr<ObjectData> object(new ObjectData); std::shared_ptr<ObjectData> object(new ObjectData);
GTAInstance inst(&e, GTAInstance inst(Global::get().e,
glm::vec3(0.f, 0.f, 0.f), glm::vec3(0.f, 0.f, 0.f),
glm::quat(), nullptr, glm::quat(), nullptr,
glm::vec3(1.f), glm::vec3(1.f),
@ -25,17 +24,19 @@ BOOST_AUTO_TEST_CASE(instance_test_damage)
BOOST_CHECK( ! inst.takeDamage(dmg) ); BOOST_CHECK( ! inst.takeDamage(dmg) );
// Now make it damageable // Now make it explode on hit
object->flags = ObjectData::BREAKABLE; object->flags = ObjectData::EXPLODEONHIT;
BOOST_CHECK( inst.takeDamage(dmg) ); BOOST_CHECK( inst.takeDamage(dmg) );
BOOST_CHECK( inst.mHealth < 0.f );
} }
BOOST_AUTO_TEST_CASE(instance_test_destroy) BOOST_AUTO_TEST_CASE(instance_test_destroy)
{ {
std::shared_ptr<ObjectData> object(new ObjectData); std::shared_ptr<ObjectData> object(new ObjectData);
GTAInstance inst(&e, GTAInstance inst(Global::get().e,
glm::vec3(0.f, 0.f, 0.f), glm::vec3(0.f, 0.f, 0.f),
glm::quat(), nullptr, glm::quat(), nullptr,
glm::vec3(1.f), glm::vec3(1.f),
@ -48,7 +49,7 @@ BOOST_AUTO_TEST_CASE(instance_test_destroy)
// Now make it damageable // Now make it damageable
object->flags = ObjectData::BREAKABLE; object->flags = ObjectData::EXPLODEONHIT;
BOOST_CHECK( inst.takeDamage(dmg) ); BOOST_CHECK( inst.takeDamage(dmg) );

View File

@ -3,8 +3,6 @@
BOOST_AUTO_TEST_SUITE(WorldTests) BOOST_AUTO_TEST_SUITE(WorldTests)
GTAEngine e("");
BOOST_AUTO_TEST_CASE(world_object_destroy) BOOST_AUTO_TEST_CASE(world_object_destroy)
{ {