wtpp/tests/wavetable_test.cpp

38 lines
855 B
C++

#include "../src/wavetable.h"
#include "gtest/gtest.h"
// Initialize index at 0 for wave cycles
uint16_t Wave::m_nid = 0;
uint16_t Wavetable::m_nid = 0;
TEST(Wavetable, DefaultConstructor)
{
Wavetable w1("PPG"), w2("!PPG");
// Check ids are correct
EXPECT_EQ(w1.getId(), 0);
EXPECT_EQ(w2.getId(), 1);
// Check name is correct
// std::string name = w1.name();
// EXPECT_EQ(name, "PPG");
}
TEST(Wavetable, CopyConstructor) {
Wavetable w1("PPG");
Wavetable w2(w1);
// Check id is correct
EXPECT_EQ(w2.getId(), 0);
// Sample name is correct
// std::string name = w2.name();
// EXPECT_EQ(name, "PPG");
}
TEST(Wavetable, CopyAssignment) {
Wavetable w1("PPG");
Wavetable w2 = w1;
// Check id is correct
EXPECT_EQ(w2.getId(), 0);
// Check name is correct
// std::string name = w2.name();
// EXPECT_EQ(name, "PPG");
}