This source file includes following definitions.
- TEST
- TEST
#include "net/quic/quic_utils_chromium.h"
#include <map>
#include "testing/gtest/include/gtest/gtest.h"
using std::map;
namespace net {
namespace test {
namespace {
TEST(QuicUtilsChromiumTest, FindOrNullTest) {
map<int, int> m;
m[0] = 2;
int* p1 = FindOrNull(m, 0);
CHECK_EQ(*p1, 2);
++(*p1);
const map<int, int>& const_m = m;
const int* p2 = FindOrNull(const_m, 0);
CHECK_EQ(*p2, 3);
CHECK(FindOrNull(m, 1) == NULL);
}
TEST(QuicUtilsChromiumTest, FindOrDieTest) {
std::map<int, int> m;
m[10] = 15;
EXPECT_EQ(15, FindOrDie(m, 10));
FindOrDie(m, 10) = 20;
EXPECT_EQ(20, FindOrDie(m, 10));
const map<int, int>& const_m = m;
EXPECT_EQ(20, FindOrDie(const_m, 10));
}
}
}
}