ref: 8d444f561de5848320e1a502de3474884e626f51
parent: d30fec558e691547950bff755849c1ffb7fe744d
author: sijchen@cisco.com <sijchen@cisco.com>
date: Tue Mar 7 06:02:19 EST 2017
remove WelsCircleQueue
--- a/codec/build/iOS/common/common.xcodeproj/project.pbxproj
+++ b/codec/build/iOS/common/common.xcodeproj/project.pbxproj
@@ -49,7 +49,6 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
- 0DB71EF31BAB273500EABC51 /* WelsCircleQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WelsCircleQueue.h; sourceTree = "<group>"; };
0DD32A851B467902009181A1 /* WelsThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WelsThread.cpp; sourceTree = "<group>"; };
0DD32A871B467911009181A1 /* WelsTaskThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WelsTaskThread.cpp; sourceTree = "<group>"; };
0DD32A8E1B467B83009181A1 /* WelsLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WelsLock.h; sourceTree = "<group>"; };
@@ -147,7 +146,6 @@
5BD896B81A7B837700D32B7D /* memory_align.h */,
4C3406C118D96EA600DFA14A /* typedefs.h */,
5BA8F2BE19603F3500011CE4 /* wels_common_defs.h */,
- 0DB71EF31BAB273500EABC51 /* WelsCircleQueue.h */,
0DEA477E1BB36FE100ADD134 /* WelsList.h */,
0DD32A8E1B467B83009181A1 /* WelsLock.h */,
0DD32A8F1B467C73009181A1 /* WelsTask.h */,
--- a/codec/common/inc/WelsCircleQueue.h
+++ /dev/null
@@ -1,187 +1,0 @@
-/*!
- * \copy
- * Copyright (c) 2009-2015, Cisco Systems
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- *
- * \file WelsCircleQueue.h
- *
- * \brief for the queue function needed in ThreadPool
- *
- * \date 9/27/2015 Created
- *
- *************************************************************************************
- */
-
-
-#ifndef _WELS_CIRCLE_QUEUE_H_
-#define _WELS_CIRCLE_QUEUE_H_
-
-#include "typedefs.h"
-#include <stdlib.h>
-
-namespace WelsCommon {
-
-template<typename TNodeType>
-class CWelsCircleQueue {
- public:
- CWelsCircleQueue() {
- m_iMaxNodeCount = 50;
- m_pCurrentQueue = NULL;
- //here using array to simulate list is to avoid the frequent malloc/free of Nodes which may cause fragmented memory
- m_iCurrentListStart = m_iCurrentListEnd = 0;
- };
- ~CWelsCircleQueue() {
- if (m_pCurrentQueue)
- free (m_pCurrentQueue);
- };
-
- int32_t size() {
- return ((m_iCurrentListEnd >= m_iCurrentListStart)
- ? (m_iCurrentListEnd - m_iCurrentListStart)
- : (m_iMaxNodeCount - m_iCurrentListStart + m_iCurrentListEnd));
- }
-
- int32_t push_back (TNodeType* pNode) {
- if (NULL == m_pCurrentQueue) {
- m_pCurrentQueue = static_cast<TNodeType**> (malloc (m_iMaxNodeCount * sizeof (TNodeType*)));
- if (NULL == m_pCurrentQueue)
- return 1;
- }
-
- if ((NULL != pNode) && (find (pNode))) { //not checking NULL for easier testing
- return 1;
- }
- return InternalPushBack (pNode);
- }
-
- bool find (TNodeType* pNode) {
- if (size() > 0) {
- if (m_iCurrentListEnd > m_iCurrentListStart) {
- for (int32_t idx = m_iCurrentListStart; idx < m_iCurrentListEnd; idx++) {
- if (pNode == m_pCurrentQueue[idx]) {
- return true;
- }
- }
- } else {
- for (int32_t idx = m_iCurrentListStart; idx < m_iMaxNodeCount; idx++) {
- if (pNode == m_pCurrentQueue[idx]) {
- return true;
- }
- }
- for (int32_t idx = 0; idx < m_iCurrentListEnd; idx++) {
- if (pNode == m_pCurrentQueue[idx]) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- void pop_front() {
- if (size() > 0) {
- m_pCurrentQueue[m_iCurrentListStart] = NULL;
- m_iCurrentListStart = ((m_iCurrentListStart < (m_iMaxNodeCount - 1))
- ? (m_iCurrentListStart + 1)
- : 0);
- }
- }
-
- TNodeType* begin() {
- if (size() > 0) {
- return m_pCurrentQueue[m_iCurrentListStart];
- }
- return NULL;
- }
-
- TNodeType* GetIndexNode (const int32_t iIdx) {
- if (size() > 0) {
- if ((iIdx + m_iCurrentListStart) < m_iMaxNodeCount) {
- return m_pCurrentQueue[m_iCurrentListStart + iIdx];
- } else {
- return m_pCurrentQueue[m_iCurrentListStart + iIdx - m_iMaxNodeCount];
- }
- }
- return NULL;
- }
-
- private:
- int32_t InternalPushBack (TNodeType* pNode) {
- m_pCurrentQueue[m_iCurrentListEnd] = pNode;
- m_iCurrentListEnd ++;
-
- if (m_iCurrentListEnd == m_iMaxNodeCount) {
- m_iCurrentListEnd = 0;
- }
- if (m_iCurrentListEnd == m_iCurrentListStart) {
- int32_t ret = ExpandQueue();
- if (ret) {
- return 1;
- }
- }
- return 0;
- }
-
- int32_t ExpandQueue() {
- TNodeType** tmpCurrentTaskQueue = static_cast<TNodeType**> (malloc (m_iMaxNodeCount * 2 * sizeof (TNodeType*)));
- if (tmpCurrentTaskQueue == NULL) {
- return 1;
- }
-
- memcpy (tmpCurrentTaskQueue,
- (m_pCurrentQueue + m_iCurrentListStart),
- (m_iMaxNodeCount - m_iCurrentListStart)*sizeof (TNodeType*));
- if (m_iCurrentListEnd > 0) {
- memcpy (tmpCurrentTaskQueue + m_iMaxNodeCount - m_iCurrentListStart,
- m_pCurrentQueue,
- m_iCurrentListEnd * sizeof (TNodeType*));
- }
-
- free (m_pCurrentQueue);
-
- m_pCurrentQueue = tmpCurrentTaskQueue;
- m_iCurrentListEnd = m_iMaxNodeCount;
- m_iCurrentListStart = 0;
- m_iMaxNodeCount = m_iMaxNodeCount * 2;
-
- return 0;
- }
- int32_t m_iCurrentListStart;
- int32_t m_iCurrentListEnd;
- int32_t m_iMaxNodeCount;
- TNodeType** m_pCurrentQueue;
-};
-
-}
-
-
-#endif
-
-
-
--- a/codec/common/inc/WelsThreadPool.h
+++ b/codec/common/inc/WelsThreadPool.h
@@ -45,7 +45,6 @@
#include <stdio.h>
#include "WelsTask.h"
#include "WelsTaskThread.h"
-#include "WelsCircleQueue.h"
#include "WelsList.h"
namespace WelsCommon {
@@ -104,8 +103,8 @@
static CWelsLock m_cInitLock;
static int32_t m_iMaxThreadNum;
- CWelsCircleQueue<IWelsTask>* m_cWaitedTasks;
- CWelsCircleQueue<CWelsTaskThread>* m_cIdleThreads;
+ CWelsNonDuplicatedList<IWelsTask>* m_cWaitedTasks;
+ CWelsNonDuplicatedList<CWelsTaskThread>* m_cIdleThreads;
CWelsList<CWelsTaskThread>* m_cBusyThreads;
CWelsLock m_cLockPool;
--- a/codec/common/src/WelsThreadPool.cpp
+++ b/codec/common/src/WelsThreadPool.cpp
@@ -142,8 +142,8 @@
CWelsAutoLock cLock (m_cLockPool);
- m_cWaitedTasks = new CWelsCircleQueue<IWelsTask>();
- m_cIdleThreads = new CWelsCircleQueue<CWelsTaskThread>();
+ m_cWaitedTasks = new CWelsNonDuplicatedList<IWelsTask>();
+ m_cIdleThreads = new CWelsNonDuplicatedList<CWelsTaskThread>();
m_cBusyThreads = new CWelsList<CWelsTaskThread>();
if (NULL == m_cWaitedTasks || NULL == m_cIdleThreads || NULL == m_cBusyThreads) {
return WELS_THREAD_ERROR_GENERAL;
--- a/codec/encoder/core/inc/wels_task_management.h
+++ b/codec/encoder/core/inc/wels_task_management.h
@@ -67,9 +67,9 @@
class CWelsTaskManageBase : public IWelsTaskManage, public WelsCommon::IWelsTaskSink {
public:
- typedef CWelsCircleQueue<CWelsBaseTask> TASKLIST_TYPE;
+ typedef CWelsNonDuplicatedList<CWelsBaseTask> TASKLIST_TYPE;
//typedef std::pair<int, int> SLICE_BOUNDARY_PAIR;
- //typedef CWelsCircleQueue<SLICE_BOUNDARY_PAIR> SLICE_PAIR_LIST;
+ //typedef CWelsList<SLICE_BOUNDARY_PAIR> SLICE_PAIR_LIST;
CWelsTaskManageBase();
virtual ~ CWelsTaskManageBase();
--- a/codec/encoder/core/src/wels_task_management.cpp
+++ b/codec/encoder/core/src/wels_task_management.cpp
@@ -149,7 +149,7 @@
for (int idx = 0; idx < kiTaskCount; idx++) {
pTask = WELS_NEW_OP (CWelsUpdateMbMapTask (this, pEncCtx, idx), CWelsUpdateMbMapTask);
WELS_VERIFY_RETURN_IF (ENC_RETURN_MEMALLOCERR, NULL == pTask)
- WELS_VERIFY_RETURN_IF (ENC_RETURN_MEMALLOCERR, 0 != m_cPreEncodingTaskList[kiCurDid]->push_back (pTask));
+ WELS_VERIFY_RETURN_IF (ENC_RETURN_MEMALLOCERR, true != m_cPreEncodingTaskList[kiCurDid]->push_back (pTask));
}
for (int idx = 0; idx < kiTaskCount; idx++) {
@@ -164,7 +164,7 @@
}
}
WELS_VERIFY_RETURN_IF (ENC_RETURN_MEMALLOCERR, NULL == pTask)
- WELS_VERIFY_RETURN_IF (ENC_RETURN_MEMALLOCERR, 0 != m_cEncodingTaskList[kiCurDid]->push_back (pTask) );
+ WELS_VERIFY_RETURN_IF (ENC_RETURN_MEMALLOCERR, true != m_cEncodingTaskList[kiCurDid]->push_back (pTask) );
}
//fprintf(stdout, "CWelsTaskManageBase CreateTasks m_iThreadNum %d kiTaskCount=%d\n", m_iThreadNum, kiTaskCount);
@@ -224,7 +224,7 @@
int32_t iCurrentTaskCount = m_iWaitTaskNum; //if directly use m_iWaitTaskNum in the loop make cause sync problem
int32_t iIdx = 0;
while (iIdx < iCurrentTaskCount) {
- m_pThreadPool->QueueTask (pTargetTaskList->GetIndexNode (iIdx));
+ m_pThreadPool->QueueTask (pTargetTaskList->getNode (iIdx));
iIdx ++;
}
WelsEventWait (&m_hTaskEvent,&m_hEventMutex);
--- a/test/common/CWelsCircleQueue.cpp
+++ /dev/null
@@ -1,243 +1,0 @@
-#include <gtest/gtest.h>
-#include "WelsCircleQueue.h"
-#include "WelsTaskThread.h"
-
-using namespace WelsCommon;
-
-TEST (CWelsCircleQueue, CWelsCircleQueueOne) {
- CWelsCircleQueue<IWelsTask> cTaskList;
- IWelsTask* pTask = NULL;
-
- for (int i = 0; i < 60; i++) {
- cTaskList.push_back (pTask);
- EXPECT_TRUE (1 == cTaskList.size()) << "after push size=" << cTaskList.size() ;
-
- cTaskList.pop_front();
- EXPECT_TRUE (0 == cTaskList.size()) << "after pop size=" << cTaskList.size() ;
- }
-}
-
-TEST (CWelsCircleQueue, CWelsCircleQueueTen) {
- CWelsCircleQueue<IWelsTask> cTaskList;
- IWelsTask* pTask = NULL;
-
- for (int j = 0; j < 10; j++) {
-
- for (int i = 0; i < 10; i++) {
- EXPECT_TRUE (i == cTaskList.size()) << "before push size=" << cTaskList.size() ;
- cTaskList.push_back (pTask);
- }
- EXPECT_TRUE (10 == cTaskList.size()) << "after push size=" << cTaskList.size() ;
-
-
- for (int i = 9; i >= 0; i--) {
- cTaskList.pop_front();
- EXPECT_TRUE (i == cTaskList.size()) << "after pop size=" << cTaskList.size() ;
- }
- }
-}
-
-TEST (CWelsCircleQueue, CWelsCircleQueueExpand) {
- CWelsCircleQueue<IWelsTask> cTaskList;
- IWelsTask* pTask = NULL;
-
- const int kiIncreaseNum = (rand() % 65535) + 1;
- const int kiDecreaseNum = rand() % kiIncreaseNum;
-
- for (int j = 0; j < 10; j++) {
-
- for (int i = 0; i < kiIncreaseNum; i++) {
- cTaskList.push_back (pTask);
- }
- EXPECT_TRUE (kiIncreaseNum + j * (kiIncreaseNum - kiDecreaseNum) == cTaskList.size()) << "after push size=" <<
- cTaskList.size() ;
-
- for (int i = kiDecreaseNum; i > 0; i--) {
- cTaskList.pop_front();
- }
- EXPECT_TRUE ((j + 1) * (kiIncreaseNum - kiDecreaseNum) == cTaskList.size()) << "after pop size=" << cTaskList.size() ;
- }
-}
-
-TEST (CWelsCircleQueue, CWelsCircleQueueOverPop) {
- CWelsCircleQueue<IWelsTask> cTaskList;
- IWelsTask* pTask = NULL;
-
- const int kiDecreaseNum = (rand() % 65535) + 1;
- const int kiIncreaseNum = rand() % kiDecreaseNum;
-
- EXPECT_TRUE (0 == cTaskList.size());
- cTaskList.pop_front();
- EXPECT_TRUE (0 == cTaskList.size());
-
- for (int i = 0; i < kiIncreaseNum; i++) {
- cTaskList.push_back (pTask);
- }
-
- for (int i = kiDecreaseNum; i > 0; i--) {
- cTaskList.pop_front();
- }
-
- EXPECT_TRUE (0 == cTaskList.size());
-}
-
-TEST (CWelsCircleQueue, CWelsCircleQueueOnDuplication) {
- int32_t a, b, c;
- CWelsCircleQueue<int32_t> cThreadQueue;
- //CWelsCircleQueue<IWelsTask> cThreadQueue;
- int32_t* pObject1 = &a;
- int32_t* pObject2 = &b;
- int32_t* pObject3 = &c;
-
- //initial adding
- EXPECT_TRUE (0 == cThreadQueue.push_back (pObject1));
- EXPECT_TRUE (0 == cThreadQueue.push_back (pObject2));
- EXPECT_TRUE (0 == cThreadQueue.push_back (pObject3));
- EXPECT_TRUE (3 == cThreadQueue.size());
-
- //try failed adding
- EXPECT_FALSE (0 == cThreadQueue.push_back (pObject3));
- EXPECT_TRUE (3 == cThreadQueue.size());
-
- //try pop
- EXPECT_TRUE (pObject1 == cThreadQueue.begin());
- cThreadQueue.pop_front();
- EXPECT_TRUE (2 == cThreadQueue.size());
-
- //try what currently in
- EXPECT_TRUE (cThreadQueue.find (pObject2));
- EXPECT_FALSE (0 == cThreadQueue.push_back (pObject2));
- EXPECT_TRUE (cThreadQueue.find (pObject3));
- EXPECT_FALSE (0 == cThreadQueue.push_back (pObject3));
- EXPECT_TRUE (2 == cThreadQueue.size());
-
- //add back
- EXPECT_TRUE (0 == cThreadQueue.push_back (pObject1));
- EXPECT_TRUE (3 == cThreadQueue.size());
-
- //another pop
- EXPECT_TRUE (pObject2 == cThreadQueue.begin());
- cThreadQueue.pop_front();
- cThreadQueue.pop_front();
- EXPECT_TRUE (1 == cThreadQueue.size());
-
- EXPECT_FALSE (0 == cThreadQueue.push_back (pObject1));
- EXPECT_TRUE (1 == cThreadQueue.size());
-
- EXPECT_TRUE (0 == cThreadQueue.push_back (pObject3));
- EXPECT_TRUE (2 == cThreadQueue.size());
-
- //clean-up
- while (NULL != cThreadQueue.begin()) {
- cThreadQueue.pop_front();
- }
- EXPECT_TRUE (0 == cThreadQueue.size());
-}
-
-#ifndef __APPLE__
-TEST (CWelsCircleQueue, CWelsCircleQueueOnThread) {
- CWelsCircleQueue<CWelsTaskThread> cThreadQueue;
- CWelsTaskThread* pTaskThread1 = new CWelsTaskThread (NULL); //this initialization seemed making prob on osx?
- EXPECT_TRUE (NULL != pTaskThread1);
- CWelsTaskThread* pTaskThread2 = new CWelsTaskThread (NULL);
- EXPECT_TRUE (NULL != pTaskThread2);
- CWelsTaskThread* pTaskThread3 = new CWelsTaskThread (NULL);
- EXPECT_TRUE (NULL != pTaskThread3);
-
- //initial adding
- EXPECT_TRUE (0 == cThreadQueue.push_back (pTaskThread1));
- EXPECT_TRUE (0 == cThreadQueue.push_back (pTaskThread2));
- EXPECT_TRUE (0 == cThreadQueue.push_back (pTaskThread3));
- EXPECT_TRUE (3 == cThreadQueue.size());
-
- //try failed adding
- EXPECT_FALSE (0 == cThreadQueue.push_back (pTaskThread3));
- EXPECT_TRUE (3 == cThreadQueue.size());
-
- //try pop
- EXPECT_TRUE (pTaskThread1 == cThreadQueue.begin());
- cThreadQueue.pop_front();
- EXPECT_TRUE (2 == cThreadQueue.size());
-
- //try what currently in
- EXPECT_TRUE (cThreadQueue.find (pTaskThread2));
- EXPECT_FALSE (0 == cThreadQueue.push_back (pTaskThread2));
- EXPECT_TRUE (cThreadQueue.find (pTaskThread3));
- EXPECT_FALSE (0 == cThreadQueue.push_back (pTaskThread3));
- EXPECT_TRUE (2 == cThreadQueue.size());
-
- //add back
- EXPECT_TRUE (0 == cThreadQueue.push_back (pTaskThread1));
- EXPECT_TRUE (3 == cThreadQueue.size());
-
- //another pop
- EXPECT_TRUE (pTaskThread2 == cThreadQueue.begin());
- cThreadQueue.pop_front();
- cThreadQueue.pop_front();
- EXPECT_TRUE (1 == cThreadQueue.size());
-
- EXPECT_FALSE (0 == cThreadQueue.push_back (pTaskThread1));
- EXPECT_TRUE (1 == cThreadQueue.size());
-
- EXPECT_TRUE (0 == cThreadQueue.push_back (pTaskThread3));
- EXPECT_TRUE (2 == cThreadQueue.size());
-
- //clean-up
- while (NULL != cThreadQueue.begin()) {
- cThreadQueue.pop_front();
- }
- EXPECT_TRUE (0 == cThreadQueue.size());
-
- delete pTaskThread1;
- delete pTaskThread2;
- delete pTaskThread3;
-}
-#endif
-
-
-TEST (CWelsCircleQueue, CWelsCircleQueueReadWithIdx) {
- CWelsCircleQueue<int32_t> cThreadQueue;
- const int kiIncreaseNum = (rand() % 1000) + 1;
- const int kiDecreaseNum = rand() % kiIncreaseNum;
-
- int32_t* pInput = static_cast<int32_t*> (malloc (kiIncreaseNum * 10 * sizeof (int32_t)));
- if (!pInput) {
- return;
- }
- for (int32_t i = 0; i < kiIncreaseNum * 10; i++) {
- pInput[i] = i;
- }
-
- for (int j = 0; j < 10; j++) {
- const int iBias = j * (kiIncreaseNum - kiDecreaseNum);
- for (int i = 0; i < kiIncreaseNum; i++) {
- cThreadQueue.push_back (&pInput[i + kiIncreaseNum * j]);
- }
- EXPECT_TRUE (kiIncreaseNum + iBias == cThreadQueue.size()) << "after push size=" <<
- cThreadQueue.size() ;
-
- EXPECT_TRUE ((kiDecreaseNum * j) == * (cThreadQueue.begin()));
-
- for (int i = 0; i < kiIncreaseNum; i++) {
- EXPECT_TRUE ((i + kiIncreaseNum * j) == * (cThreadQueue.GetIndexNode (i + iBias)));
- }
- for (int i = 0; i < cThreadQueue.size(); i++) {
- EXPECT_TRUE ((i + kiDecreaseNum * j) == * (cThreadQueue.GetIndexNode (i)));
- }
-
- for (int i = kiDecreaseNum; i > 0; i--) {
- cThreadQueue.pop_front();
- }
- EXPECT_TRUE ((j + 1) * (kiIncreaseNum - kiDecreaseNum) == cThreadQueue.size()) << "after pop size=" <<
- cThreadQueue.size() ;
-
- EXPECT_TRUE ((kiDecreaseNum * (j + 1)) == * (cThreadQueue.begin()));
- }
-
- //clean-up
- while (NULL != cThreadQueue.begin()) {
- cThreadQueue.pop_front();
- }
- EXPECT_TRUE (0 == cThreadQueue.size());
- free (pInput);
-}
--- a/test/common/targets.mk
+++ b/test/common/targets.mk
@@ -1,6 +1,5 @@
COMMON_UNITTEST_SRCDIR=test/common
COMMON_UNITTEST_CPP_SRCS=\
- $(COMMON_UNITTEST_SRCDIR)/CWelsCircleQueue.cpp\
$(COMMON_UNITTEST_SRCDIR)/CWelsListTest.cpp\
$(COMMON_UNITTEST_SRCDIR)/ExpandPicture.cpp\
$(COMMON_UNITTEST_SRCDIR)/WelsThreadPoolTest.cpp\