feat(array): add TSBaseArray<T>::MemLineNo

This commit is contained in:
fallenoak 2020-12-08 23:12:59 -06:00
parent 95fed153cd
commit 1a9b17293c
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D
2 changed files with 13 additions and 0 deletions

View file

@ -12,6 +12,7 @@ class TSBaseArray {
T* m_data = nullptr;
virtual const char* MemFileName() const;
virtual int32_t MemLineNo() const;
T& operator[](uint32_t i);
uint32_t Count(void);
@ -39,4 +40,9 @@ const char* TSBaseArray<T>::MemFileName() const {
return typeid(T).name();
}
template <class T>
int32_t TSBaseArray<T>::MemLineNo() const {
return -2;
}
#endif

View file

@ -16,6 +16,13 @@ TEST_CASE("TSBaseArray::MemFileName", "[array]") {
}
}
TEST_CASE("TSBaseArray::MemLineNo", "[array]") {
SECTION("returns a negative number") {
TSBaseArray<uint32_t> array;
REQUIRE(array.MemLineNo() < 0);
}
}
TEST_CASE("TSFixedArray", "[array]") {
SECTION("constructs correctly") {
TSFixedArray<uint32_t> array;