TEST(QualityValueVectorTest, ToString){ QualityValueVector<QualityValue> qual; qual.Copy(qvstr); // Test ToString() EXPECT_EQ(qual.ToString(), qvstr); EXPECT_EQ(static_cast<size_t>(qual.Length()), qvstr.size()); }
TEST(QualityValueVectorTest, Copy){ EXPECT_EQ(qvstr.size(), data.size()); QualityValueVector<QualityValue> qual; EXPECT_TRUE(qual.Empty()); // Copy qvs from a string qual.Copy(qvstr); EXPECT_FALSE(qual.Empty()); for(size_t i = 0; i < qvstr.size(); i++) { EXPECT_EQ(static_cast<uint8_t>(qual.data[i]), data[i]); } }
void QualityValueVector<T_QV>::Copy(const QualityValueVector<T_QV> &rhs, const DNALength length) { Free(); if (rhs.Empty()) { return; } Allocate(length); std::memcpy(data, rhs.data, length * sizeof(T_QV)); }