Test 1: Test valid JSON with default formatting options
| 24 | |
| 25 | // Test 1: Test valid JSON with default formatting options |
| 26 | TEST_F(JsonCompressTest, CompressJson_ValidJson) |
| 27 | { |
| 28 | const std::string inputJson = R"({"name": "John", "age": 30})"; |
| 29 | |
| 30 | auto result = m_jsonHandler.GetCompressedJson(inputJson); |
| 31 | |
| 32 | EXPECT_TRUE(result.success); |
| 33 | EXPECT_EQ(result.error_code, -1); |
| 34 | EXPECT_EQ(result.error_pos, -1); |
| 35 | EXPECT_EQ(result.error_str, ""); |
| 36 | EXPECT_EQ(result.response, R"({"name":"John","age":30})"); |
| 37 | } |
| 38 | |
| 39 | // Test 2: Test invalid JSON input |
| 40 | TEST_F(JsonCompressTest, CompressJson_InvalidJson) |
nothing calls this directly
no test coverage detected