Author: mjansen
Date: Thu Sep 15 19:41:03 2016
New Revision: 72688
URL:
http://svn.reactos.org/svn/reactos?rev=72688&view=rev
Log:
[ATL][ATL_APITEST] Implemente CSimpleArray + CSimpleMap. Based on a patch from Katayama
Hirofumi MZ. CORE-11946
Most of the code is from Katayama Hirofumi MZ, the placement new / delete is written by
me, based on a hint from Giannis.
Added:
trunk/reactos/sdk/lib/atl/atlsimpcoll.h (with props)
trunk/rostests/apitests/atl/CSimpleArray.cpp (with props)
trunk/rostests/apitests/atl/CSimpleMap.cpp (with props)
trunk/rostests/apitests/atl/devenv/ATLTest.sln (with props)
trunk/rostests/apitests/atl/devenv/CSimpleArray.vcxproj (with props)
trunk/rostests/apitests/atl/devenv/CSimpleMap.vcxproj (with props)
Removed:
trunk/rostests/apitests/atl/devenv/CImage.sln
Modified:
trunk/rostests/apitests/atl/CMakeLists.txt
trunk/rostests/apitests/atl/devenv/CImage.vcxproj
trunk/rostests/apitests/atl/testlist.c
Added: trunk/reactos/sdk/lib/atl/atlsimpcoll.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/atl/atlsimpcoll.h?…
==============================================================================
--- trunk/reactos/sdk/lib/atl/atlsimpcoll.h (added)
+++ trunk/reactos/sdk/lib/atl/atlsimpcoll.h [iso-8859-1] Thu Sep 15 19:41:03 2016
@@ -0,0 +1,453 @@
+// PROJECT: ReactOS ATL Simple Collection
+// LICENSE: Public Domain
+// PURPOSE: Provides compatibility to Microsoft ATL
+// PROGRAMMERS: Katayama Hirofumi MZ (katayama.hirofumi.mz(a)gmail.com)
+
+#ifndef __ATLSIMPCOLL_H__
+#define __ATLSIMPCOLL_H__
+
+#pragma once
+
+#include "atlcore.h" // for ATL Core
+
+namespace ATL
+{
+template <typename T>
+class CSimpleArrayEqualHelper
+{
+public:
+ static bool IsEqual(const T& t1, const T& t2)
+ {
+ return t1 == t2;
+ }
+};
+
+// This class exists for the element types of no comparison.
+template <typename T>
+class CSimpleArrayEqualHelperFalse
+{
+public:
+ static bool IsEqual(const T&, const T&)
+ {
+ ATLASSERT(FALSE);
+ return false;
+ }
+};
+
+template <typename T, typename TEqual = CSimpleArrayEqualHelper<T> >
+class CSimpleArray
+{
+public:
+ typedef T _ArrayElementType;
+
+ CSimpleArray() : m_pData(NULL), m_nCount(0), m_nCapacity(0)
+ {
+ }
+
+ CSimpleArray(const CSimpleArray<T, TEqual>& src) :
+ m_pData(NULL), m_nCount(0), m_nCapacity(0)
+ {
+ *this = src;
+ }
+
+ ~CSimpleArray()
+ {
+ RemoveAll();
+ }
+
+ BOOL Add(const T& t)
+ {
+ // is the capacity enough?
+ if (m_nCapacity < m_nCount + 1)
+ {
+ // allocate extra capacity for optimization
+ const int nNewCapacity = (m_nCount + 1) + c_nGrow;
+ T *pNewData = (T *)realloc(m_pData, nNewCapacity * sizeof(T));
+ if (pNewData == NULL)
+ return FALSE; // failure
+
+ m_pData = pNewData;
+ m_nCapacity = nNewCapacity;
+ }
+
+ // call constructor
+ ConstructItemInPlace(m_nCount, t);
+
+ // increment
+ ++m_nCount;
+
+ return TRUE;
+ }
+
+ int Find(const T& t) const
+ {
+ for (int nIndex = 0; nIndex < m_nCount; ++nIndex)
+ {
+ if (TEqual::IsEqual(m_pData[nIndex], t))
+ {
+ return nIndex; // success
+ }
+ }
+ return -1; // failure
+ }
+
+ T* GetData()
+ {
+ return m_pData;
+ }
+
+ const T* GetData() const
+ {
+ return m_pData;
+ }
+
+ int GetSize() const
+ {
+ return m_nCount;
+ }
+
+ BOOL Remove(const T& t)
+ {
+ return RemoveAt(Find(t));
+ }
+
+ void RemoveAll()
+ {
+ if (m_pData)
+ {
+ // call destructor
+ const int nCount = m_nCount;
+ for (int nIndex = 0; nIndex < nCount; ++nIndex)
+ {
+ DestructItem(nIndex);
+ }
+
+ free(m_pData);
+ m_pData = NULL;
+ }
+ m_nCount = 0;
+ m_nCapacity = 0;
+ }
+
+ BOOL RemoveAt(int nIndex)
+ {
+ // boundary check
+ if (nIndex < 0 || m_nCount <= nIndex)
+ return FALSE; // failure
+
+ // call destructor
+ DestructItem(nIndex);
+
+ // move range [nIndex + 1, m_nCount) to nIndex
+ const int nRightCount = m_nCount - (nIndex + 1);
+ const int nRightSize = nRightCount * sizeof(T);
+ memmove(&m_pData[nIndex], &m_pData[nIndex + 1], nRightSize);
+
+ // decrement
+ --m_nCount;
+
+ return TRUE;
+ }
+
+ BOOL SetAtIndex(int nIndex, const T& t)
+ {
+ // boundary check
+ if (nIndex < 0 || m_nCount <= nIndex)
+ return FALSE; // failure
+
+ // store it
+ m_pData[nIndex] = t;
+ return TRUE;
+ }
+
+ T& operator[](int nIndex)
+ {
+ ATLASSERT(0 <= nIndex && nIndex < m_nCount);
+ return m_pData[nIndex];
+ }
+
+ const T& operator[](int nIndex) const
+ {
+ ATLASSERT(0 <= nIndex && nIndex < m_nCount);
+ return m_pData[nIndex];
+ }
+
+ CSimpleArray<T, TEqual>& operator=(const CSimpleArray<T, TEqual>&
src)
+ {
+ // don't copy if two objects are same
+ if (this == &src)
+ return *this;
+
+ if (src.GetSize() != GetSize())
+ {
+ RemoveAll();
+
+ m_nCapacity = src.GetSize();
+
+ T *pNewData = (T *)realloc(m_pData, m_nCapacity * sizeof(T));
+ ATLASSERT(pNewData);
+ if (pNewData == NULL)
+ return *this; // failure
+
+ // store new data and capacity
+ m_pData = pNewData;
+ m_nCount = m_nCapacity;
+ }
+ else
+ {
+ for (int nIndex = 0; nIndex < m_nCount; ++nIndex)
+ {
+ DestructItem(nIndex);
+ }
+ }
+
+ ATLASSERT(GetSize() == src.GetSize());
+ for (int nIndex = 0; nIndex < src.GetSize(); ++nIndex)
+ {
+ ConstructItemInPlace(nIndex, src[nIndex]);
+ }
+
+ return *this;
+ }
+
+protected:
+ T * m_pData; // malloc'ed
+ int m_nCount; // # of items of type T
+ int m_nCapacity; // for optimization
+ static const int c_nGrow = 8; // for optimization
+
+ // NOTE: Range m_pData[0] .. m_pData[m_nCapacity - 1] are accessible.
+ // NOTE: Range [0, m_nCount) are constructed.
+ // NOTE: Range [m_nCount, m_nCapacity) are not constructed.
+ // NOTE: 0 <= m_nCount && m_nCount <= m_nCapacity.
+
+ // call constructor at nIndex
+ void ConstructItemInPlace(int nIndex, const T& src)
+ {
+ new(&m_pData[nIndex]) ConstructImpl(src);
+ }
+
+ // call destructor at nIndex
+ void DestructItem(int nIndex)
+ {
+ m_pData[nIndex].~T();
+ }
+
+private:
+
+ struct ConstructImpl
+ {
+ ConstructImpl(const T& obj)
+ :m_ConstructHelper(obj)
+ {
+ }
+
+ static void *operator new(size_t, void *ptr)
+ {
+ return ptr;
+ }
+
+ static void operator delete(void *p, void* )
+ {
+ }
+
+ T m_ConstructHelper;
+ };
+
+};
+
+template <typename TKey, typename TVal>
+class CSimpleMapEqualHelper
+{
+public:
+ static bool IsEqualKey(const TKey& k1, const TKey& k2)
+ {
+ return k1 == k2;
+ }
+
+ static bool IsEqualValue(const TVal& v1, const TVal& v2)
+ {
+ return v1 == v2;
+ }
+};
+
+// This class exists for the keys and the values of no comparison.
+template <typename TKey, typename TVal>
+class CSimpleMapEqualHelperFalse
+{
+public:
+ static bool IsEqualKey(const TKey& k1, const TKey& k2)
+ {
+ ATLASSERT(FALSE);
+ return false;
+ }
+
+ static bool IsEqualValue(const TVal& v1, const TVal& v2)
+ {
+ ATLASSERT(FALSE);
+ return false;
+ }
+};
+
+template <typename TKey, typename TVal,
+ typename TEqual = CSimpleMapEqualHelper<TKey, TVal> >
+class CSimpleMap
+{
+public:
+ typedef TKey _ArrayKeyType;
+ typedef TVal _ArrayElementType;
+
+ CSimpleMap()
+ {
+ }
+
+ ~CSimpleMap()
+ {
+ }
+
+ BOOL Add(const TKey& key, const TVal& val)
+ {
+ Pair pair(key, val);
+ return m_Pairs.Add(pair);
+ }
+
+ int FindKey(const TKey& key) const
+ {
+ const int nCount = GetSize();
+ for (int nIndex = 0; nIndex < nCount; ++nIndex)
+ {
+ if (TEqual::IsEqualKey(m_Pairs[nIndex].key, key))
+ {
+ return nIndex; // success
+ }
+ }
+ return -1; // failure
+ }
+
+ int FindVal(const TVal& val) const
+ {
+ const int nCount = GetSize();
+ for (int nIndex = 0; nIndex < nCount; ++nIndex)
+ {
+ if (TEqual::IsEqualValue(m_Pairs[nIndex].val, val))
+ {
+ return nIndex; // success
+ }
+ }
+ return -1; // failure
+ }
+
+ TKey& GetKeyAt(int nIndex)
+ {
+ ATLASSERT(0 <= nIndex && nIndex < GetSize());
+ return m_Pairs[nIndex].key;
+ }
+
+ const TKey& GetKeyAt(int nIndex) const
+ {
+ ATLASSERT(0 <= nIndex && nIndex < GetSize());
+ return m_Pairs[nIndex].key;
+ }
+
+ int GetSize() const
+ {
+ return m_Pairs.GetSize();
+ }
+
+ TVal& GetValueAt(int nIndex)
+ {
+ ATLASSERT(0 <= nIndex && nIndex < GetSize());
+ return m_Pairs[nIndex].val;
+ }
+
+ const TVal& GetValueAt(int nIndex) const
+ {
+ ATLASSERT(0 <= nIndex && nIndex < GetSize());
+ return m_Pairs[nIndex].val;
+ }
+
+ TVal Lookup(const TKey& key) const
+ {
+ int nIndex = FindKey(key);
+ if (nIndex < 0)
+ return TVal();
+ return m_Pairs[nIndex].val;
+ }
+
+ BOOL Remove(const TKey& key)
+ {
+ int nIndex = FindKey(key);
+ return RemoveAt(nIndex);
+ }
+
+ void RemoveAll()
+ {
+ m_Pairs.RemoveAll();
+ }
+
+ BOOL RemoveAt(int nIndex)
+ {
+ return m_Pairs.RemoveAt(nIndex);
+ }
+
+ TKey ReverseLookup(const TVal& val) const
+ {
+ int nIndex = FindVal(val);
+ if (nIndex < 0)
+ return TKey();
+ return m_Pairs[nIndex].key;
+ }
+
+ BOOL SetAt(const TKey& key, const TVal& val)
+ {
+ int nIndex = FindKey(key);
+ if (nIndex < 0)
+ return Add(key, val);
+
+ m_Pairs[nIndex].val = val;
+ return TRUE;
+ }
+
+ BOOL SetAtIndex(int nIndex, const TKey& key, const TVal& val)
+ {
+ // boundary check
+ if (nIndex < 0 || GetSize() <= nIndex)
+ return FALSE;
+
+ m_Pairs[nIndex].key = key;
+ m_Pairs[nIndex].val = val;
+ return TRUE;
+ }
+
+protected:
+ struct Pair
+ {
+ TKey key;
+ TVal val;
+
+ Pair()
+ {
+ }
+
+ Pair(const TKey& k, const TVal& v) : key(k), val(v)
+ {
+ }
+
+ Pair(const Pair& pair) : key(pair.key), val(pair.val)
+ {
+ }
+
+ Pair& operator=(const Pair& pair)
+ {
+ key = pair.key;
+ val = pair.val;
+ return *this;
+ }
+ };
+
+ CSimpleArray<Pair, CSimpleArrayEqualHelperFalse<Pair> > m_Pairs;
+};
+
+}
+
+#endif
Propchange: trunk/reactos/sdk/lib/atl/atlsimpcoll.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/rostests/apitests/atl/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/CMakeLists.t…
==============================================================================
--- trunk/rostests/apitests/atl/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/rostests/apitests/atl/CMakeLists.txt [iso-8859-1] Thu Sep 15 19:41:03 2016
@@ -10,6 +10,8 @@
CComHeapPtr.cpp
CImage.cpp
CRegKey.cpp
+ CSimpleArray.cpp
+ CSimpleMap.cpp
CString.cpp
testlist.c
atl_apitest.rc)
Added: trunk/rostests/apitests/atl/CSimpleArray.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/CSimpleArray…
==============================================================================
--- trunk/rostests/apitests/atl/CSimpleArray.cpp (added)
+++ trunk/rostests/apitests/atl/CSimpleArray.cpp [iso-8859-1] Thu Sep 15 19:41:03 2016
@@ -0,0 +1,186 @@
+/*
+ * PROJECT: ReactOS api tests
+ * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
+ * PURPOSE: Test for CSimpleArray
+ * PROGRAMMER: Katayama Hirofumi MZ (katayama.hirofumi.mz(a)gmail.com)
+ */
+
+#ifdef __REACTOS__
+ #include <apitest.h>
+#else
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <stdarg.h>
+ int g_tests_executed = 0;
+ int g_tests_failed = 0;
+ void ok_func(const char *file, int line, bool value, const char *fmt, ...)
+ {
+ va_list va;
+ va_start(va, fmt);
+ if (!value)
+ {
+ printf("%s (%d): ", file, line);
+ vprintf(fmt, va);
+ g_tests_failed++;
+ }
+ g_tests_executed++;
+ va_end(va);
+ }
+ #undef ok
+ #define ok(value, ...) ok_func(__FILE__, __LINE__, value, __VA_ARGS__)
+ #define START_TEST(x) int main(void)
+#endif
+
+#include <atlbase.h>
+#include <atlsimpcoll.h>
+
+struct CCreature
+{
+ static int s_nCount;
+ static int s_nCopyCount;
+ CCreature()
+ {
+ CCreature::s_nCount++;
+ }
+ CCreature(const CCreature& c)
+ {
+ CCreature::s_nCount++;
+ }
+ ~CCreature()
+ {
+ CCreature::s_nCount--;
+ }
+ CCreature& operator=(const CCreature& other)
+ {
+ CCreature::s_nCopyCount++;
+ return *this;
+ }
+};
+
+int CCreature::s_nCount = 0;
+int CCreature::s_nCopyCount = 0;
+
+
+START_TEST(CSimpleArray)
+{
+ CSimpleArray<int> array1;
+
+ ok(array1.GetSize() == 0, "Expected array1's size is zero, was %d\n",
array1.GetSize());
+
+ array1.Add(123);
+
+ ok(array1.GetSize() == 1, "Expected array1's size is 1, was %d\n",
array1.GetSize());
+ ok(array1.GetData()[0] == 123, "Expected array1.GetData()[0] is 123, was
%d\n", array1.GetData()[0]);
+ ok(array1[0] == 123, "Expected array1[0] is 123, was %d\n", array1[0]);
+
+ array1.Add(456);
+
+ ok(array1.GetSize() == 2, "Expected array1's size is 2, was %d\n",
array1.GetSize());
+ ok(array1.GetData()[0] == 123, "Expected array1.GetData()[0] is 123, was
%d\n", array1.GetData()[0]);
+ ok(array1[0] == 123, "Expected array1[0] is 123, was %d\n", array1[0]);
+ ok(array1.GetData()[1] == 456, "Expected array1.GetData()[1] is 456, was
%d\n", array1.GetData()[1]);
+ ok(array1[1] == 456, "Expected array1[1] is 456, was %d\n", array1[1]);
+
+ array1.RemoveAll();
+ ok(array1.GetSize() == 0, "Expected array1's size is 0, was %d\n",
array1.GetSize());
+
+ array1.Add(1);
+ array1.Add(1);
+ array1.Add(1);
+ array1.Add(2);
+ array1.Add(2);
+ array1.Add(3);
+ ok(array1.GetSize() == 6, "Expected array1's size is 6, was %d\n",
array1.GetSize());
+
+ array1.Remove(2);
+ ok(array1.GetSize() == 5, "Expected array1's size is 5, was %d\n",
array1.GetSize());
+
+ array1.Remove(1);
+ ok(array1.GetSize() == 4, "Expected array1's size is 4, was %d\n",
array1.GetSize());
+
+ ok(array1[0] == 1, "Expected array1[0] is 1, was %d\n", array1[0]);
+ ok(array1[1] == 1, "Expected array1[1] is 1, was %d\n", array1[1]);
+ ok(array1[2] == 2, "Expected array1[2] is 2, was %d\n", array1[2]);
+ ok(array1[3] == 3, "Expected array1[3] is 3, was %d\n", array1[3]);
+
+ ok(CCreature::s_nCount == 0, "Expected CCreature::s_nCount is zero, was:
%d\n", CCreature::s_nCount);
+ ok(CCreature::s_nCopyCount == 0, "Expected CCreature::s_nCopyCount is zero, was:
%d\n", CCreature::s_nCopyCount);
+
+ CSimpleArray<CCreature> array2;
+ {
+ CCreature creature1, creature2;
+
+ ok(CCreature::s_nCount == 2, "Expected CCreature::s_nCount is 2, was:
%d\n", CCreature::s_nCount);
+ ok(CCreature::s_nCopyCount == 0, "Expected CCreature::s_nCopyCount is zero,
was: %d\n", CCreature::s_nCopyCount);
+ array2.Add(creature1);
+ ok(CCreature::s_nCount == 3, "Expected CCreature::s_nCount is 3, was:
%d\n", CCreature::s_nCount);
+ ok(CCreature::s_nCopyCount == 0, "Expected CCreature::s_nCopyCount is zero,
was: %d\n", CCreature::s_nCopyCount);
+ array2.Add(creature2);
+ ok(CCreature::s_nCount == 4, "Expected CCreature::s_nCount is 4, was:
%d\n", CCreature::s_nCount);
+ ok(CCreature::s_nCopyCount == 0, "Expected CCreature::s_nCopyCount is zero,
was: %d\n", CCreature::s_nCopyCount);
+ }
+ ok(CCreature::s_nCount == 2, "Expected CCreature::s_nCount is 2, was:
%d\n", CCreature::s_nCount);
+ ok(CCreature::s_nCopyCount == 0, "Expected CCreature::s_nCopyCount is zero, was:
%d\n", CCreature::s_nCopyCount);
+
+ {
+ CSimpleArray<CCreature> array3(array2), array4, array5;
+ ok(CCreature::s_nCount == 4, "Expected CCreature::s_nCount is 4, was:
%d\n", CCreature::s_nCount);
+ ok(CCreature::s_nCopyCount == 0, "Expected CCreature::s_nCopyCount is zero,
was: %d\n", CCreature::s_nCopyCount);
+
+ array4 = array2;
+ ok(CCreature::s_nCount == 6, "Expected CCreature::s_nCount is 6, was:
%d\n", CCreature::s_nCount);
+ ok(CCreature::s_nCopyCount == 0, "Expected CCreature::s_nCopyCount is zero,
was: %d\n", CCreature::s_nCopyCount);
+
+ CCreature creature1;
+ ok(CCreature::s_nCount == 7, "Expected CCreature::s_nCount is 7, was:
%d\n", CCreature::s_nCount);
+ ok(CCreature::s_nCopyCount == 0, "Expected CCreature::s_nCopyCount is zero,
was: %d\n", CCreature::s_nCopyCount);
+
+ array4.Add(creature1);
+ ok(CCreature::s_nCount == 8, "Expected CCreature::s_nCount is 8, was:
%d\n", CCreature::s_nCount);
+ ok(CCreature::s_nCopyCount == 0, "Expected CCreature::s_nCopyCount is zero,
was: %d\n", CCreature::s_nCopyCount);
+
+ array3 = array4;
+ ok(CCreature::s_nCount == 9, "Expected CCreature::s_nCount is 9, was:
%d\n", CCreature::s_nCount);
+ ok(CCreature::s_nCopyCount == 0, "Expected CCreature::s_nCopyCount is zero,
was: %d\n", CCreature::s_nCopyCount);
+
+ array5 = array2;
+ ok(CCreature::s_nCount == 11, "Expected CCreature::s_nCount is 11, was:
%d\n", CCreature::s_nCount);
+ ok(CCreature::s_nCopyCount == 0, "Expected CCreature::s_nCopyCount is zero,
was: %d\n", CCreature::s_nCopyCount);
+
+ array5 = array2;
+ ok(CCreature::s_nCount == 11, "Expected CCreature::s_nCount is 11, was:
%d\n", CCreature::s_nCount);
+ ok(CCreature::s_nCopyCount == 0, "Expected CCreature::s_nCopyCount is zero,
was: %d\n", CCreature::s_nCopyCount);
+ }
+ ok(CCreature::s_nCount == 2, "Expected CCreature::s_nCount is 2, was:
%d\n", CCreature::s_nCount);
+ ok(CCreature::s_nCopyCount == 0, "Expected CCreature::s_nCopyCount is zero, was:
%d\n", CCreature::s_nCopyCount);
+
+ array2.RemoveAll();
+ ok(CCreature::s_nCount == 0, "Expected CCreature::s_nCount is zero, was:
%d\n", CCreature::s_nCount);
+ ok(CCreature::s_nCopyCount == 0, "Expected CCreature::s_nCopyCount is zero, was:
%d\n", CCreature::s_nCopyCount);
+
+ array1.RemoveAll();
+ ok(array1.GetSize() == 0, "Expected array1.GetSize() is zero, was: %d\n",
array1.GetSize());
+ for (int i = 0; i < 100; ++i)
+ {
+ array1.Add(i);
+ }
+ ok(array1.GetSize() == 100, "Expected array1.GetSize() is 100, was: %d\n",
array1.GetSize());
+
+ array1.RemoveAll();
+ ok(array1.GetSize() == 0, "Expected array1.GetSize() is zero, was: %d\n",
array1.GetSize());
+ array1.Add(123);
+ array1.Add(321);
+ ok(!!array1.RemoveAt(0), "Expected RemoveAt(0) to succeed\n");
+ ok(array1.GetSize() == 1, "Expected array1.GetSize() is 1, was: %d\n",
array1.GetSize());
+ if (array1.GetSize() == 1)
+ {
+ ok(array1[0] == 321, "Expected array1[0] is 321, was %d\n",
array1[0]);
+ }
+ ok(!!array1.RemoveAt(0), "Expected RemoveAt(0) to succeed\n");
+ ok(array1.GetSize() == 0, "Expected array1.GetSize() is 0, was: %d\n",
array1.GetSize());
+
+#ifndef __REACTOS__
+ printf("CSimpleArray: %i tests executed (0 marked as todo, %i failures), 0
skipped.\n", g_tests_executed, g_tests_failed);
+ return g_tests_failed;
+#endif
+}
Propchange: trunk/rostests/apitests/atl/CSimpleArray.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/atl/CSimpleMap.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/CSimpleMap.c…
==============================================================================
--- trunk/rostests/apitests/atl/CSimpleMap.cpp (added)
+++ trunk/rostests/apitests/atl/CSimpleMap.cpp [iso-8859-1] Thu Sep 15 19:41:03 2016
@@ -0,0 +1,206 @@
+/*
+ * PROJECT: ReactOS api tests
+ * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
+ * PURPOSE: Test for CSimpleMap
+ * PROGRAMMER: Katayama Hirofumi MZ (katayama.hirofumi.mz(a)gmail.com)
+ */
+
+#ifdef __REACTOS__
+ #include <apitest.h>
+#else
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <stdarg.h>
+ int g_tests_executed = 0;
+ int g_tests_failed = 0;
+ void ok_func(const char *file, int line, bool value, const char *fmt, ...)
+ {
+ va_list va;
+ va_start(va, fmt);
+ if (!value)
+ {
+ printf("%s (%d): ", file, line);
+ vprintf(fmt, va);
+ g_tests_failed++;
+ }
+ g_tests_executed++;
+ va_end(va);
+ }
+ #undef ok
+ #define ok(value, ...) ok_func(__FILE__, __LINE__, value, __VA_ARGS__)
+ #define START_TEST(x) int main(void)
+#endif
+
+#include <atlbase.h>
+#include <atlsimpcoll.h>
+
+struct CMonster
+{
+ static int s_nCount;
+ static int s_nCopyCount;
+
+ CMonster()
+ {
+ CMonster::s_nCount++;
+ }
+ CMonster(const CMonster& c)
+ {
+ CMonster::s_nCount++;
+ }
+ ~CMonster()
+ {
+ CMonster::s_nCount--;
+ }
+ CMonster& operator=(const CMonster& other)
+ {
+ CMonster::s_nCopyCount++;
+ return *this;
+ }
+};
+
+int CMonster::s_nCount = 0;
+int CMonster::s_nCopyCount = 0;
+
+START_TEST(CSimpleMap)
+{
+ CSimpleMap<int, int> map1;
+
+ ok(map1.GetSize() == 0, "Expected map1's size is zero, was %d\n",
map1.GetSize());
+
+ map1.Add(1, 2);
+ ok(map1.GetSize() == 1, "Expected map1's size is 1, was %d\n",
map1.GetSize());
+ map1.Add(2, 3);
+ ok(map1.GetSize() == 2, "Expected map1's size is 2, was %d\n",
map1.GetSize());
+
+ ok(map1.Lookup(1) == 2, "Expected map1.Lookup(1) is 2, was %d\n",
map1.Lookup(1));
+ ok(map1.Lookup(2) == 3, "Expected map1.Lookup(2) is 3, was %d\n",
map1.Lookup(2));
+ ok(map1.Lookup(-1) == 0, "Expected map1.Lookup(-1) is 0, was %d\n",
map1.Lookup(-1));
+
+ ok(map1.ReverseLookup(2) == 1, "Expected map1.ReverseLookup(2) is 1, was
%d\n", map1.ReverseLookup(2));
+ ok(map1.ReverseLookup(3) == 2, "Expected map1.ReverseLookup(3) is 2, was
%d\n", map1.ReverseLookup(3));
+
+ ok(map1.GetKeyAt(0) == 1, "Expected map1.GetKeyAt(0) is 1, was %d\n",
map1.GetKeyAt(0));
+ ok(map1.GetKeyAt(1) == 2, "Expected map1.GetKeyAt(1) is 2, was %d\n",
map1.GetKeyAt(1));
+
+ ok(map1.GetValueAt(0) == 2, "Expected map1.GetValueAt(0) is 2, was %d\n",
map1.GetValueAt(0));
+ ok(map1.GetValueAt(1) == 3, "Expected map1.GetValueAt(1) is 3, was %d\n",
map1.GetValueAt(1));
+
+ map1.SetAt(2, 4);
+
+ ok(map1.Lookup(1) == 2, "Expected map1.Lookup(1) is 2, was %d\n",
map1.Lookup(1));
+ ok(map1.Lookup(2) == 4, "Expected map1.Lookup(2) is 4, was %d\n",
map1.Lookup(2));
+
+ ok(map1.ReverseLookup(2) == 1, "Expected map1.ReverseLookup(2) is 1, was
%d\n", map1.ReverseLookup(2));
+ ok(map1.ReverseLookup(4) == 2, "Expected map1.ReverseLookup(4) is 2, was
%d\n", map1.ReverseLookup(4));
+
+ map1.Remove(1);
+ ok(map1.GetSize() == 1, "Expected map1's size is 1, was %d\n",
map1.GetSize());
+ map1.Remove(2);
+ ok(map1.GetSize() == 0, "Expected map1's size is 0, was %d\n",
map1.GetSize());
+
+ map1.Add(1, 4);
+ ok(map1.GetSize() == 1, "Expected map1's size is 1, was %d\n",
map1.GetSize());
+ map1.Add(2, 8);
+ ok(map1.GetSize() == 2, "Expected map1's size is 2, was %d\n",
map1.GetSize());
+ map1.Add(3, 12);
+ ok(map1.GetSize() == 3, "Expected map1's size is 3, was %d\n",
map1.GetSize());
+
+ map1.RemoveAll();
+ ok(map1.GetSize() == 0, "Expected map1's size is 0, was %d\n",
map1.GetSize());
+
+ ok(CMonster::s_nCount == 0, "Expected CMonster::s_nCount is 0, was %d\n",
CMonster::s_nCount);
+ ok(CMonster::s_nCopyCount == 0, "Expected CMonster::s_nCopyCount is 0, was
%d\n", CMonster::s_nCopyCount);
+
+ CSimpleMap<CMonster, CMonster> map2;
+ ok(map2.GetSize() == 0, "Expected map2's size is zero, was %d\n",
map2.GetSize());
+
+ ok(CMonster::s_nCount == 0, "Expected CMonster::s_nCount is 0, was %d\n",
CMonster::s_nCount);
+ ok(CMonster::s_nCopyCount == 0, "Expected CMonster::s_nCopyCount is 0, was
%d\n", CMonster::s_nCopyCount);
+
+ {
+ CMonster m1;
+ ok(CMonster::s_nCount == 1, "Expected CMonster::s_nCount is 1, was
%d\n", CMonster::s_nCount);
+ ok(CMonster::s_nCopyCount == 0, "Expected CMonster::s_nCopyCount is 0, was
%d\n", CMonster::s_nCopyCount);
+
+ CMonster m2;
+ ok(CMonster::s_nCount == 2, "Expected CMonster::s_nCount is 2, was
%d\n", CMonster::s_nCount);
+ ok(CMonster::s_nCopyCount == 0, "Expected CMonster::s_nCopyCount is 0, was
%d\n", CMonster::s_nCopyCount);
+
+ map2.Add(m1, m2);
+ ok(CMonster::s_nCount == 4, "Expected CMonster::s_nCount is 4, was
%d\n", CMonster::s_nCount);
+ ok(CMonster::s_nCopyCount == 0, "Expected CMonster::s_nCopyCount is 0, was
%d\n", CMonster::s_nCopyCount);
+ }
+
+ ok(map2.GetSize() == 1, "Expected map2's size is 1, was %d\n",
map2.GetSize());
+ ok(CMonster::s_nCount == 2, "Expected CMonster::s_nCount is 2, was %d\n",
CMonster::s_nCount);
+ ok(CMonster::s_nCopyCount == 0, "Expected CMonster::s_nCopyCount is 0, was
%d\n", CMonster::s_nCopyCount);
+
+ {
+ CMonster m1;
+ ok(CMonster::s_nCount == 3, "Expected CMonster::s_nCount is 3, was
%d\n", CMonster::s_nCount);
+ ok(CMonster::s_nCopyCount == 0, "Expected CMonster::s_nCopyCount is 0, was
%d\n", CMonster::s_nCopyCount);
+
+ CMonster m2;
+ ok(CMonster::s_nCount == 4, "Expected CMonster::s_nCount is 4, was
%d\n", CMonster::s_nCount);
+ ok(CMonster::s_nCopyCount == 0, "Expected CMonster::s_nCopyCount is 0, was
%d\n", CMonster::s_nCopyCount);
+
+ map2.Add(m1, m2);
+ ok(CMonster::s_nCount == 6, "Expected CMonster::s_nCount is 6, was
%d\n", CMonster::s_nCount);
+ ok(CMonster::s_nCopyCount == 0, "Expected CMonster::s_nCopyCount is 0, was
%d\n", CMonster::s_nCopyCount);
+ }
+
+ ok(map2.GetSize() == 2, "Expected map2's size is 2, was %d\n",
map2.GetSize());
+ ok(CMonster::s_nCount == 4, "Expected CMonster::s_nCount is 4, was %d\n",
CMonster::s_nCount);
+ ok(CMonster::s_nCopyCount == 0, "Expected CMonster::s_nCopyCount is 0, was
%d\n", CMonster::s_nCopyCount);
+
+ map2.RemoveAt(0);
+ ok(CMonster::s_nCount == 2, "Expected CMonster::s_nCount is 2, was %d\n",
CMonster::s_nCount);
+ ok(map2.GetSize() == 1, "Expected map2's size is 1, was %d\n",
map2.GetSize());
+ ok(CMonster::s_nCopyCount == 0, "Expected CMonster::s_nCopyCount is 0, was
%d\n", CMonster::s_nCopyCount);
+
+ map2.RemoveAt(0);
+ ok(CMonster::s_nCount == 0, "Expected CMonster::s_nCount is 0, was %d\n",
CMonster::s_nCount);
+ ok(map2.GetSize() == 0, "Expected map2's size is 0, was %d\n",
map2.GetSize());
+ ok(CMonster::s_nCopyCount == 0, "Expected CMonster::s_nCopyCount is 0, was
%d\n", CMonster::s_nCopyCount);
+
+ CSimpleMap<int, CMonster> map3;
+ ok(map3.GetSize() == 0, "Expected map3's size is 0, was %d\n",
map3.GetSize());
+
+ CMonster m3;
+ ok(CMonster::s_nCount == 1, "Expected CMonster::s_nCount is 1, was %d\n",
CMonster::s_nCount);
+
+ map3.Add(1, m3);
+ ok(map3.GetSize() == 1, "Expected map3's size is 1, was %d\n",
map3.GetSize());
+ ok(CMonster::s_nCount == 2, "Expected CMonster::s_nCount is 2, was %d\n",
CMonster::s_nCount);
+
+ map3.Add(2, m3);
+ ok(map3.GetSize() == 2, "Expected map3's size is 2, was %d\n",
map3.GetSize());
+ ok(CMonster::s_nCount == 3, "Expected CMonster::s_nCount is 3, was %d\n",
CMonster::s_nCount);
+
+ map3.Add(3, m3);
+ ok(map3.GetSize() == 3, "Expected map3's size is 3, was %d\n",
map3.GetSize());
+ ok(CMonster::s_nCount == 4, "Expected CMonster::s_nCount is 4, was %d\n",
CMonster::s_nCount);
+
+ map3.Remove(2);
+ ok(map3.GetSize() == 2, "Expected map3's size is 2, was %d\n",
map3.GetSize());
+ ok(CMonster::s_nCount == 3, "Expected CMonster::s_nCount is 3, was %d\n",
CMonster::s_nCount);
+
+ map3.RemoveAll();
+ ok(map3.GetSize() == 0, "Expected map3's size is 0, was %d\n",
map3.GetSize());
+ ok(CMonster::s_nCount == 1, "Expected CMonster::s_nCount is 1, was %d\n",
CMonster::s_nCount);
+
+ map1.Add(1, 2);
+ ok(map1.GetSize() == 1, "Expected map1's size is 1, was %d\n",
map1.GetSize());
+ map1.Add(2, 3);
+ ok(map1.GetSize() == 2, "Expected map1's size is 2, was %d\n",
map1.GetSize());
+
+ ok(!!map1.RemoveAt(0), "Expected RemoveAt(0) to succeed\n");
+ ok(map1.GetSize() == 1, "Expected map1's size is 1, was %d\n",
map1.GetSize());
+ ok(!!map1.RemoveAt(0), "Expected RemoveAt(0) to succeed\n");
+ ok(map1.GetSize() == 0, "Expected map1's size is 0, was %d\n",
map1.GetSize());
+
+#ifndef __REACTOS__
+ printf("CSimpleMap: %i tests executed (0 marked as todo, %i failures), 0
skipped.\n", g_tests_executed, g_tests_failed);
+ return g_tests_failed;
+#endif
+}
Propchange: trunk/rostests/apitests/atl/CSimpleMap.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/atl/devenv/ATLTest.sln
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/devenv/ATLTe…
==============================================================================
--- trunk/rostests/apitests/atl/devenv/ATLTest.sln (added)
+++ trunk/rostests/apitests/atl/devenv/ATLTest.sln [iso-8859-1] Thu Sep 15 19:41:03 2016
@@ -0,0 +1,48 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.24720.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CImage",
"CImage.vcxproj", "{AE520E17-2DAE-40FF-B082-F32A7A935FB2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CSimpleArray",
"CSimpleArray.vcxproj", "{9F029341-87C2-4BFD-B1FC-D5F5B8D28D55}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CSimpleMap",
"CSimpleMap.vcxproj", "{EC560DE6-6DB3-437D-85CA-582491FE6F95}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Debug|x64.ActiveCfg = Debug|x64
+ {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Debug|x64.Build.0 = Debug|x64
+ {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Debug|x86.ActiveCfg = Debug|Win32
+ {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Debug|x86.Build.0 = Debug|Win32
+ {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Release|x64.ActiveCfg = Release|x64
+ {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Release|x64.Build.0 = Release|x64
+ {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Release|x86.ActiveCfg = Release|Win32
+ {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Release|x86.Build.0 = Release|Win32
+ {9F029341-87C2-4BFD-B1FC-D5F5B8D28D55}.Debug|x64.ActiveCfg = Debug|x64
+ {9F029341-87C2-4BFD-B1FC-D5F5B8D28D55}.Debug|x64.Build.0 = Debug|x64
+ {9F029341-87C2-4BFD-B1FC-D5F5B8D28D55}.Debug|x86.ActiveCfg = Debug|Win32
+ {9F029341-87C2-4BFD-B1FC-D5F5B8D28D55}.Debug|x86.Build.0 = Debug|Win32
+ {9F029341-87C2-4BFD-B1FC-D5F5B8D28D55}.Release|x64.ActiveCfg = Release|x64
+ {9F029341-87C2-4BFD-B1FC-D5F5B8D28D55}.Release|x64.Build.0 = Release|x64
+ {9F029341-87C2-4BFD-B1FC-D5F5B8D28D55}.Release|x86.ActiveCfg = Release|Win32
+ {9F029341-87C2-4BFD-B1FC-D5F5B8D28D55}.Release|x86.Build.0 = Release|Win32
+ {EC560DE6-6DB3-437D-85CA-582491FE6F95}.Debug|x64.ActiveCfg = Debug|x64
+ {EC560DE6-6DB3-437D-85CA-582491FE6F95}.Debug|x64.Build.0 = Debug|x64
+ {EC560DE6-6DB3-437D-85CA-582491FE6F95}.Debug|x86.ActiveCfg = Debug|Win32
+ {EC560DE6-6DB3-437D-85CA-582491FE6F95}.Debug|x86.Build.0 = Debug|Win32
+ {EC560DE6-6DB3-437D-85CA-582491FE6F95}.Release|x64.ActiveCfg = Release|x64
+ {EC560DE6-6DB3-437D-85CA-582491FE6F95}.Release|x64.Build.0 = Release|x64
+ {EC560DE6-6DB3-437D-85CA-582491FE6F95}.Release|x86.ActiveCfg = Release|Win32
+ {EC560DE6-6DB3-437D-85CA-582491FE6F95}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
Propchange: trunk/rostests/apitests/atl/devenv/ATLTest.sln
------------------------------------------------------------------------------
svn:eol-style = CRLF
Removed: trunk/rostests/apitests/atl/devenv/CImage.sln
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/devenv/CImag…
==============================================================================
--- trunk/rostests/apitests/atl/devenv/CImage.sln [iso-8859-1] (original)
+++ trunk/rostests/apitests/atl/devenv/CImage.sln (removed)
@@ -1,28 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.24720.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CImage",
"CImage.vcxproj", "{AE520E17-2DAE-40FF-B082-F32A7A935FB2}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
- Release|x64 = Release|x64
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Debug|x64.ActiveCfg = Debug|x64
- {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Debug|x64.Build.0 = Debug|x64
- {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Debug|x86.ActiveCfg = Debug|Win32
- {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Debug|x86.Build.0 = Debug|Win32
- {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Release|x64.ActiveCfg = Release|x64
- {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Release|x64.Build.0 = Release|x64
- {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Release|x86.ActiveCfg = Release|Win32
- {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Release|x86.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
Modified: trunk/rostests/apitests/atl/devenv/CImage.vcxproj
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/devenv/CImag…
==============================================================================
--- trunk/rostests/apitests/atl/devenv/CImage.vcxproj [iso-8859-1] (original)
+++ trunk/rostests/apitests/atl/devenv/CImage.vcxproj [iso-8859-1] Thu Sep 15 19:41:03
2016
@@ -27,7 +27,7 @@
<PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"
Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>v120_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"
Label="Configuration">
@@ -39,13 +39,13 @@
<PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"
Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Release|x64'"
Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>v120_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
Added: trunk/rostests/apitests/atl/devenv/CSimpleArray.vcxproj
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/devenv/CSimp…
==============================================================================
--- trunk/rostests/apitests/atl/devenv/CSimpleArray.vcxproj (added)
+++ trunk/rostests/apitests/atl/devenv/CSimpleArray.vcxproj [iso-8859-1] Thu Sep 15
19:41:03 2016
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{9F029341-87C2-4BFD-B1FC-D5F5B8D28D55}</ProjectGuid>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <Keyword>AtlProj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"
Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"
Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"
Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Release|x64'"
Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets"
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets"
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets"
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets"
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <IgnoreImportLibrary>true</IgnoreImportLibrary>
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <IgnoreImportLibrary>true</IgnoreImportLibrary>
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <IgnoreImportLibrary>true</IgnoreImportLibrary>
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <IgnoreImportLibrary>true</IgnoreImportLibrary>
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x0409</Culture>
+
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <RegisterOutput>true</RegisterOutput>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+
<PreprocessorDefinitions>_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x0409</Culture>
+
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <RegisterOutput>true</RegisterOutput>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x0409</Culture>
+
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <RegisterOutput>true</RegisterOutput>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+
<PreprocessorDefinitions>_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x0409</Culture>
+
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <RegisterOutput>true</RegisterOutput>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="../CSimpleArray.cpp">
+ <RuntimeLibrary
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MultiThreaded</RuntimeLibrary>
+ <RuntimeLibrary
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MultiThreaded</RuntimeLibrary>
+ <RuntimeLibrary
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">MultiThreadedDebug</RuntimeLibrary>
+ <RuntimeLibrary
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
+ </ClCompile>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
Propchange: trunk/rostests/apitests/atl/devenv/CSimpleArray.vcxproj
------------------------------------------------------------------------------
svn:eol-style = CRLF
Added: trunk/rostests/apitests/atl/devenv/CSimpleMap.vcxproj
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/devenv/CSimp…
==============================================================================
--- trunk/rostests/apitests/atl/devenv/CSimpleMap.vcxproj (added)
+++ trunk/rostests/apitests/atl/devenv/CSimpleMap.vcxproj [iso-8859-1] Thu Sep 15 19:41:03
2016
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{EC560DE6-6DB3-437D-85CA-582491FE6F95}</ProjectGuid>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <Keyword>AtlProj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"
Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"
Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"
Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Release|x64'"
Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets"
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets"
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets"
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets"
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <IgnoreImportLibrary>true</IgnoreImportLibrary>
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <IgnoreImportLibrary>true</IgnoreImportLibrary>
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <IgnoreImportLibrary>true</IgnoreImportLibrary>
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <IgnoreImportLibrary>true</IgnoreImportLibrary>
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x0409</Culture>
+
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <RegisterOutput>true</RegisterOutput>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+
<PreprocessorDefinitions>_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x0409</Culture>
+
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <RegisterOutput>true</RegisterOutput>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x0409</Culture>
+
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <RegisterOutput>true</RegisterOutput>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+
<PreprocessorDefinitions>_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x0409</Culture>
+
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <RegisterOutput>true</RegisterOutput>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="../CSimpleMap.cpp">
+ <RuntimeLibrary
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MultiThreaded</RuntimeLibrary>
+ <RuntimeLibrary
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MultiThreaded</RuntimeLibrary>
+ <RuntimeLibrary
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">MultiThreadedDebug</RuntimeLibrary>
+ <RuntimeLibrary
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
+ </ClCompile>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
Propchange: trunk/rostests/apitests/atl/devenv/CSimpleMap.vcxproj
------------------------------------------------------------------------------
svn:eol-style = CRLF
Modified: trunk/rostests/apitests/atl/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/testlist.c?r…
==============================================================================
--- trunk/rostests/apitests/atl/testlist.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/atl/testlist.c [iso-8859-1] Thu Sep 15 19:41:03 2016
@@ -6,6 +6,8 @@
extern void func_CComHeapPtr(void);
extern void func_CImage(void);
extern void func_CRegKey(void);
+extern void func_CSimpleArray(void);
+extern void func_CSimpleMap(void);
extern void func_CString(void);
const struct test winetest_testlist[] =
@@ -15,6 +17,8 @@
{ "CComHeapPtr", func_CComHeapPtr },
{ "CImage", func_CImage },
{ "CRegKey", func_CRegKey },
+ { "CSimpleArray", func_CSimpleArray },
+ { "CSimpleMap", func_CSimpleMap },
{ "CString", func_CString },
{ 0, 0 }
};