LCOV - code coverage report
Current view: top level - regression/issue_617 - test_oneof.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 9 9 100.0 %
Date: 2023-02-14 20:10:26 Functions: 1 1 100.0 %

          Line data    Source code
       1             : #include <pb_decode.h>
       2             : #include <unittests.h>
       3             : #include "oneof.pb.h"
       4             : 
       5           1 : int main()
       6             : {
       7           1 :     const uint8_t input_data[] = {
       8             :         0x08, 0x01, 0x10, 0x0F, 0x18, 0xAC, 0x02, 0x20,
       9             :         0xF1, 0x82, 0xA0, 0x85, 0x0C, 0x62, 0x00, 0x58,
      10             :         0xF1, 0x82, 0xA0, 0x85, 0x0C
      11             :     };
      12             :     
      13           1 :     int status = 0;
      14           1 :     TestMessage msg = TestMessage_init_zero;
      15           1 :     pb_istream_t stream = pb_istream_from_buffer(input_data, sizeof(input_data));
      16             :     
      17           1 :     TEST(pb_decode(&stream, TestMessage_fields, &msg));
      18           1 :     TEST(msg.which_payload == TestMessage_plb11_tag);
      19           1 :     TEST(msg.payload.plb11.name[0] == 0);
      20             :     
      21           1 :     return status;
      22             : }

Generated by: LCOV version 1.14