From dbf6113742197436e6f29fa1f22cb3e492104d98 Mon Sep 17 00:00:00 2001 From: "HuYingzhuo(hugo/hyzboy)" Date: Wed, 9 Aug 2023 16:53:45 +0800 Subject: [PATCH] new Queue<>,new QueueTest.cpp,test OK! --- CMakeLists.txt | 2 +- android/CMakeLists.txt | 2 +- datatype/LifetimeTest.cpp | 6 +- datatype/QueueTest.cpp | 125 +++++++++++++++++++++++++++++++++++--- 4 files changed, 123 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 111b671..83ab21f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,7 @@ add_executable(StackTest datatype/StackTest.cpp) cm_example_project("DataType" StackTest) add_executable(QueueTest datatype/QueueTest.cpp) -cm_example_project("DataType" QueueTest) +set_property(TARGET QueueTest PROPERTY FOLDER "CM/Examples/DataType") #################################################################################################### diff --git a/android/CMakeLists.txt b/android/CMakeLists.txt index 66a6838..4ee2001 100644 --- a/android/CMakeLists.txt +++ b/android/CMakeLists.txt @@ -38,7 +38,7 @@ add_executable(AndroidDeviceAnalysis AndroidDeviceAnalysis/main.cpp AndroidDeviceAnalysis/GameRecord.h AndroidDeviceAnalysis/GameRecord.cpp AndroidDeviceAnalysis/AndroidDeviceRecord.cpp - AndroidDeviceAnalysis/GetDeviceLevel.cpp + AndroidDeviceAnalysis/GPUDeviceRecord.cpp # AndroidDeviceAnalysis/ExportReport.cpp ${ADA_LOAD_GAME_RECORD_SOURCE}) diff --git a/datatype/LifetimeTest.cpp b/datatype/LifetimeTest.cpp index d761f69..fe147db 100644 --- a/datatype/LifetimeTest.cpp +++ b/datatype/LifetimeTest.cpp @@ -80,13 +80,13 @@ public: } }; -template class TestRawArray:public TestArray> +template class TestRawArray:public TestArray> { - RawLifetimeCallback life_cb; + DataLifetimeCallback life_cb; public: - TestRawArray():TestArray>(&life_cb){} + TestRawArray():TestArray>(&life_cb){} ~TestRawArray()=default; }; diff --git a/datatype/QueueTest.cpp b/datatype/QueueTest.cpp index 2fb8f0c..dc26ff4 100644 --- a/datatype/QueueTest.cpp +++ b/datatype/QueueTest.cpp @@ -4,8 +4,12 @@ using namespace hgl; using namespace std; -void TestQueue() +void TestQueueOrdered() { + cout< tab; int i; @@ -30,17 +34,110 @@ void TestQueue() cout<<"Queue Count: "< tab; + int i; + int val; + + for(i=0;i<20;i++) + { + if(rand()&1) + { + if(tab.Pop(val)) + cout<<"pop "< ui_queue; + + for(uint i=0;i tab; int i; for(i=0;i<10;i++) { - tab.Push(new QueueTestObject(i)); + QueueTestObject *obj=new QueueTestObject; + + obj->Set(i); + + tab.Push(obj); } cout<<"Queue Count: "<