mirror of
https://github.com/openappsec/openappsec.git
synced 2025-09-29 19:24:26 +03:00
sync code
This commit is contained in:
@@ -151,10 +151,10 @@ TEST(TempCaching, capacity)
|
||||
cache.createEntry(3);
|
||||
cache.createEntry(4);
|
||||
|
||||
EXPECT_EQ(cache.size(), 5);
|
||||
EXPECT_EQ(cache.capacity(), 0);
|
||||
EXPECT_EQ(cache.size(), 5u);
|
||||
EXPECT_EQ(cache.capacity(), 0u);
|
||||
cache.capacity(3);
|
||||
EXPECT_EQ(cache.size(), 3);
|
||||
EXPECT_EQ(cache.size(), 3u);
|
||||
EXPECT_FALSE(cache.doesKeyExists(0));
|
||||
EXPECT_FALSE(cache.doesKeyExists(1));
|
||||
EXPECT_TRUE(cache.doesKeyExists(2));
|
||||
@@ -162,7 +162,7 @@ TEST(TempCaching, capacity)
|
||||
EXPECT_TRUE(cache.doesKeyExists(4));
|
||||
|
||||
cache.createEntry(5);
|
||||
EXPECT_EQ(cache.size(), 3);
|
||||
EXPECT_EQ(cache.size(), 3u);
|
||||
EXPECT_FALSE(cache.doesKeyExists(2));
|
||||
EXPECT_TRUE(cache.doesKeyExists(3));
|
||||
EXPECT_TRUE(cache.doesKeyExists(4));
|
||||
@@ -170,7 +170,7 @@ TEST(TempCaching, capacity)
|
||||
|
||||
cache.capacity(0);
|
||||
cache.createEntry(6);
|
||||
EXPECT_EQ(cache.size(), 4);
|
||||
EXPECT_EQ(cache.size(), 4u);
|
||||
EXPECT_TRUE(cache.doesKeyExists(3));
|
||||
EXPECT_TRUE(cache.doesKeyExists(4));
|
||||
EXPECT_TRUE(cache.doesKeyExists(5));
|
||||
@@ -178,7 +178,7 @@ TEST(TempCaching, capacity)
|
||||
|
||||
cache.deleteEntry(5);
|
||||
cache.capacity(2);
|
||||
EXPECT_EQ(cache.size(), 2);
|
||||
EXPECT_EQ(cache.size(), 2u);
|
||||
EXPECT_TRUE(cache.doesKeyExists(4));
|
||||
EXPECT_TRUE(cache.doesKeyExists(6));
|
||||
}
|
||||
|
@@ -161,6 +161,7 @@ public:
|
||||
public:
|
||||
MyValue(int _x) : x(_x) { addObj(this); }
|
||||
MyValue(const MyValue &other) : x(other.x) { addObj(this); }
|
||||
MyValue & operator=(const MyValue &other) = default;
|
||||
~MyValue() { delObj(this); }
|
||||
bool operator==(const MyValue &other) const { return x==other.x; }
|
||||
bool operator!=(const MyValue &other) const { return x!=other.x; }
|
||||
@@ -208,9 +209,9 @@ TEST_F(MaybeAssignments, ValValRval)
|
||||
Maybe<MyValue, MyValue> m(MyValue(1));
|
||||
|
||||
// Change the value
|
||||
EXPECT_EQ(1, m->x);
|
||||
EXPECT_EQ(m->x, 1);
|
||||
m = 2;
|
||||
EXPECT_EQ(2, m->x);
|
||||
EXPECT_EQ(m->x, 2);
|
||||
}
|
||||
|
||||
TEST_F(MaybeAssignments, ValValLval)
|
||||
|
Reference in New Issue
Block a user