mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
feat(array): add TSBaseArray<T>::MemLineNo
This commit is contained in:
parent
95fed153cd
commit
1a9b17293c
2 changed files with 13 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ class TSBaseArray {
|
||||||
T* m_data = nullptr;
|
T* m_data = nullptr;
|
||||||
|
|
||||||
virtual const char* MemFileName() const;
|
virtual const char* MemFileName() const;
|
||||||
|
virtual int32_t MemLineNo() const;
|
||||||
|
|
||||||
T& operator[](uint32_t i);
|
T& operator[](uint32_t i);
|
||||||
uint32_t Count(void);
|
uint32_t Count(void);
|
||||||
|
|
@ -39,4 +40,9 @@ const char* TSBaseArray<T>::MemFileName() const {
|
||||||
return typeid(T).name();
|
return typeid(T).name();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
int32_t TSBaseArray<T>::MemLineNo() const {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -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]") {
|
TEST_CASE("TSFixedArray", "[array]") {
|
||||||
SECTION("constructs correctly") {
|
SECTION("constructs correctly") {
|
||||||
TSFixedArray<uint32_t> array;
|
TSFixedArray<uint32_t> array;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue