23 TEST(TraceEventTest, IntegralDataIntegralValue) {
33 TEST(TraceEventTest, IntegralDataStringValue) {
45 TEST(TraceEventTest, IntegralDataVectorValue) {
57 TEST(TraceEventTest, StringDataIntegralValueConvertible) {
68 TEST(TraceEventTest, StringDataIntegralValueNonConvertible) {
78 TEST(TraceEventTest, StringDataStringValue) {
89 TEST(TraceEventTest, StringDataVectorValue) {
101 TEST(TraceEventTest, VectorDataIntegralValue) {
104 std::vector<std::string>
data;
105 data.push_back(
"Abc");
106 data.push_back(
"Hij");
107 data.push_back(
"Xyz");
115 TEST(TraceEventTest, VectorDataStringValue) {
118 std::vector<std::string>
data;
125 "[\"A\",\"B\",\"C\"]",
129 TEST(TraceEventTest, VectorDataVectorValue) {
132 std::vector<std::string>
data;
138 std::vector<std::string> extractedData(
145 TEST(TraceEventTest, IteratorValueTypeCheckInteger) {
159 TEST(TraceEventTest, IteratorValueTypeCheckString) {
173 TEST(TraceEventTest, IteratorValueTypeCheckStringArray) {
175 std::vector<std::string> arrData;
176 arrData.push_back(
"A");
177 arrData.push_back(
"B");
178 arrData.push_back(
"C");
184 ASSERT_EQ(
typeid(std::vector<std::string>), itr.type());
191 TEST(TraceEventTest, IntegerValueToString) {
194 traceEvent.
end(
TimePoint(std::chrono::milliseconds(200)));
198 std::ostringstream out;
199 out <<
"TraceEvent(";
200 out <<
"type='TotalRequest', ";
201 out <<
"id='" << traceEvent.
getID() <<
"', ";
202 out <<
"parentID='1', ";
203 out <<
"start='100', ";
204 out <<
"end='200', ";
205 out <<
"metaData='{protocol: 13, }')";
210 TEST(TraceEventTest, StringValueToString) {
213 traceEvent.
end(
TimePoint(std::chrono::milliseconds(200)));
217 std::ostringstream out;
218 out <<
"TraceEvent(";
219 out <<
"type='TotalRequest', ";
220 out <<
"id='" << traceEvent.
getID() <<
"', ";
221 out <<
"parentID='1', ";
222 out <<
"start='100', ";
223 out <<
"end='200', ";
224 out <<
"metaData='{protocol: abc, }')";
229 TEST(TraceEventTest, StringArrayValueToString) {
232 traceEvent.
end(
TimePoint(std::chrono::milliseconds(200)));
233 std::vector<std::string> arrData;
234 arrData.push_back(
"A");
235 arrData.push_back(
"B");
236 arrData.push_back(
"C");
239 std::ostringstream out;
240 out <<
"TraceEvent(";
241 out <<
"type='TotalRequest', ";
242 out <<
"id='" << traceEvent.
getID() <<
"', ";
243 out <<
"parentID='1', ";
244 out <<
"start='100', ";
245 out <<
"end='200', ";
246 out <<
"metaData='{protocol: [\"A\",\"B\",\"C\"], }')";
#define ASSERT_EQ(val1, val2)
std::string toString() const
Iterator getMetaDataItr() const
PolymorphicMatcher< internal::ContainerEqMatcher< GTEST_REMOVE_CONST_(Container)> > ContainerEq(const Container &rhs)
void end(const TimeUtil &tm)
bool addMeta(TraceFieldType key, T &&value)
TEST(TraceEventTest, IntegralDataIntegralValue)
#define ASSERT_ANY_THROW(statement)
#define ASSERT_THROW(statement, expected_exception)
SteadyClock::time_point TimePoint
#define EXPECT_THAT(value, matcher)
T getTraceFieldDataAs(TraceFieldType field) const
void start(const TimeUtil &tm)
#define ASSERT_FALSE(condition)
#define ASSERT_TRUE(condition)
static constexpr uint64_t data[1]