mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-23 14:03:34 +00:00
remove unneeded tests
This commit is contained in:
parent
0b2453241b
commit
6ddf5b3e92
@ -54,7 +54,7 @@ void CDPetComponentTable::LoadValuesFromDefaults() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const CDPetComponent& CDPetComponentTable::GetByID(const uint32_t componentID) {
|
const CDPetComponent& CDPetComponentTable::GetByID(const uint32_t componentID) {
|
||||||
const auto& entries = GetEntriesMutable();
|
const auto& entries = GetEntries();
|
||||||
const auto itr = entries.find(componentID);
|
const auto itr = entries.find(componentID);
|
||||||
if (itr == entries.cend()) {
|
if (itr == entries.cend()) {
|
||||||
LOG("Unable to load pet component (ID %i) values from database! Using default values instead.", componentID);
|
LOG("Unable to load pet component (ID %i) values from database! Using default values instead.", componentID);
|
||||||
|
@ -96,7 +96,8 @@ PetComponent::PetComponent(Entity* parentEntity, uint32_t componentId) : Compone
|
|||||||
void PetComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) {
|
void PetComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) {
|
||||||
const bool tamed = m_Owner != LWOOBJID_EMPTY;
|
const bool tamed = m_Owner != LWOOBJID_EMPTY;
|
||||||
|
|
||||||
outBitStream.Write1(); // Always serialize as dirty for now
|
constexpr bool isDirty = true;
|
||||||
|
outBitStream.Write(isDirty); // Always serialize as dirty for now
|
||||||
|
|
||||||
outBitStream.Write(m_Flags);
|
outBitStream.Write(m_Flags);
|
||||||
outBitStream.Write(tamed ? m_Interaction.ability : ePetAbilityType::Invalid); // Something with the overhead icon?
|
outBitStream.Write(tamed ? m_Interaction.ability : ePetAbilityType::Invalid); // Something with the overhead icon?
|
||||||
|
@ -13,11 +13,6 @@
|
|||||||
#include "CDClientManager.h"
|
#include "CDClientManager.h"
|
||||||
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <gtest/gtest.h>
|
|
||||||
|
|
||||||
// Forward declarations
|
|
||||||
class PetTest;
|
|
||||||
class PetComponentFlagTest;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The current state of the pet AI
|
* The current state of the pet AI
|
||||||
@ -364,16 +359,13 @@ public:
|
|||||||
void AddDrainImaginationTimer(Item* item, bool fromTaming = false);
|
void AddDrainImaginationTimer(Item* item, bool fromTaming = false);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Needed so these can access flags
|
// Needed so it can access flags
|
||||||
friend class DamagingPets;
|
friend class DamagingPets;
|
||||||
friend class PetTest;
|
|
||||||
FRIEND_TEST(PetTest, PetComponentFlagTest);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Information for the minigame to be completed
|
* Information for the minigame to be completed
|
||||||
*/
|
*/
|
||||||
struct PuzzleData
|
struct PuzzleData {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* The LOT of the object that is to be created
|
* The LOT of the object that is to be created
|
||||||
*/
|
*/
|
||||||
|
@ -31,60 +31,6 @@ protected:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Test bitset pet flags
|
|
||||||
*/
|
|
||||||
TEST_F(PetTest, PetComponentFlagTest) {
|
|
||||||
using enum PetFlag;
|
|
||||||
|
|
||||||
// Test setting and reading single flags, exclusively
|
|
||||||
petComponent->m_Flags.Reset(NONE);
|
|
||||||
ASSERT_TRUE(petComponent->m_Flags.HasOnly(NONE));
|
|
||||||
petComponent->m_Flags.Reset(TAMEABLE);
|
|
||||||
ASSERT_TRUE(petComponent->m_Flags.HasOnly(TAMEABLE));
|
|
||||||
ASSERT_FALSE(petComponent->m_Flags.HasOnly(SPAWNING));
|
|
||||||
|
|
||||||
// Test setting and reading multiple flags, exclusively
|
|
||||||
petComponent->m_Flags.Reset(NOT_WAITING, SPAWNING);
|
|
||||||
ASSERT_FALSE(petComponent->m_Flags.Has(TAMEABLE));
|
|
||||||
ASSERT_TRUE(petComponent->m_Flags.Has(NOT_WAITING));
|
|
||||||
ASSERT_TRUE(petComponent->m_Flags.Has(SPAWNING));
|
|
||||||
ASSERT_TRUE(petComponent->m_Flags.Has(NOT_WAITING, SPAWNING));
|
|
||||||
ASSERT_FALSE(petComponent->m_Flags.HasOnly(NOT_WAITING));
|
|
||||||
ASSERT_FALSE(petComponent->m_Flags.HasOnly(SPAWNING));
|
|
||||||
ASSERT_TRUE(petComponent->m_Flags.HasOnly(NOT_WAITING, SPAWNING));
|
|
||||||
|
|
||||||
// Test flags are being properly reset for next batch of tests
|
|
||||||
petComponent->m_Flags.Reset(NONE);
|
|
||||||
ASSERT_TRUE(petComponent->m_Flags.Has(NONE));
|
|
||||||
ASSERT_TRUE(petComponent->m_Flags.HasOnly(NONE));
|
|
||||||
ASSERT_FALSE(petComponent->m_Flags.Has(NOT_WAITING));
|
|
||||||
ASSERT_FALSE(petComponent->m_Flags.Has(NOT_WAITING, SPAWNING, TAMEABLE));
|
|
||||||
|
|
||||||
// Test setting and reading single flags, non-exclusively
|
|
||||||
petComponent->m_Flags.Set(NOT_WAITING);
|
|
||||||
ASSERT_TRUE(petComponent->m_Flags.Has(NOT_WAITING));
|
|
||||||
ASSERT_FALSE(petComponent->m_Flags.Has(SPAWNING));
|
|
||||||
|
|
||||||
// Test setting and reading multiple flags, non-exclusively
|
|
||||||
petComponent->m_Flags.Set(TAMEABLE, BEING_TAMED);
|
|
||||||
ASSERT_TRUE(petComponent->m_Flags.Has(TAMEABLE, BEING_TAMED));
|
|
||||||
ASSERT_TRUE(petComponent->m_Flags.Has(NOT_WAITING));
|
|
||||||
ASSERT_FALSE(petComponent->m_Flags.Has(NOT_WAITING, SPAWNING));
|
|
||||||
ASSERT_TRUE(petComponent->m_Flags.Has(NOT_WAITING, TAMEABLE, BEING_TAMED));
|
|
||||||
ASSERT_FALSE(petComponent->m_Flags.Has(SPAWNING));
|
|
||||||
ASSERT_FALSE(petComponent->m_Flags.Has(SPAWNING, NOT_WAITING, TAMEABLE, BEING_TAMED));
|
|
||||||
|
|
||||||
// Test unsetting and reading multiple flags, non-exclusively
|
|
||||||
petComponent->m_Flags.Unset(NOT_WAITING, SPAWNING);
|
|
||||||
ASSERT_FALSE(petComponent->m_Flags.Has(NOT_WAITING, SPAWNING));
|
|
||||||
ASSERT_FALSE(petComponent->m_Flags.Has(NOT_WAITING));
|
|
||||||
ASSERT_TRUE(petComponent->m_Flags.Has(TAMEABLE, BEING_TAMED));
|
|
||||||
ASSERT_FALSE(petComponent->m_Flags.Has(NOT_WAITING, TAMEABLE, BEING_TAMED));
|
|
||||||
ASSERT_FALSE(petComponent->m_Flags.Has(SPAWNING));
|
|
||||||
ASSERT_FALSE(petComponent->m_Flags.Has(SPAWNING, NOT_WAITING, TAMEABLE, BEING_TAMED));
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(PetTest, PlacementNewAddComponentTest) {
|
TEST_F(PetTest, PlacementNewAddComponentTest) {
|
||||||
using enum PetFlag;
|
using enum PetFlag;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user