C++: Add failing tests with 'CSimpleArray'.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-11-27 14:20:24 +00:00
parent c61395b973
commit 029c0134eb
2 changed files with 93 additions and 0 deletions

View File

@@ -706,3 +706,50 @@ void test_CPathT() {
sink(p2.GetExtension()); // $ ir
}
}
template <class T>
struct CSimpleArray {
CSimpleArray(const CSimpleArray<T>& src);
CSimpleArray();
~CSimpleArray();
BOOL Add(const T& t);
int Find(const T& t) const;
T* GetData() const;
int GetSize() const;
BOOL Remove(const T& t);
void RemoveAll();
BOOL RemoveAt(int nIndex);
BOOL SetAtIndex(
int nIndex,
const T& t);
T& operator[](int nindex);
CSimpleArray<T> & operator=(const CSimpleArray<T>& src);
};
void test_CSimpleArray() {
int x = source<int>();
{
CSimpleArray<int> a;
a.Add(x);
sink(a[0]); // $ MISSING: ir
a.Add(0);
sink(a[0]); // $ MISSING: ir
CSimpleArray<int> a2;
sink(a2[0]);
a2 = a;
sink(a2[0]); // $ MISSING: ir
}
{
CSimpleArray<int> a;
a.Add(x);
sink(a.GetData()); // $ MISSING: ir
CSimpleArray<int> a2;
int pos = a2.Find(x);
sink(a2[pos]); // $ MISSING: ir
}
}

View File

@@ -800,6 +800,52 @@ WARNING: module 'TaintTracking' has been deprecated and may be removed in future
| atl.cpp:704:17:704:28 | call to CommonPrefix | atl.cpp:705:10:705:11 | p2 | |
| atl.cpp:704:17:704:28 | call to CommonPrefix | atl.cpp:706:10:706:11 | p2 | |
| atl.cpp:705:10:705:11 | p2 [post update] | atl.cpp:706:10:706:11 | p2 | |
| atl.cpp:733:11:733:21 | call to source | atl.cpp:736:11:736:11 | x | |
| atl.cpp:733:11:733:21 | call to source | atl.cpp:748:11:748:11 | x | |
| atl.cpp:733:11:733:21 | call to source | atl.cpp:752:23:752:23 | x | |
| atl.cpp:735:23:735:23 | call to CSimpleArray | atl.cpp:736:5:736:5 | a | |
| atl.cpp:735:23:735:23 | call to CSimpleArray | atl.cpp:737:10:737:10 | a | |
| atl.cpp:735:23:735:23 | call to CSimpleArray | atl.cpp:738:5:738:5 | a | |
| atl.cpp:735:23:735:23 | call to CSimpleArray | atl.cpp:739:10:739:10 | a | |
| atl.cpp:735:23:735:23 | call to CSimpleArray | atl.cpp:743:10:743:10 | a | |
| atl.cpp:735:23:735:23 | call to CSimpleArray | atl.cpp:745:3:745:3 | a | |
| atl.cpp:736:5:736:5 | ref arg a | atl.cpp:737:10:737:10 | a | |
| atl.cpp:736:5:736:5 | ref arg a | atl.cpp:738:5:738:5 | a | |
| atl.cpp:736:5:736:5 | ref arg a | atl.cpp:739:10:739:10 | a | |
| atl.cpp:736:5:736:5 | ref arg a | atl.cpp:743:10:743:10 | a | |
| atl.cpp:736:5:736:5 | ref arg a | atl.cpp:745:3:745:3 | a | |
| atl.cpp:737:10:737:10 | ref arg a | atl.cpp:738:5:738:5 | a | |
| atl.cpp:737:10:737:10 | ref arg a | atl.cpp:739:10:739:10 | a | |
| atl.cpp:737:10:737:10 | ref arg a | atl.cpp:743:10:743:10 | a | |
| atl.cpp:737:10:737:10 | ref arg a | atl.cpp:745:3:745:3 | a | |
| atl.cpp:738:5:738:5 | ref arg a | atl.cpp:739:10:739:10 | a | |
| atl.cpp:738:5:738:5 | ref arg a | atl.cpp:743:10:743:10 | a | |
| atl.cpp:738:5:738:5 | ref arg a | atl.cpp:745:3:745:3 | a | |
| atl.cpp:739:10:739:10 | ref arg a | atl.cpp:743:10:743:10 | a | |
| atl.cpp:739:10:739:10 | ref arg a | atl.cpp:745:3:745:3 | a | |
| atl.cpp:741:23:741:24 | call to CSimpleArray | atl.cpp:742:10:742:11 | a2 | |
| atl.cpp:741:23:741:24 | call to CSimpleArray | atl.cpp:743:5:743:6 | a2 | |
| atl.cpp:741:23:741:24 | call to CSimpleArray | atl.cpp:744:10:744:11 | a2 | |
| atl.cpp:741:23:741:24 | call to CSimpleArray | atl.cpp:745:3:745:3 | a2 | |
| atl.cpp:742:10:742:11 | ref arg a2 | atl.cpp:743:5:743:6 | a2 | |
| atl.cpp:742:10:742:11 | ref arg a2 | atl.cpp:744:10:744:11 | a2 | |
| atl.cpp:742:10:742:11 | ref arg a2 | atl.cpp:745:3:745:3 | a2 | |
| atl.cpp:743:5:743:6 | ref arg a2 | atl.cpp:744:10:744:11 | a2 | |
| atl.cpp:743:5:743:6 | ref arg a2 | atl.cpp:745:3:745:3 | a2 | |
| atl.cpp:743:10:743:10 | a | atl.cpp:743:5:743:6 | ref arg a2 | TAINT |
| atl.cpp:743:10:743:10 | a | atl.cpp:743:8:743:8 | call to operator= | TAINT |
| atl.cpp:744:10:744:11 | ref arg a2 | atl.cpp:745:3:745:3 | a2 | |
| atl.cpp:747:23:747:23 | call to CSimpleArray | atl.cpp:748:5:748:5 | a | |
| atl.cpp:747:23:747:23 | call to CSimpleArray | atl.cpp:749:10:749:10 | a | |
| atl.cpp:747:23:747:23 | call to CSimpleArray | atl.cpp:754:3:754:3 | a | |
| atl.cpp:748:5:748:5 | ref arg a | atl.cpp:749:10:749:10 | a | |
| atl.cpp:748:5:748:5 | ref arg a | atl.cpp:754:3:754:3 | a | |
| atl.cpp:749:10:749:10 | ref arg a | atl.cpp:754:3:754:3 | a | |
| atl.cpp:751:23:751:24 | call to CSimpleArray | atl.cpp:752:15:752:16 | a2 | |
| atl.cpp:751:23:751:24 | call to CSimpleArray | atl.cpp:753:10:753:11 | a2 | |
| atl.cpp:751:23:751:24 | call to CSimpleArray | atl.cpp:754:3:754:3 | a2 | |
| atl.cpp:752:18:752:21 | call to Find | atl.cpp:753:13:753:15 | pos | |
| atl.cpp:753:10:753:11 | ref arg a2 | atl.cpp:754:3:754:3 | a2 | |
| bsd.cpp:17:11:17:16 | call to source | bsd.cpp:20:18:20:18 | s | |
| bsd.cpp:18:12:18:15 | addr | bsd.cpp:20:22:20:25 | addr | |
| bsd.cpp:18:12:18:15 | addr | bsd.cpp:23:8:23:11 | addr | |