https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d5b3bb4f4a2bbe17f28dd200f6fc7f4c69e76cc8
commit d5b3bb4f4a2bbe17f28dd200f6fc7f4c69e76cc8 Author: Timo Kreuzer <timo.kreu...@reactos.org> AuthorDate: Thu Sep 12 11:21:36 2024 +0300 Commit: Timo Kreuzer <timo.kreu...@reactos.org> CommitDate: Sun Sep 15 19:28:07 2024 +0300 [ATL_APITEST] Fix CSimpleArray test The test violated the one definition rule and was using the constructor from a different implementation of CCreature. --- modules/rostests/apitests/atl/CSimpleArray.cpp | 86 +++++++++++++------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/modules/rostests/apitests/atl/CSimpleArray.cpp b/modules/rostests/apitests/atl/CSimpleArray.cpp index 9176feb14ff..6a3315055a5 100644 --- a/modules/rostests/apitests/atl/CSimpleArray.cpp +++ b/modules/rostests/apitests/atl/CSimpleArray.cpp @@ -14,31 +14,31 @@ #include <atlbase.h> #include <atlsimpcoll.h> -struct CCreature +struct CSimpleCreature { static int s_nCount; static int s_nCopyCount; - CCreature() + CSimpleCreature() { - CCreature::s_nCount++; + CSimpleCreature::s_nCount++; } - CCreature(const CCreature& c) + CSimpleCreature(const CSimpleCreature& c) { - CCreature::s_nCount++; + CSimpleCreature::s_nCount++; } - ~CCreature() + ~CSimpleCreature() { - CCreature::s_nCount--; + CSimpleCreature::s_nCount--; } - CCreature& operator=(const CCreature& other) + CSimpleCreature& operator=(const CSimpleCreature& other) { - CCreature::s_nCopyCount++; + CSimpleCreature::s_nCopyCount++; return *this; } }; -int CCreature::s_nCount = 0; -int CCreature::s_nCopyCount = 0; +int CSimpleCreature::s_nCount = 0; +int CSimpleCreature::s_nCopyCount = 0; START_TEST(CSimpleArray) @@ -83,60 +83,60 @@ START_TEST(CSimpleArray) ok_int(array1[2], 2); ok_int(array1[3], 3); - ok_int(CCreature::s_nCount, 0); - ok_int(CCreature::s_nCopyCount, 0); + ok_int(CSimpleCreature::s_nCount, 0); + ok_int(CSimpleCreature::s_nCopyCount, 0); - CSimpleArray<CCreature> array2; + CSimpleArray<CSimpleCreature> array2; { - CCreature creature1, creature2; + CSimpleCreature creature1, creature2; - ok_int(CCreature::s_nCount, 2); - ok_int(CCreature::s_nCopyCount, 0); + ok_int(CSimpleCreature::s_nCount, 2); + ok_int(CSimpleCreature::s_nCopyCount, 0); array2.Add(creature1); - ok_int(CCreature::s_nCount, 3); - ok_int(CCreature::s_nCopyCount, 0); + ok_int(CSimpleCreature::s_nCount, 3); + ok_int(CSimpleCreature::s_nCopyCount, 0); array2.Add(creature2); - ok_int(CCreature::s_nCount, 4); - ok_int(CCreature::s_nCopyCount, 0); + ok_int(CSimpleCreature::s_nCount, 4); + ok_int(CSimpleCreature::s_nCopyCount, 0); } - ok_int(CCreature::s_nCount, 2); - ok_int(CCreature::s_nCopyCount, 0); + ok_int(CSimpleCreature::s_nCount, 2); + ok_int(CSimpleCreature::s_nCopyCount, 0); { - CSimpleArray<CCreature> array3(array2), array4, array5; - ok_int(CCreature::s_nCount, 4); - ok_int(CCreature::s_nCopyCount, 0); + CSimpleArray<CSimpleCreature> array3(array2), array4, array5; + ok_int(CSimpleCreature::s_nCount, 4); + ok_int(CSimpleCreature::s_nCopyCount, 0); array4 = array2; - ok_int(CCreature::s_nCount, 6); - ok_int(CCreature::s_nCopyCount, 0); + ok_int(CSimpleCreature::s_nCount, 6); + ok_int(CSimpleCreature::s_nCopyCount, 0); - CCreature creature1; - ok_int(CCreature::s_nCount, 7); - ok_int(CCreature::s_nCopyCount, 0); + CSimpleCreature creature1; + ok_int(CSimpleCreature::s_nCount, 7); + ok_int(CSimpleCreature::s_nCopyCount, 0); array4.Add(creature1); - ok_int(CCreature::s_nCount, 8); - ok_int(CCreature::s_nCopyCount, 0); + ok_int(CSimpleCreature::s_nCount, 8); + ok_int(CSimpleCreature::s_nCopyCount, 0); array3 = array4; - ok_int(CCreature::s_nCount, 9); - ok_int(CCreature::s_nCopyCount, 0); + ok_int(CSimpleCreature::s_nCount, 9); + ok_int(CSimpleCreature::s_nCopyCount, 0); array5 = array2; - ok_int(CCreature::s_nCount, 11); - ok_int(CCreature::s_nCopyCount, 0); + ok_int(CSimpleCreature::s_nCount, 11); + ok_int(CSimpleCreature::s_nCopyCount, 0); array5 = array2; - ok_int(CCreature::s_nCount, 11); - ok_int(CCreature::s_nCopyCount, 0); + ok_int(CSimpleCreature::s_nCount, 11); + ok_int(CSimpleCreature::s_nCopyCount, 0); } - ok_int(CCreature::s_nCount, 2); - ok_int(CCreature::s_nCopyCount, 0); + ok_int(CSimpleCreature::s_nCount, 2); + ok_int(CSimpleCreature::s_nCopyCount, 0); array2.RemoveAll(); - ok_int(CCreature::s_nCount, 0); - ok_int(CCreature::s_nCopyCount, 0); + ok_int(CSimpleCreature::s_nCount, 0); + ok_int(CSimpleCreature::s_nCopyCount, 0); array1.RemoveAll(); ok_int(array1.GetSize(), 0);