LCOV - code coverage report
Current view: top level - libsystemd/sd-bus - test-bus-introspect.c (source / functions) Hit Total Coverage
Test: main_coverage.info Lines: 19 19 100.0 %
Date: 2019-08-22 15:41:25 Functions: 2 2 100.0 %

          Line data    Source code
       1             : /* SPDX-License-Identifier: LGPL-2.1+ */
       2             : 
       3             : #include "bus-introspect.h"
       4             : #include "log.h"
       5             : #include "tests.h"
       6             : 
       7             : #include "test-vtable-data.h"
       8             : 
       9           4 : static void test_manual_introspection(const sd_bus_vtable vtable[]) {
      10           4 :         struct introspect intro = {};
      11           4 :         _cleanup_free_ char *s = NULL;
      12             : 
      13           4 :         log_info("/* %s */", __func__);
      14             : 
      15           4 :         assert_se(introspect_begin(&intro, false) >= 0);
      16             : 
      17           4 :         fprintf(intro.f, " <interface name=\"org.foo\">\n");
      18           4 :         assert_se(introspect_write_interface(&intro, vtable) >= 0);
      19           4 :         fputs(" </interface>\n", intro.f);
      20             : 
      21           4 :         assert_se(introspect_finish(&intro, &s) == 0);
      22           4 :         fputs(s, stdout);
      23           4 :         fputs("\n", stdout);
      24           4 : }
      25             : 
      26           1 : int main(int argc, char *argv[]) {
      27           1 :         test_setup_logging(LOG_DEBUG);
      28             : 
      29           1 :         test_manual_introspection(test_vtable_1);
      30           1 :         test_manual_introspection(test_vtable_2);
      31           1 :         test_manual_introspection(test_vtable_deprecated);
      32           1 :         test_manual_introspection((const sd_bus_vtable *) vtable_format_221);
      33             : 
      34           1 :         return 0;
      35             : }

Generated by: LCOV version 1.14