wtpp/tests/wavetable_test.cpp

32 lines
701 B
C++

#include "../src/wavetable.h"
#include "gtest/gtest.h"
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(w1.name(), "0: PPG");
}
TEST(Wavetable, CopyConstructor) {
Wavetable w1("PPG");
Wavetable w2(w1);
// Check id is correct
EXPECT_EQ(w2.getId(), 0);
// Sample name is correct
EXPECT_EQ(w2.name(), "0: PPG");
}
TEST(Wavetable, CopyAssignment) {
Wavetable w1("PPG");
Wavetable w2 = w1;
// Check id is correct
EXPECT_EQ(w2.getId(), 0);
// Check name is correct
EXPECT_EQ(w2.name(), "0: PPG");
}