Skip to content

Commit

Permalink
adjust test code
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangjipeng committed Jan 7, 2025
1 parent fa15e4a commit d49bcde
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
15 changes: 1 addition & 14 deletions unittest/pod_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,6 @@ struct data_test
double d;
};

volatile int tmp;
static int dummy[4096000];
static void clear_cache(void)
{
int sum = 0;
for(int i=0; i<4096000; i++)
dummy[i] = 2;
for(int i=0; i<4096000; i++)
sum += dummy[i];

tmp = sum;
}

TEST(Pod_Vector, CreateAndDestroy)
{
pod_vector<unsigned int> iv;
Expand Down Expand Up @@ -228,7 +215,7 @@ TEST(Block_Allocater, BlockBaseAllocater)
TEST(Pod_Array, CreateAndInitialize)
{
pod_array<unsigned int> iv;
pod_array<unsigned int> sv;
pod_array<unsigned int> sv = iv;

EXPECT_EQ(0, (int)iv.size());
EXPECT_EQ(0, (int)sv.size());
Expand Down
15 changes: 13 additions & 2 deletions unittest/test.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
#include "test.h"

volatile int tmp;
static int dummy[4096000];
void clear_dcache(void)
{
int sum = 0;
for(int i=0; i<4096000; i++)
dummy[i] = 2;
for(int i=0; i<4096000; i++)
sum += dummy[i];

tmp = sum;
}

TEST(SystemDeathTest, Init)
{
printf("picasso initialize\n");
Expand All @@ -9,8 +22,6 @@ TEST(SystemDeathTest, Init)
ASSERT_EQ(STATUS_SUCCEED, ps_last_status());
}



TEST(System, Shutdown)
{
printf("picasso shutdown\n");
Expand Down
1 change: 1 addition & 0 deletions unittest/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
#include "picasso.h"
#include "gtest/gtest.h"

void clear_dcache(void);
#endif

0 comments on commit d49bcde

Please sign in to comment.