Coverage report for dbus/dbus-marshal-basic.c.gcov

        -:    0:Source:dbus-marshal-basic.c
        -:    0:Graph:.libs/dbus-marshal-basic.gcno
        -:    0:Data:.libs/dbus-marshal-basic.gcda
        -:    0:Runs:11815
        -:    0:Programs:5
        -:    1:/* -*- mode: C; c-file-style: "gnu" -*- */
        -:    2:/* dbus-marshal-basic.c  Marshalling routines for basic (primitive) types
        -:    3: *
        -:    4: * Copyright (C) 2002 CodeFactory AB
        -:    5: * Copyright (C) 2003, 2004, 2005 Red Hat, Inc.
        -:    6: *
        -:    7: * Licensed under the Academic Free License version 2.1
        -:    8: *
        -:    9: * This program is free software; you can redistribute it and/or modify
        -:   10: * it under the terms of the GNU General Public License as published by
        -:   11: * the Free Software Foundation; either version 2 of the License, or
        -:   12: * (at your option) any later version.
        -:   13: *
        -:   14: * This program is distributed in the hope that it will be useful,
        -:   15: * but WITHOUT ANY WARRANTY; without even the implied warranty of
        -:   16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        -:   17: * GNU General Public License for more details.
        -:   18: *
        -:   19: * You should have received a copy of the GNU General Public License
        -:   20: * along with this program; if not, write to the Free Software
        -:   21: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
        -:   22: *
        -:   23: */
        -:   24:
        -:   25:#include "dbus-internals.h"
        -:   26:#include "dbus-marshal-basic.h"
        -:   27:#include "dbus-signature.h"
        -:   28:
        -:   29:#include <string.h>
        -:   30:
        -:   31:/**
        -:   32: * @defgroup DBusMarshal marshaling and unmarshaling
        -:   33: * @ingroup  DBusInternals
        -:   34: * @brief functions to marshal/unmarshal data from the wire
        -:   35: *
        -:   36: * Types and functions related to converting primitive data types from
        -:   37: * wire format to native machine format, and vice versa.
        -:   38: *
        -:   39: * A signature is just a string with multiple types one after the other.
        -:   40: * for example a type is "i" or "(ii)", a signature is "i(ii)"
        -:   41: * where i is int and (ii) is struct { int; int; }
        -:   42: *
        -:   43: * @{
        -:   44: */
        -:   45:
        -:   46:static void
        -:   47:pack_2_octets (dbus_uint16_t   value,
        -:   48:               int             byte_order,
        -:   49:               unsigned char  *data)
function pack_2_octets called 0 returned 0% blocks executed 0%
    #####:   50:{
    #####:   51:  _dbus_assert (_DBUS_ALIGN_ADDRESS (data, 2) == data);
call    0 never executed
        -:   52:
    #####:   53:  if ((byte_order) == DBUS_LITTLE_ENDIAN)
branch  0 never executed
branch  1 never executed
    #####:   54:    *((dbus_uint16_t*)(data)) = DBUS_UINT16_TO_LE (value);
        -:   55:  else
    #####:   56:    *((dbus_uint16_t*)(data)) = DBUS_UINT16_TO_BE (value);
    #####:   57:}
        -:   58:
        -:   59:static void
        -:   60:pack_4_octets (dbus_uint32_t   value,
        -:   61:               int             byte_order,
        -:   62:               unsigned char  *data)
function pack_4_octets called 804999 returned 100% blocks executed 100%
   804999:   63:{
   804999:   64:  _dbus_assert (_DBUS_ALIGN_ADDRESS (data, 4) == data);
call    0 returned 100%
        -:   65:
   804999:   66:  if ((byte_order) == DBUS_LITTLE_ENDIAN)
branch  0 taken 99% (fallthrough)
branch  1 taken 1%
   804877:   67:    *((dbus_uint32_t*)(data)) = DBUS_UINT32_TO_LE (value);
        -:   68:  else
      122:   69:    *((dbus_uint32_t*)(data)) = DBUS_UINT32_TO_BE (value);
   804999:   70:}
        -:   71:
        -:   72:static void
        -:   73:pack_8_octets (DBusBasicValue     value,
        -:   74:               int                byte_order,
        -:   75:               unsigned char     *data)
function pack_8_octets called 0 returned 0% blocks executed 0%
    #####:   76:{
    #####:   77:  _dbus_assert (_DBUS_ALIGN_ADDRESS (data, 8) == data);
call    0 never executed
        -:   78:
        -:   79:#ifdef DBUS_HAVE_INT64
    #####:   80:  if ((byte_order) == DBUS_LITTLE_ENDIAN)
branch  0 never executed
branch  1 never executed
    #####:   81:    *((dbus_uint64_t*)(data)) = DBUS_UINT64_TO_LE (value.u64);
        -:   82:  else
    #####:   83:    *((dbus_uint64_t*)(data)) = DBUS_UINT64_TO_BE (value.u64);
        -:   84:#else
        -:   85:  *(DBus8ByteStruct*)data = value.u64;
        -:   86:  swap_8_octets ((DBusBasicValue*)data, byte_order);
        -:   87:#endif
    #####:   88:}
        -:   89:
        -:   90:/**
        -:   91: * Packs a 32 bit unsigned integer into a data pointer.
        -:   92: *
        -:   93: * @param value the value
        -:   94: * @param byte_order the byte order to use
        -:   95: * @param data the data pointer
        -:   96: */
        -:   97:void
        -:   98:_dbus_pack_uint32 (dbus_uint32_t   value,
        -:   99:                   int             byte_order,
        -:  100:                   unsigned char  *data)
function _dbus_pack_uint32 called 0 returned 0% blocks executed 0%
    #####:  101:{
    #####:  102:  pack_4_octets (value, byte_order, data);
call    0 never executed
    #####:  103:}
        -:  104:
        -:  105:#ifndef DBUS_HAVE_INT64
        -:  106:/* from ORBit */
        -:  107:static void
        -:  108:swap_bytes (unsigned char *data,
        -:  109:            unsigned int   len)
        -:  110:{
        -:  111:  unsigned char *p1 = data;
        -:  112:  unsigned char *p2 = data + len - 1;
        -:  113:
        -:  114:  while (p1 < p2)
        -:  115:    {
        -:  116:      unsigned char tmp = *p1;
        -:  117:      *p1 = *p2;
        -:  118:      *p2 = tmp;
        -:  119:
        -:  120:      --p2;
        -:  121:      ++p1;
        -:  122:    }
        -:  123:}
        -:  124:#endif /* !DBUS_HAVE_INT64 */
        -:  125:
        -:  126:static void
        -:  127:swap_8_octets (DBusBasicValue    *value,
        -:  128:               int                byte_order)
function swap_8_octets called 12366 returned 100% blocks executed 100%
    12366:  129:{
    12366:  130:  if (byte_order != DBUS_COMPILER_BYTE_ORDER)
branch  0 taken 1% (fallthrough)
branch  1 taken 99%
        -:  131:    {
        -:  132:#ifdef DBUS_HAVE_INT64
       57:  133:      value->u64 = DBUS_UINT64_SWAP_LE_BE (value->u64);
        -:  134:#else
        -:  135:      swap_bytes ((unsigned char *)value, 8);
        -:  136:#endif
        -:  137:    }
    12366:  138:}
        -:  139:
        -:  140:#if 0
        -:  141:static DBusBasicValue
        -:  142:unpack_8_octets (int                  byte_order,
        -:  143:                 const unsigned char *data)
        -:  144:{
        -:  145:  DBusBasicValue r;
        -:  146:
        -:  147:  _dbus_assert (_DBUS_ALIGN_ADDRESS (data, 8) == data);
        -:  148:  _dbus_assert (sizeof (r) == 8);
        -:  149:
        -:  150:#ifdef DBUS_HAVE_INT64
        -:  151:  if (byte_order == DBUS_LITTLE_ENDIAN)
        -:  152:    r.u64 = DBUS_UINT64_FROM_LE (*(dbus_uint64_t*)data);
        -:  153:  else
        -:  154:    r.u64 = DBUS_UINT64_FROM_BE (*(dbus_uint64_t*)data);
        -:  155:#else
        -:  156:  r.u64 = *(DBus8ByteStruct*)data;
        -:  157:  swap_8_octets (&r, byte_order);
        -:  158:#endif
        -:  159:
        -:  160:  return r;
        -:  161:}
        -:  162:#endif
        -:  163:
        -:  164:#ifndef _dbus_unpack_uint16
        -:  165:/**
        -:  166: * Unpacks a 16 bit unsigned integer from a data pointer
        -:  167: *
        -:  168: * @param byte_order The byte order to use
        -:  169: * @param data the data pointer
        -:  170: * @returns the integer
        -:  171: */
        -:  172:dbus_uint16_t
        -:  173:_dbus_unpack_uint16 (int                  byte_order,
        -:  174:                     const unsigned char *data)
function _dbus_unpack_uint16 called 0 returned 0% blocks executed 0%
    #####:  175:{
    #####:  176:  _dbus_assert (_DBUS_ALIGN_ADDRESS (data, 2) == data);
call    0 never executed
        -:  177:
    #####:  178:  if (byte_order == DBUS_LITTLE_ENDIAN)
branch  0 never executed
branch  1 never executed
    #####:  179:    return DBUS_UINT16_FROM_LE (*(dbus_uint16_t*)data);
        -:  180:  else
    #####:  181:    return DBUS_UINT16_FROM_BE (*(dbus_uint16_t*)data);
        -:  182:}
        -:  183:#endif /* _dbus_unpack_uint16 */
        -:  184:
        -:  185:#ifndef _dbus_unpack_uint32
        -:  186:/**
        -:  187: * Unpacks a 32 bit unsigned integer from a data pointer
        -:  188: *
        -:  189: * @param byte_order The byte order to use
        -:  190: * @param data the data pointer
        -:  191: * @returns the integer
        -:  192: */
        -:  193:dbus_uint32_t
        -:  194:_dbus_unpack_uint32 (int                  byte_order,
        -:  195:                     const unsigned char *data)
function _dbus_unpack_uint32 called 30031469 returned 100% blocks executed 100%
 30031469:  196:{
 30031469:  197:  _dbus_assert (_DBUS_ALIGN_ADDRESS (data, 4) == data);
call    0 returned 100%
        -:  198:
 30031469:  199:  if (byte_order == DBUS_LITTLE_ENDIAN)
branch  0 taken 89% (fallthrough)
branch  1 taken 11%
 26756934:  200:    return DBUS_UINT32_FROM_LE (*(dbus_uint32_t*)data);
        -:  201:  else
  3274535:  202:    return DBUS_UINT32_FROM_BE (*(dbus_uint32_t*)data);
        -:  203:}
        -:  204:#endif /* _dbus_unpack_uint32 */
        -:  205:
        -:  206:static void
        -:  207:set_2_octets (DBusString          *str,
        -:  208:              int                  offset,
        -:  209:              dbus_uint16_t        value,
        -:  210:              int                  byte_order)
function set_2_octets called 0 returned 0% blocks executed 0%
    #####:  211:{
        -:  212:  char *data;
        -:  213:
    #####:  214:  _dbus_assert (byte_order == DBUS_LITTLE_ENDIAN ||
branch  0 never executed
branch  1 never executed
branch  2 never executed
branch  3 never executed
call    4 never executed
        -:  215:                byte_order == DBUS_BIG_ENDIAN);
        -:  216:
    #####:  217:  data = _dbus_string_get_data_len (str, offset, 2);
call    0 never executed
        -:  218:
    #####:  219:  pack_2_octets (value, byte_order, data);
call    0 never executed
    #####:  220:}
        -:  221:
        -:  222:static void
        -:  223:set_4_octets (DBusString          *str,
        -:  224:              int                  offset,
        -:  225:              dbus_uint32_t        value,
        -:  226:              int                  byte_order)
function set_4_octets called 804999 returned 100% blocks executed 88%
   804999:  227:{
        -:  228:  char *data;
        -:  229:
   804999:  230:  _dbus_assert (byte_order == DBUS_LITTLE_ENDIAN ||
branch  0 taken 1% (fallthrough)
branch  1 taken 99%
branch  2 taken 100% (fallthrough)
branch  3 taken 0%
call    4 returned 100%
        -:  231:                byte_order == DBUS_BIG_ENDIAN);
        -:  232:
   804999:  233:  data = _dbus_string_get_data_len (str, offset, 4);
call    0 returned 100%
        -:  234:
   804999:  235:  pack_4_octets (value, byte_order, data);
call    0 returned 100%
   804999:  236:}
        -:  237:
        -:  238:static void
        -:  239:set_8_octets (DBusString          *str,
        -:  240:              int                  offset,
        -:  241:              DBusBasicValue       value,
        -:  242:              int                  byte_order)
function set_8_octets called 0 returned 0% blocks executed 0%
    #####:  243:{
        -:  244:  char *data;
        -:  245:
    #####:  246:  _dbus_assert (byte_order == DBUS_LITTLE_ENDIAN ||
branch  0 never executed
branch  1 never executed
branch  2 never executed
branch  3 never executed
call    4 never executed
        -:  247:                byte_order == DBUS_BIG_ENDIAN);
        -:  248:
    #####:  249:  data = _dbus_string_get_data_len (str, offset, 8);
call    0 never executed
        -:  250:
    #####:  251:  pack_8_octets (value, byte_order, data);
call    0 never executed
    #####:  252:}
        -:  253:
        -:  254:/**
        -:  255: * Sets the 4 bytes at the given offset to a marshaled unsigned
        -:  256: * integer, replacing anything found there previously.
        -:  257: *
        -:  258: * @param str the string to write the marshalled int to
        -:  259: * @param pos the byte offset where int should be written
        -:  260: * @param value the value
        -:  261: * @param byte_order the byte order to use
        -:  262: *
        -:  263: */
        -:  264:void
        -:  265:_dbus_marshal_set_uint32 (DBusString          *str,
        -:  266:                          int                  pos,
        -:  267:                          dbus_uint32_t        value,
        -:  268:                          int                  byte_order)
function _dbus_marshal_set_uint32 called 801558 returned 100% blocks executed 100%
   801558:  269:{
   801558:  270:  set_4_octets (str, pos, value, byte_order);
call    0 returned 100%
   801558:  271:}
        -:  272:
        -:  273:/**
        -:  274: * Sets the existing marshaled string at the given offset with
        -:  275: * a new marshaled string. The given offset must point to
        -:  276: * an existing string or the wrong length will be deleted
        -:  277: * and replaced with the new string.
        -:  278: *
        -:  279: * Note: no attempt is made by this function to re-align
        -:  280: * any data which has been already marshalled after this
        -:  281: * string. Use with caution.
        -:  282: *
        -:  283: * @param str the string to write the marshalled string to
        -:  284: * @param pos the position of the marshaled string length
        -:  285: * @param value the value
        -:  286: * @param byte_order the byte order to use
        -:  287: * @param old_end_pos place to store byte after the nul byte of the old value
        -:  288: * @param new_end_pos place to store byte after the nul byte of the new value
        -:  289: * @returns #TRUE on success, #FALSE if no memory
        -:  290: *
        -:  291: */
        -:  292:static dbus_bool_t
        -:  293:set_string (DBusString          *str,
        -:  294:            int                  pos,
        -:  295:            const char          *value,
        -:  296:            int                  byte_order,
        -:  297:            int                 *old_end_pos,
        -:  298:            int                 *new_end_pos)
function set_string called 4 returned 100% blocks executed 80%
        4:  299:{
        -:  300:  int old_len, new_len;
        -:  301:  DBusString dstr;
        -:  302:
        4:  303:  _dbus_string_init_const (&dstr, value);
call    0 returned 100%
        -:  304:
        4:  305:  _dbus_assert (_DBUS_ALIGN_VALUE (pos, 4) == (unsigned) pos);
call    0 returned 100%
        4:  306:  old_len = _dbus_unpack_uint32 (byte_order,
call    0 returned 100%
call    1 returned 100%
        -:  307:                                 _dbus_string_get_const_data_len (str, pos, 4));
        -:  308:
        4:  309:  new_len = _dbus_string_get_length (&dstr);
call    0 returned 100%
        -:  310:
        4:  311:  if (!_dbus_string_replace_len (&dstr, 0, new_len,
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  312:                                 str, pos + 4, old_len))
    #####:  313:    return FALSE;
        -:  314:
        4:  315:  _dbus_marshal_set_uint32 (str, pos, new_len, byte_order);
call    0 returned 100%
        -:  316:
        4:  317:  if (old_end_pos)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####:  318:    *old_end_pos = pos + 4 + old_len + 1;
        4:  319:  if (new_end_pos)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####:  320:    *new_end_pos = pos + 4 + new_len + 1;
        -:  321:
        4:  322:  return TRUE;
        -:  323:}
        -:  324:
        -:  325:/**
        -:  326: * Sets the existing marshaled signature at the given offset to a new
        -:  327: * marshaled signature. Same basic ideas as set_string().
        -:  328: *
        -:  329: * @param str the string to write the marshalled signature to
        -:  330: * @param pos the position of the marshaled signature length
        -:  331: * @param value the value
        -:  332: * @param byte_order the byte order to use
        -:  333: * @param old_end_pos place to store byte after the nul byte of the old value
        -:  334: * @param new_end_pos place to store byte after the nul byte of the new value
        -:  335: * @returns #TRUE on success, #FALSE if no memory
        -:  336: *
        -:  337: */
        -:  338:static dbus_bool_t
        -:  339:set_signature (DBusString          *str,
        -:  340:               int                  pos,
        -:  341:               const char          *value,
        -:  342:               int                  byte_order,
        -:  343:               int                 *old_end_pos,
        -:  344:               int                 *new_end_pos)
function set_signature called 0 returned 0% blocks executed 0%
    #####:  345:{
        -:  346:  int old_len, new_len;
        -:  347:  DBusString dstr;
        -:  348:
    #####:  349:  _dbus_string_init_const (&dstr, value);
call    0 never executed
        -:  350:
    #####:  351:  old_len = _dbus_string_get_byte (str, pos);
call    0 never executed
    #####:  352:  new_len = _dbus_string_get_length (&dstr);
call    0 never executed
        -:  353:
    #####:  354:  if (!_dbus_string_replace_len (&dstr, 0, new_len,
call    0 never executed
branch  1 never executed
branch  2 never executed
        -:  355:                                 str, pos + 1, old_len))
    #####:  356:    return FALSE;
        -:  357:
    #####:  358:  _dbus_string_set_byte (str, pos, new_len);
call    0 never executed
        -:  359:
    #####:  360:  if (old_end_pos)
branch  0 never executed
branch  1 never executed
    #####:  361:    *old_end_pos = pos + 1 + old_len + 1;
    #####:  362:  if (new_end_pos)
branch  0 never executed
branch  1 never executed
    #####:  363:    *new_end_pos = pos + 1 + new_len + 1;
        -:  364:
    #####:  365:  return TRUE;
        -:  366:}
        -:  367:
        -:  368:/**
        -:  369: * Sets an existing basic type value to a new value.
        -:  370: * Arguments work the same way as _dbus_marshal_basic_type().
        -:  371: *
        -:  372: * @param str the string
        -:  373: * @param pos location of the current value
        -:  374: * @param type the type of the current and new values
        -:  375: * @param value the address of the new value
        -:  376: * @param byte_order byte order for marshaling
        -:  377: * @param old_end_pos location to store end position of the old value, or #NULL
        -:  378: * @param new_end_pos location to store end position of the new value, or #NULL
        -:  379: * @returns #FALSE if no memory
        -:  380: */
        -:  381:dbus_bool_t
        -:  382:_dbus_marshal_set_basic (DBusString       *str,
        -:  383:                         int               pos,
        -:  384:                         int               type,
        -:  385:                         const void       *value,
        -:  386:                         int               byte_order,
        -:  387:                         int              *old_end_pos,
        -:  388:                         int              *new_end_pos)
function _dbus_marshal_set_basic called 3445 returned 100% blocks executed 27%
     3445:  389:{
        -:  390:  const DBusBasicValue *vp;
        -:  391:
     3445:  392:  vp = value;
        -:  393:
     3445:  394:  switch (type)
branch  0 taken 0%
branch  1 taken 0%
branch  2 taken 99%
branch  3 taken 0%
branch  4 taken 1%
branch  5 taken 0%
branch  6 taken 0%
        -:  395:    {
        -:  396:    case DBUS_TYPE_BYTE:
    #####:  397:      _dbus_string_set_byte (str, pos, vp->byt);
call    0 never executed
    #####:  398:      if (old_end_pos)
branch  0 never executed
branch  1 never executed
    #####:  399:        *old_end_pos = pos + 1;
    #####:  400:      if (new_end_pos)
branch  0 never executed
branch  1 never executed
    #####:  401:        *new_end_pos = pos + 1;
    #####:  402:      return TRUE;
        -:  403:      break;
        -:  404:    case DBUS_TYPE_INT16:
        -:  405:    case DBUS_TYPE_UINT16:
    #####:  406:      pos = _DBUS_ALIGN_VALUE (pos, 2);
    #####:  407:      set_2_octets (str, pos, vp->u16, byte_order);
call    0 never executed
    #####:  408:      if (old_end_pos)
branch  0 never executed
branch  1 never executed
    #####:  409:        *old_end_pos = pos + 2;
    #####:  410:      if (new_end_pos)
branch  0 never executed
branch  1 never executed
    #####:  411:        *new_end_pos = pos + 2;
    #####:  412:      return TRUE;
        -:  413:      break;
        -:  414:    case DBUS_TYPE_BOOLEAN:
        -:  415:    case DBUS_TYPE_INT32:
        -:  416:    case DBUS_TYPE_UINT32:
     3441:  417:      pos = _DBUS_ALIGN_VALUE (pos, 4);
     3441:  418:      set_4_octets (str, pos, vp->u32, byte_order);
call    0 returned 100%
     3441:  419:      if (old_end_pos)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####:  420:        *old_end_pos = pos + 4;
     3441:  421:      if (new_end_pos)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####:  422:        *new_end_pos = pos + 4;
     3441:  423:      return TRUE;
        -:  424:      break;
        -:  425:    case DBUS_TYPE_INT64:
        -:  426:    case DBUS_TYPE_UINT64:
        -:  427:    case DBUS_TYPE_DOUBLE:
    #####:  428:      pos = _DBUS_ALIGN_VALUE (pos, 8);
    #####:  429:      set_8_octets (str, pos, *vp, byte_order);
call    0 never executed
    #####:  430:      if (old_end_pos)
branch  0 never executed
branch  1 never executed
    #####:  431:        *old_end_pos = pos + 8;
    #####:  432:      if (new_end_pos)
branch  0 never executed
branch  1 never executed
    #####:  433:        *new_end_pos = pos + 8;
    #####:  434:      return TRUE;
        -:  435:      break;
        -:  436:    case DBUS_TYPE_STRING:
        -:  437:    case DBUS_TYPE_OBJECT_PATH:
        4:  438:      pos = _DBUS_ALIGN_VALUE (pos, 4);
        4:  439:      _dbus_assert (vp->str != NULL);
call    0 returned 100%
        4:  440:      return set_string (str, pos, vp->str, byte_order,
call    0 returned 100%
        -:  441:                         old_end_pos, new_end_pos);
        -:  442:      break;
        -:  443:    case DBUS_TYPE_SIGNATURE:
    #####:  444:      _dbus_assert (vp->str != NULL);
call    0 never executed
    #####:  445:      return set_signature (str, pos, vp->str, byte_order,
call    0 never executed
        -:  446:                            old_end_pos, new_end_pos);
        -:  447:      break;
        -:  448:    default:
    #####:  449:      _dbus_assert_not_reached ("not a basic type");
call    0 never executed
        -:  450:      return FALSE;
        -:  451:      break;
        -:  452:    }
        -:  453:}
        -:  454:
        -:  455:/**
        -:  456: * Convenience function to demarshal a 32 bit unsigned integer.
        -:  457: *
        -:  458: * @param str the string containing the data
        -:  459: * @param byte_order the byte order
        -:  460: * @param pos the position in the string
        -:  461: * @param new_pos the new position of the string
        -:  462: * @returns the demarshaled integer.
        -:  463: */
        -:  464:dbus_uint32_t
        -:  465:_dbus_marshal_read_uint32  (const DBusString *str,
        -:  466:                            int               pos,
        -:  467:                            int               byte_order,
        -:  468:                            int              *new_pos)
function _dbus_marshal_read_uint32 called 7824048 returned 100% blocks executed 100%
  7824048:  469:{
  7824048:  470:  pos = _DBUS_ALIGN_VALUE (pos, 4);
        -:  471:
  7824048:  472:  if (new_pos)
branch  0 taken 84% (fallthrough)
branch  1 taken 16%
  6577555:  473:    *new_pos = pos + 4;
        -:  474:
  7824048:  475:  _dbus_assert (pos + 4 <= _dbus_string_get_length (str));
call    0 returned 100%
call    1 returned 100%
        -:  476:  
  7824048:  477:  return _dbus_unpack_uint32 (byte_order,
call    0 returned 100%
call    1 returned 100%
        -:  478:                              _dbus_string_get_const_data (str) + pos);
        -:  479:}
        -:  480:
        -:  481:/**
        -:  482: * Demarshals a basic-typed value. The "value" pointer is always
        -:  483: * the address of a variable of the basic type. So e.g.
        -:  484: * if the basic type is "double" then the pointer is
        -:  485: * a double*, and if it's "char*" then the pointer is
        -:  486: * a "char**".
        -:  487: *
        -:  488: * A value of type #DBusBasicValue is guaranteed to be large enough to
        -:  489: * hold any of the types that may be returned, which is handy if you
        -:  490: * are trying to do things generically. For example you can pass
        -:  491: * a DBusBasicValue* in to this function, and then pass the same
        -:  492: * DBusBasicValue* in to _dbus_marshal_basic_type() in order to
        -:  493: * move a value from one place to another.
        -:  494: *
        -:  495: * @param str the string containing the data
        -:  496: * @param pos position in the string
        -:  497: * @param type type of value to demarshal
        -:  498: * @param value pointer to return value data
        -:  499: * @param byte_order the byte order
        -:  500: * @param new_pos pointer to update with new position, or #NULL
        -:  501: **/
        -:  502:void
        -:  503:_dbus_marshal_read_basic (const DBusString      *str,
        -:  504:                          int                    pos,
        -:  505:                          int                    type,
        -:  506:                          void                  *value,
        -:  507:                          int                    byte_order,
        -:  508:                          int                   *new_pos)
function _dbus_marshal_read_basic called 7704846 returned 100% blocks executed 88%
  7704846:  509:{
        -:  510:  const char *str_data;
        -:  511:  DBusBasicValue *vp;
        -:  512:
  7704846:  513:  _dbus_assert (dbus_type_is_basic (type));
call    0 returned 100%
call    1 returned 100%
        -:  514:
  7704846:  515:  str_data = _dbus_string_get_const_data (str);
call    0 returned 100%
  7704846:  516:  vp = value;
        -:  517:
  7704846:  518:  switch (type)
branch  0 taken 50%
branch  1 taken 1%
branch  2 taken 6%
branch  3 taken 1%
branch  4 taken 44%
branch  5 taken 1%
branch  6 taken 0%
        -:  519:    {
        -:  520:    case DBUS_TYPE_BYTE:
  3854152:  521:      vp->byt = _dbus_string_get_byte (str, pos);
call    0 returned 100%
  3854152:  522:      (pos)++;
  3854152:  523:      break;
        -:  524:    case DBUS_TYPE_INT16:
        -:  525:    case DBUS_TYPE_UINT16:
       58:  526:      pos = _DBUS_ALIGN_VALUE (pos, 2);
       58:  527:      vp->u16 = *(dbus_uint16_t *)(str_data + pos);
       58:  528:      if (byte_order != DBUS_COMPILER_BYTE_ORDER)
branch  0 taken 45% (fallthrough)
branch  1 taken 55%
       26:  529:	vp->u16 = DBUS_UINT16_SWAP_LE_BE (vp->u16);
       58:  530:      pos += 2;
       58:  531:      break;
        -:  532:    case DBUS_TYPE_INT32:
        -:  533:    case DBUS_TYPE_UINT32:
        -:  534:    case DBUS_TYPE_BOOLEAN:
   433925:  535:      pos = _DBUS_ALIGN_VALUE (pos, 4);
   433925:  536:      vp->u32 = *(dbus_uint32_t *)(str_data + pos);
   433925:  537:      if (byte_order != DBUS_COMPILER_BYTE_ORDER)
branch  0 taken 1% (fallthrough)
branch  1 taken 99%
       70:  538:	vp->u32 = DBUS_UINT32_SWAP_LE_BE (vp->u32);
   433925:  539:      pos += 4;
   433925:  540:      break;
        -:  541:    case DBUS_TYPE_INT64:
        -:  542:    case DBUS_TYPE_UINT64:
        -:  543:    case DBUS_TYPE_DOUBLE:
       87:  544:      pos = _DBUS_ALIGN_VALUE (pos, 8);
        -:  545:#ifdef DBUS_HAVE_INT64
       87:  546:      if (byte_order != DBUS_COMPILER_BYTE_ORDER)
branch  0 taken 45% (fallthrough)
branch  1 taken 55%
       39:  547:        vp->u64 = DBUS_UINT64_SWAP_LE_BE (*(dbus_uint64_t*)(str_data + pos));
        -:  548:      else
       48:  549:        vp->u64 = *(dbus_uint64_t*)(str_data + pos);
        -:  550:#else
        -:  551:      vp->u64 = *(DBus8ByteStruct*) (str_data + pos);
        -:  552:      swap_8_octets (vp, byte_order);
        -:  553:#endif
       87:  554:      pos += 8;
       87:  555:      break;
        -:  556:    case DBUS_TYPE_STRING:
        -:  557:    case DBUS_TYPE_OBJECT_PATH:
        -:  558:      {
        -:  559:        int len;
        -:  560:
  3357074:  561:        len = _dbus_marshal_read_uint32 (str, pos, byte_order, &pos);
call    0 returned 100%
        -:  562:
  3357074:  563:        vp->str = (char*) str_data + pos;
        -:  564:
  3357074:  565:        pos += len + 1; /* length plus nul */
        -:  566:      }
  3357074:  567:      break;
        -:  568:    case DBUS_TYPE_SIGNATURE:
        -:  569:      {
        -:  570:        int len;
        -:  571:
    59550:  572:        len = _dbus_string_get_byte (str, pos);
call    0 returned 100%
    59550:  573:        pos += 1;
        -:  574:
    59550:  575:        vp->str = (char*) str_data + pos;
        -:  576:
    59550:  577:        pos += len + 1; /* length plus nul */
        -:  578:      }
    59550:  579:      break;
        -:  580:    default:
    #####:  581:      _dbus_warn ("type %s %d not a basic type\n",
call    0 never executed
call    1 never executed
        -:  582:                  _dbus_type_to_string (type), type);
    #####:  583:      _dbus_assert_not_reached ("not a basic type");
call    0 never executed
        -:  584:      break;
        -:  585:    }
        -:  586:
  7704846:  587:  if (new_pos)
branch  0 taken 1% (fallthrough)
branch  1 taken 99%
       32:  588:    *new_pos = pos;
  7704846:  589:}
        -:  590:
        -:  591:/**
        -:  592: * Reads a block of fixed-length basic values, as an optimization
        -:  593: * vs. reading each one individually into a new buffer.
        -:  594: *
        -:  595: * This function returns the data in-place; it does not make a copy,
        -:  596: * and it does not swap the bytes.
        -:  597: *
        -:  598: * If you ask for #DBUS_TYPE_DOUBLE you will get a "const double*" back
        -:  599: * and the "value" argument should be a "const double**" and so on.
        -:  600: *
        -:  601: * @todo we aren't using this function (except in the test suite)
        -:  602: * 
        -:  603: * @param str the string to read from
        -:  604: * @param pos position to read from
        -:  605: * @param element_type type of array elements
        -:  606: * @param value place to return the array
        -:  607: * @param n_elements number of array elements to read
        -:  608: * @param byte_order the byte order, used to read the array length
        -:  609: * @param new_pos #NULL or location to store a position after the elements
        -:  610: */
        -:  611:void
        -:  612:_dbus_marshal_read_fixed_multi  (const DBusString *str,
        -:  613:                                 int               pos,
        -:  614:                                 int               element_type,
        -:  615:                                 void             *value,
        -:  616:                                 int               n_elements,
        -:  617:                                 int               byte_order,
        -:  618:                                 int              *new_pos)
function _dbus_marshal_read_fixed_multi called 12 returned 100% blocks executed 89%
       12:  619:{
        -:  620:  int array_len;
        -:  621:  int alignment;
        -:  622:
       12:  623:  _dbus_assert (dbus_type_is_fixed (element_type));
call    0 returned 100%
call    1 returned 100%
       12:  624:  _dbus_assert (dbus_type_is_basic (element_type));
call    0 returned 100%
call    1 returned 100%
        -:  625:
        -:  626:#if 0
        -:  627:  _dbus_verbose ("reading %d elements of %s\n",
        -:  628:                 n_elements, _dbus_type_to_string (element_type));
        -:  629:#endif
        -:  630:  
       12:  631:  alignment = _dbus_type_get_alignment (element_type);
call    0 returned 100%
        -:  632:
       12:  633:  pos = _DBUS_ALIGN_VALUE (pos, alignment);
        -:  634:  
       12:  635:  array_len = n_elements * alignment;
        -:  636:
       12:  637:  *(const DBusBasicValue**) value = (void*) _dbus_string_get_const_data_len (str, pos, array_len);
call    0 returned 100%
       12:  638:  if (new_pos)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####:  639:    *new_pos = pos + array_len;
       12:  640:}
        -:  641:
        -:  642:static dbus_bool_t
        -:  643:marshal_2_octets (DBusString   *str,
        -:  644:                  int           insert_at,
        -:  645:                  dbus_uint16_t value,
        -:  646:                  int           byte_order,
        -:  647:                  int          *pos_after)
function marshal_2_octets called 7564 returned 100% blocks executed 100%
     7564:  648:{
        -:  649:  dbus_bool_t retval;
        -:  650:  int orig_len;
        -:  651:
     7564:  652:  _dbus_assert (sizeof (value) == 2);
call    0 returned 100%
        -:  653:
     7564:  654:  if (byte_order != DBUS_COMPILER_BYTE_ORDER)
branch  0 taken 1% (fallthrough)
branch  1 taken 99%
       38:  655:    value = DBUS_UINT16_SWAP_LE_BE (value);
        -:  656:
     7564:  657:  orig_len = _dbus_string_get_length (str);
call    0 returned 100%
        -:  658:
     7564:  659:  retval = _dbus_string_insert_2_aligned (str, insert_at,
call    0 returned 100%
        -:  660:                                          (const unsigned char *)&value);
        -:  661:
     7564:  662:  if (pos_after)
branch  0 taken 99% (fallthrough)
branch  1 taken 1%
        -:  663:    {
     7560:  664:      *pos_after = insert_at + (_dbus_string_get_length (str) - orig_len);
call    0 returned 100%
     7560:  665:      _dbus_assert (*pos_after <= _dbus_string_get_length (str));
call    0 returned 100%
call    1 returned 100%
        -:  666:    }
        -:  667:
     7564:  668:  return retval;
        -:  669:}
        -:  670:
        -:  671:static dbus_bool_t
        -:  672:marshal_4_octets (DBusString   *str,
        -:  673:                  int           insert_at,
        -:  674:                  dbus_uint32_t value,
        -:  675:                  int           byte_order,
        -:  676:                  int          *pos_after)
function marshal_4_octets called 1272344 returned 100% blocks executed 100%
  1272344:  677:{
        -:  678:  dbus_bool_t retval;
        -:  679:  int orig_len;
        -:  680:
  1272344:  681:  _dbus_assert (sizeof (value) == 4);
call    0 returned 100%
        -:  682:
  1272344:  683:  if (byte_order != DBUS_COMPILER_BYTE_ORDER)
branch  0 taken 1% (fallthrough)
branch  1 taken 99%
      308:  684:    value = DBUS_UINT32_SWAP_LE_BE (value);
        -:  685:
  1272344:  686:  orig_len = _dbus_string_get_length (str);
call    0 returned 100%
        -:  687:
  1272344:  688:  retval = _dbus_string_insert_4_aligned (str, insert_at,
call    0 returned 100%
        -:  689:                                          (const unsigned char *)&value);
        -:  690:
  1272344:  691:  if (pos_after)
branch  0 taken 99% (fallthrough)
branch  1 taken 1%
        -:  692:    {
  1272336:  693:      *pos_after = insert_at + (_dbus_string_get_length (str) - orig_len);
call    0 returned 100%
  1272336:  694:      _dbus_assert (*pos_after <= _dbus_string_get_length (str));
call    0 returned 100%
call    1 returned 100%
        -:  695:    }
        -:  696:
  1272344:  697:  return retval;
        -:  698:}
        -:  699:
        -:  700:static dbus_bool_t
        -:  701:marshal_8_octets (DBusString    *str,
        -:  702:                  int            insert_at,
        -:  703:                  DBusBasicValue value,
        -:  704:                  int            byte_order,
        -:  705:                  int           *pos_after)
function marshal_8_octets called 12366 returned 100% blocks executed 100%
    12366:  706:{
        -:  707:  dbus_bool_t retval;
        -:  708:  int orig_len;
        -:  709:
    12366:  710:  _dbus_assert (sizeof (value) == 8);
call    0 returned 100%
        -:  711:
    12366:  712:  swap_8_octets (&value, byte_order);
call    0 returned 100%
        -:  713:
    12366:  714:  orig_len = _dbus_string_get_length (str);
call    0 returned 100%
        -:  715:
    12366:  716:  retval = _dbus_string_insert_8_aligned (str, insert_at,
call    0 returned 100%
        -:  717:                                          (const unsigned char *)&value);
        -:  718:
    12366:  719:  if (pos_after)
branch  0 taken 99% (fallthrough)
branch  1 taken 1%
    12360:  720:    *pos_after = insert_at + _dbus_string_get_length (str) - orig_len;
call    0 returned 100%
        -:  721:
    12366:  722:  return retval;
        -:  723:}
        -:  724:
        -:  725:enum
        -:  726:  {
        -:  727:    MARSHAL_AS_STRING,
        -:  728:    MARSHAL_AS_SIGNATURE,
        -:  729:    MARSHAL_AS_BYTE_ARRAY
        -:  730:  };
        -:  731:
        -:  732:static dbus_bool_t
        -:  733:marshal_len_followed_by_bytes (int                  marshal_as,
        -:  734:                               DBusString          *str,
        -:  735:                               int                  insert_at,
        -:  736:                               const unsigned char *value,
        -:  737:                               int                  data_len, /* doesn't include nul if any */
        -:  738:                               int                  byte_order,
        -:  739:                               int                 *pos_after)
function marshal_len_followed_by_bytes called 862169 returned 100% blocks executed 88%
   862169:  740:{
        -:  741:  int pos;
        -:  742:  DBusString value_str;
        -:  743:  int value_len;
        -:  744:
   862169:  745:  _dbus_assert (byte_order == DBUS_LITTLE_ENDIAN || byte_order == DBUS_BIG_ENDIAN);
branch  0 taken 1% (fallthrough)
branch  1 taken 99%
branch  2 taken 100% (fallthrough)
branch  3 taken 0%
call    4 returned 100%
   862169:  746:  if (insert_at > _dbus_string_get_length (str))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####:  747:    _dbus_warn ("insert_at = %d string len = %d data_len = %d\n",
call    0 never executed
call    1 never executed
        -:  748:                insert_at, _dbus_string_get_length (str), data_len);
        -:  749:  
   862169:  750:  if (marshal_as == MARSHAL_AS_BYTE_ARRAY)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####:  751:    value_len = data_len;
        -:  752:  else
   862169:  753:    value_len = data_len + 1; /* value has a nul */
        -:  754:
   862169:  755:  _dbus_string_init_const_len (&value_str, value, value_len);
call    0 returned 100%
        -:  756:
   862169:  757:  pos = insert_at;
        -:  758:
   862169:  759:  if (marshal_as == MARSHAL_AS_SIGNATURE)
branch  0 taken 19% (fallthrough)
branch  1 taken 81%
        -:  760:    {
   167112:  761:      _dbus_assert (data_len <= DBUS_MAXIMUM_SIGNATURE_LENGTH);
call    0 returned 100%
   167112:  762:      _dbus_assert (data_len <= 255); /* same as max sig len right now */
call    0 returned 100%
        -:  763:      
   167112:  764:      if (!_dbus_string_insert_byte (str, pos, data_len))
call    0 returned 100%
branch  1 taken 99% (fallthrough)
branch  2 taken 1%
       59:  765:        goto oom;
        -:  766:
   167053:  767:      pos += 1;
        -:  768:    }
        -:  769:  else
        -:  770:    {
   695057:  771:      if (!marshal_4_octets (str, pos, data_len,
call    0 returned 100%
branch  1 taken 1% (fallthrough)
branch  2 taken 99%
        -:  772:                             byte_order, &pos))
       61:  773:        goto oom;
        -:  774:    }
        -:  775:
   862049:  776:  if (!_dbus_string_copy_len (&value_str, 0, value_len,
call    0 returned 100%
branch  1 taken 1% (fallthrough)
branch  2 taken 99%
        -:  777:                              str, pos))
      252:  778:    goto oom;
        -:  779:
        -:  780:#if 0
        -:  781:  /* too expensive */
        -:  782:  _dbus_assert (_dbus_string_equal_substring (&value_str, 0, value_len,
        -:  783:                                              str, pos));
        -:  784:  _dbus_verbose_bytes_of_string (str, pos, value_len);
        -:  785:#endif
        -:  786:
   861797:  787:  pos += value_len;
        -:  788:
   861797:  789:  if (pos_after)
branch  0 taken 99% (fallthrough)
branch  1 taken 1%
   861785:  790:    *pos_after = pos;
        -:  791:
   861797:  792:  return TRUE;
        -:  793:
      372:  794: oom:
        -:  795:  /* Delete what we've inserted */
      372:  796:  _dbus_string_delete (str, insert_at, pos - insert_at);
call    0 returned 100%
        -:  797:
      372:  798:  return FALSE;
        -:  799:}
        -:  800:
        -:  801:static dbus_bool_t
        -:  802:marshal_string (DBusString    *str,
        -:  803:                int            insert_at,
        -:  804:                const char    *value,
        -:  805:                int            byte_order,
        -:  806:                int           *pos_after)
function marshal_string called 695057 returned 100% blocks executed 100%
   695057:  807:{
   695057:  808:  return marshal_len_followed_by_bytes (MARSHAL_AS_STRING,
call    0 returned 100%
call    1 returned 100%
        -:  809:                                        str, insert_at, value,
        -:  810:                                        strlen (value),
        -:  811:                                        byte_order, pos_after);
        -:  812:}
        -:  813:
        -:  814:static dbus_bool_t
        -:  815:marshal_signature (DBusString    *str,
        -:  816:                   int            insert_at,
        -:  817:                   const char    *value,
        -:  818:                   int           *pos_after)
function marshal_signature called 167112 returned 100% blocks executed 100%
   167112:  819:{
   167112:  820:  return marshal_len_followed_by_bytes (MARSHAL_AS_SIGNATURE,
call    0 returned 100%
call    1 returned 100%
        -:  821:                                        str, insert_at, value,
        -:  822:                                        strlen (value),
        -:  823:                                        DBUS_COMPILER_BYTE_ORDER, /* irrelevant */
        -:  824:                                        pos_after);
        -:  825:}
        -:  826:
        -:  827:/**
        -:  828: * Marshals a basic-typed value. The "value" pointer is always the
        -:  829: * address of a variable containing the basic type value.
        -:  830: * So for example for int32 it will be dbus_int32_t*, and
        -:  831: * for string it will be const char**. This is for symmetry
        -:  832: * with _dbus_marshal_read_basic() and to have a simple
        -:  833: * consistent rule.
        -:  834: *
        -:  835: * @param str string to marshal to
        -:  836: * @param insert_at where to insert the value
        -:  837: * @param type type of value
        -:  838: * @param value pointer to a variable containing the value
        -:  839: * @param byte_order byte order
        -:  840: * @param pos_after #NULL or the position after the type
        -:  841: * @returns #TRUE on success
        -:  842: **/
        -:  843:dbus_bool_t
        -:  844:_dbus_marshal_write_basic (DBusString *str,
        -:  845:                           int         insert_at,
        -:  846:                           int         type,
        -:  847:                           const void *value,
        -:  848:                           int         byte_order,
        -:  849:                           int        *pos_after)
function _dbus_marshal_write_basic called 2826933 returned 100% blocks executed 92%
  2826933:  850:{
        -:  851:  const DBusBasicValue *vp;
        -:  852:
  2826933:  853:  _dbus_assert (dbus_type_is_basic (type));
call    0 returned 100%
call    1 returned 100%
        -:  854:
  2826933:  855:  vp = value;
        -:  856:
  2826933:  857:  switch (type)
branch  0 taken 48%
branch  1 taken 1%
branch  2 taken 1%
branch  3 taken 20%
branch  4 taken 1%
branch  5 taken 25%
branch  6 taken 6%
branch  7 taken 0%
        -:  858:    {
        -:  859:    case DBUS_TYPE_BYTE:
  1367547:  860:      if (!_dbus_string_insert_byte (str, insert_at, vp->byt))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####:  861:        return FALSE;
  1367547:  862:      if (pos_after)
branch  0 taken 99% (fallthrough)
branch  1 taken 1%
  1367545:  863:        *pos_after = insert_at + 1;
  1367547:  864:      return TRUE;
        -:  865:      break;
        -:  866:    case DBUS_TYPE_INT16:
        -:  867:    case DBUS_TYPE_UINT16:
     7564:  868:      return marshal_2_octets (str, insert_at, vp->u16,
call    0 returned 100%
        -:  869:                               byte_order, pos_after);
        -:  870:      break;
        -:  871:    case DBUS_TYPE_BOOLEAN:
     3854:  872:      return marshal_4_octets (str, insert_at, vp->u32 != FALSE,
call    0 returned 100%
        -:  873:                               byte_order, pos_after);
        -:  874:      break;
        -:  875:    case DBUS_TYPE_INT32:
        -:  876:    case DBUS_TYPE_UINT32:
   573433:  877:      return marshal_4_octets (str, insert_at, vp->u32,
call    0 returned 100%
        -:  878:                               byte_order, pos_after);
        -:  879:      break;
        -:  880:    case DBUS_TYPE_INT64:
        -:  881:    case DBUS_TYPE_UINT64:
        -:  882:    case DBUS_TYPE_DOUBLE:
    12366:  883:      return marshal_8_octets (str, insert_at, *vp, byte_order, pos_after);
call    0 returned 100%
        -:  884:      break;
        -:  885:
        -:  886:    case DBUS_TYPE_STRING:
        -:  887:    case DBUS_TYPE_OBJECT_PATH:
   695057:  888:      _dbus_assert (vp->str != NULL);
call    0 returned 100%
   695057:  889:      return marshal_string (str, insert_at, vp->str, byte_order, pos_after);
call    0 returned 100%
        -:  890:      break;
        -:  891:    case DBUS_TYPE_SIGNATURE:
   167112:  892:      _dbus_assert (vp->str != NULL);
call    0 returned 100%
   167112:  893:      return marshal_signature (str, insert_at, vp->str, pos_after);
call    0 returned 100%
        -:  894:      break;
        -:  895:    default:
    #####:  896:      _dbus_assert_not_reached ("not a basic type");
call    0 never executed
        -:  897:      return FALSE;
        -:  898:      break;
        -:  899:    }
        -:  900:}
        -:  901:
        -:  902:static dbus_bool_t
        -:  903:marshal_1_octets_array (DBusString          *str,
        -:  904:                        int                  insert_at,
        -:  905:                        const unsigned char *value,
        -:  906:                        int                  n_elements,
        -:  907:                        int                  byte_order,
        -:  908:                        int                 *pos_after)
function marshal_1_octets_array called 3 returned 100% blocks executed 88%
        3:  909:{
        -:  910:  int pos;
        -:  911:  DBusString value_str;
        -:  912:
        3:  913:  _dbus_string_init_const_len (&value_str, value, n_elements);
call    0 returned 100%
        -:  914:
        3:  915:  pos = insert_at;
        -:  916:
        3:  917:  if (!_dbus_string_copy_len (&value_str, 0, n_elements,
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  918:                              str, pos))
    #####:  919:    return FALSE;
        -:  920:
        3:  921:  pos += n_elements;
        -:  922:
        3:  923:  if (pos_after)
branch  0 taken 33% (fallthrough)
branch  1 taken 67%
        1:  924:    *pos_after = pos;
        -:  925:
        3:  926:  return TRUE;
        -:  927:}
        -:  928:
        -:  929:/**
        -:  930: * Swaps the elements of an array to the opposite byte order
        -:  931: *
        -:  932: * @param data start of array
        -:  933: * @param n_elements number of elements
        -:  934: * @param alignment size of each element
        -:  935: */
        -:  936:void
        -:  937:_dbus_swap_array (unsigned char *data,
        -:  938:                  int            n_elements,
        -:  939:                  int            alignment)
function _dbus_swap_array called 58 returned 100% blocks executed 100%
       58:  940:{
        -:  941:  unsigned char *d;
        -:  942:  unsigned char *end;
        -:  943:
       58:  944:  _dbus_assert (_DBUS_ALIGN_ADDRESS (data, alignment) == data);
call    0 returned 100%
        -:  945:
        -:  946:  /* we use const_data and cast it off so DBusString can be a const string
        -:  947:   * for the unit tests. don't ask.
        -:  948:   */
       58:  949:  d = data;
       58:  950:  end = d + (n_elements * alignment);
        -:  951:  
       58:  952:  if (alignment == 8)
branch  0 taken 34% (fallthrough)
branch  1 taken 66%
        -:  953:    {
       64:  954:      while (d != end)
branch  0 taken 55%
branch  1 taken 45% (fallthrough)
        -:  955:        {
        -:  956:#ifdef DBUS_HAVE_INT64
       24:  957:          *((dbus_uint64_t*)d) = DBUS_UINT64_SWAP_LE_BE (*((dbus_uint64_t*)d));
        -:  958:#else
        -:  959:          swap_8_bytes ((DBusBasicValue*) d);
        -:  960:#endif
       24:  961:          d += 8;
        -:  962:        }
        -:  963:    }
       38:  964:  else if (alignment == 4)
branch  0 taken 58% (fallthrough)
branch  1 taken 42%
        -:  965:    {
       74:  966:      while (d != end)
branch  0 taken 58%
branch  1 taken 42% (fallthrough)
        -:  967:        {
       30:  968:          *((dbus_uint32_t*)d) = DBUS_UINT32_SWAP_LE_BE (*((dbus_uint32_t*)d));
       30:  969:          d += 4;
        -:  970:        }
        -:  971:    }
        -:  972:  else
        -:  973:    {
       16:  974:      _dbus_assert (alignment == 2);
call    0 returned 100%
        -:  975:      
       56:  976:      while (d != end)
branch  0 taken 60%
branch  1 taken 40% (fallthrough)
        -:  977:        {
       24:  978:          *((dbus_uint16_t*)d) = DBUS_UINT16_SWAP_LE_BE (*((dbus_uint16_t*)d));
       24:  979:          d += 2;
        -:  980:        }
        -:  981:    }
       58:  982:}
        -:  983:
        -:  984:static void
        -:  985:swap_array (DBusString *str,
        -:  986:            int         array_start,
        -:  987:            int         n_elements,
        -:  988:            int         byte_order,
        -:  989:            int         alignment)
function swap_array called 26 returned 100% blocks executed 100%
       26:  990:{
       26:  991:  _dbus_assert (_DBUS_ALIGN_VALUE (array_start, alignment) == (unsigned) array_start);
call    0 returned 100%
        -:  992:
       26:  993:  if (byte_order != DBUS_COMPILER_BYTE_ORDER)
branch  0 taken 38% (fallthrough)
branch  1 taken 62%
        -:  994:    {
        -:  995:      /* we use const_data and cast it off so DBusString can be a const string
        -:  996:       * for the unit tests. don't ask.
        -:  997:       */
       10:  998:      _dbus_swap_array ((unsigned char*) (_dbus_string_get_const_data (str) + array_start),
call    0 returned 100%
call    1 returned 100%
        -:  999:                        n_elements, alignment);
        -: 1000:    }
       26: 1001:}
        -: 1002:
        -: 1003:static dbus_bool_t
        -: 1004:marshal_fixed_multi (DBusString           *str,
        -: 1005:                     int                   insert_at,
        -: 1006:                     const DBusBasicValue *value,
        -: 1007:                     int                   n_elements,
        -: 1008:                     int                   byte_order,
        -: 1009:                     int                   alignment,
        -: 1010:                     int                  *pos_after)
function marshal_fixed_multi called 16 returned 100% blocks executed 71%
       16: 1011:{
        -: 1012:  int old_string_len;
        -: 1013:  int array_start;
        -: 1014:  DBusString t;
        -: 1015:  int len_in_bytes;
        -: 1016:
       16: 1017:  _dbus_assert (n_elements <= DBUS_MAXIMUM_ARRAY_LENGTH / alignment);
call    0 returned 100%
        -: 1018:  
       16: 1019:  old_string_len = _dbus_string_get_length (str);
call    0 returned 100%
        -: 1020:
       16: 1021:  len_in_bytes = n_elements * alignment;
       16: 1022:  array_start = insert_at;
        -: 1023:  
        -: 1024:  /* Note that we do alignment padding unconditionally
        -: 1025:   * even if the array is empty; this means that
        -: 1026:   * padding + len is always equal to the number of bytes
        -: 1027:   * in the array.
        -: 1028:   */
        -: 1029:
       16: 1030:  if (!_dbus_string_insert_alignment (str, &array_start, alignment))
call    0 returned 100%
branch  1 taken 100% (fallthrough)
branch  2 taken 0%
    #####: 1031:    goto error;
        -: 1032:
       16: 1033:  _dbus_string_init_const_len (&t,
call    0 returned 100%
        -: 1034:                               (const unsigned char*) value,
        -: 1035:                               len_in_bytes);
        -: 1036:
       16: 1037:  if (!_dbus_string_copy (&t, 0,
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 1038:                          str, array_start))
    #####: 1039:    goto error;
        -: 1040:
       16: 1041:  swap_array (str, array_start, n_elements, byte_order, alignment);
call    0 returned 100%
        -: 1042:
       16: 1043:  if (pos_after)
branch  0 taken 38% (fallthrough)
branch  1 taken 63%
        6: 1044:    *pos_after = array_start + len_in_bytes;
        -: 1045:  
       16: 1046:  return TRUE;
        -: 1047:
    #####: 1048: error:
    #####: 1049:  _dbus_string_delete (str, insert_at,
call    0 never executed
call    1 never executed
        -: 1050:                       _dbus_string_get_length (str) - old_string_len);
        -: 1051:
    #####: 1052:  return FALSE;
        -: 1053:}
        -: 1054:
        -: 1055:/**
        -: 1056: * Marshals a block of values of fixed-length type all at once, as an
        -: 1057: * optimization.  dbus_type_is_fixed() returns #TRUE for fixed-length
        -: 1058: * types, which are the basic types minus the string-like types.
        -: 1059: *
        -: 1060: * The value argument should be the adddress of an
        -: 1061: * array, so e.g. "const dbus_uint32_t**"
        -: 1062: *
        -: 1063: * @param str string to marshal to
        -: 1064: * @param insert_at where to insert the value
        -: 1065: * @param element_type type of array elements
        -: 1066: * @param value address of an array to marshal
        -: 1067: * @param n_elements number of elements in the array
        -: 1068: * @param byte_order byte order
        -: 1069: * @param pos_after #NULL or the position after the type
        -: 1070: * @returns #TRUE on success
        -: 1071: **/
        -: 1072:dbus_bool_t
        -: 1073:_dbus_marshal_write_fixed_multi (DBusString *str,
        -: 1074:                                 int         insert_at,
        -: 1075:                                 int         element_type,
        -: 1076:                                 const void *value,
        -: 1077:                                 int         n_elements,
        -: 1078:                                 int         byte_order,
        -: 1079:                                 int        *pos_after)
function _dbus_marshal_write_fixed_multi called 19 returned 100% blocks executed 93%
       19: 1080:{
       19: 1081:  const void* vp = *(const DBusBasicValue**)value;
        -: 1082:  
       19: 1083:  _dbus_assert (dbus_type_is_fixed (element_type));
call    0 returned 100%
call    1 returned 100%
       19: 1084:  _dbus_assert (n_elements >= 0);
call    0 returned 100%
        -: 1085:
        -: 1086:#if 0
        -: 1087:  _dbus_verbose ("writing %d elements of %s\n",
        -: 1088:                 n_elements, _dbus_type_to_string (element_type));
        -: 1089:#endif
        -: 1090:  
       19: 1091:  switch (element_type)
branch  0 taken 16%
branch  1 taken 21%
branch  2 taken 37%
branch  3 taken 26%
branch  4 taken 0%
        -: 1092:    {
        -: 1093:    case DBUS_TYPE_BYTE:
        3: 1094:      return marshal_1_octets_array (str, insert_at, vp, n_elements, byte_order, pos_after);
call    0 returned 100%
        -: 1095:      break;
        -: 1096:    case DBUS_TYPE_INT16:
        -: 1097:    case DBUS_TYPE_UINT16:
        4: 1098:      return marshal_fixed_multi (str, insert_at, vp, n_elements, byte_order, 2, pos_after);
call    0 returned 100%
        -: 1099:      /* FIXME: we canonicalize to 0 or 1 for the single boolean case
        -: 1100:       * should we here too ? */
        -: 1101:    case DBUS_TYPE_BOOLEAN:
        -: 1102:    case DBUS_TYPE_INT32:
        -: 1103:    case DBUS_TYPE_UINT32:
        7: 1104:      return marshal_fixed_multi (str, insert_at, vp, n_elements, byte_order, 4, pos_after);
call    0 returned 100%
        -: 1105:      break;
        -: 1106:    case DBUS_TYPE_INT64:
        -: 1107:    case DBUS_TYPE_UINT64:
        -: 1108:    case DBUS_TYPE_DOUBLE:
        5: 1109:      return marshal_fixed_multi (str, insert_at, vp, n_elements, byte_order, 8, pos_after);
call    0 returned 100%
        -: 1110:      break;
        -: 1111:
        -: 1112:    default:
    #####: 1113:      _dbus_assert_not_reached ("non fixed type in array write");
call    0 never executed
        -: 1114:      break;
        -: 1115:    }
        -: 1116:
        -: 1117:  return FALSE;
        -: 1118:}
        -: 1119:
        -: 1120:
        -: 1121:/**
        -: 1122: * Skips over a basic-typed value, reporting the following position.
        -: 1123: *
        -: 1124: * @param str the string containing the data
        -: 1125: * @param type type of value to read
        -: 1126: * @param byte_order the byte order
        -: 1127: * @param pos pointer to position in the string,
        -: 1128: *            updated on return to new position
        -: 1129: **/
        -: 1130:void
        -: 1131:_dbus_marshal_skip_basic (const DBusString      *str,
        -: 1132:                          int                    type,
        -: 1133:                          int                    byte_order,
        -: 1134:                          int                   *pos)
function _dbus_marshal_skip_basic called 10965414 returned 100% blocks executed 72%
 10965414: 1135:{
 10965414: 1136:  _dbus_assert (byte_order == DBUS_LITTLE_ENDIAN ||
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
branch  2 never executed
branch  3 never executed
call    4 returned 100%
        -: 1137:                byte_order == DBUS_BIG_ENDIAN);
        -: 1138:  
 10965414: 1139:  switch (type)
branch  0 taken 62%
branch  1 taken 1%
branch  2 taken 5%
branch  3 taken 1%
branch  4 taken 29%
branch  5 taken 4%
branch  6 taken 0%
        -: 1140:    {
        -: 1141:    case DBUS_TYPE_BYTE:
  6770550: 1142:      (*pos)++;
  6770550: 1143:      break;
        -: 1144:    case DBUS_TYPE_INT16:
        -: 1145:    case DBUS_TYPE_UINT16:
        6: 1146:      *pos = _DBUS_ALIGN_VALUE (*pos, 2);
        6: 1147:      *pos += 2;
        6: 1148:      break;
        -: 1149:    case DBUS_TYPE_BOOLEAN:
        -: 1150:    case DBUS_TYPE_INT32:
        -: 1151:    case DBUS_TYPE_UINT32:
   555692: 1152:      *pos = _DBUS_ALIGN_VALUE (*pos, 4);
   555692: 1153:      *pos += 4;
   555692: 1154:      break;
        -: 1155:    case DBUS_TYPE_INT64:
        -: 1156:    case DBUS_TYPE_UINT64:
        -: 1157:    case DBUS_TYPE_DOUBLE:
        9: 1158:      *pos = _DBUS_ALIGN_VALUE (*pos, 8);
        9: 1159:      *pos += 8;
        9: 1160:      break;
        -: 1161:    case DBUS_TYPE_STRING:
        -: 1162:    case DBUS_TYPE_OBJECT_PATH:
        -: 1163:      {
        -: 1164:        int len;
        -: 1165:
  3157885: 1166:        len = _dbus_marshal_read_uint32 (str, *pos, byte_order, pos);
call    0 returned 100%
        -: 1167:        
  3157885: 1168:        *pos += len + 1; /* length plus nul */
        -: 1169:      }
  3157885: 1170:      break;
        -: 1171:    case DBUS_TYPE_SIGNATURE:
        -: 1172:      {
        -: 1173:        int len;
        -: 1174:
   481272: 1175:        len = _dbus_string_get_byte (str, *pos);
call    0 returned 100%
        -: 1176:
   481272: 1177:        *pos += len + 2; /* length byte plus length plus nul */
        -: 1178:      }
   481272: 1179:      break;
        -: 1180:    default:
    #####: 1181:      _dbus_warn ("type %s not a basic type\n",
call    0 never executed
call    1 never executed
        -: 1182:                  _dbus_type_to_string (type));
    #####: 1183:      _dbus_assert_not_reached ("not a basic type");
call    0 never executed
        -: 1184:      break;
        -: 1185:    }
 10965414: 1186:}
        -: 1187:
        -: 1188:/**
        -: 1189: * Skips an array, returning the next position.
        -: 1190: *
        -: 1191: * @param str the string containing the data
        -: 1192: * @param element_type the type of array elements
        -: 1193: * @param byte_order the byte order
        -: 1194: * @param pos pointer to position in the string,
        -: 1195: *            updated on return to new position
        -: 1196: */
        -: 1197:void
        -: 1198:_dbus_marshal_skip_array (const DBusString  *str,
        -: 1199:                          int                element_type,
        -: 1200:                          int                byte_order,
        -: 1201:                          int               *pos)
function _dbus_marshal_skip_array called 62584 returned 100% blocks executed 100%
    62584: 1202:{
        -: 1203:  dbus_uint32_t array_len;
        -: 1204:  int i;
        -: 1205:  int alignment;
        -: 1206:
    62584: 1207:  i = _DBUS_ALIGN_VALUE (*pos, 4);
        -: 1208:
    62584: 1209:  array_len = _dbus_marshal_read_uint32 (str, i, byte_order, &i);
call    0 returned 100%
        -: 1210:
    62584: 1211:  alignment = _dbus_type_get_alignment (element_type);
call    0 returned 100%
        -: 1212:
    62584: 1213:  i = _DBUS_ALIGN_VALUE (i, alignment);
        -: 1214:
    62584: 1215:  *pos = i + array_len;
    62584: 1216:}
        -: 1217:
        -: 1218:/**
        -: 1219: * Gets the alignment requirement for the given type;
        -: 1220: * will be 1, 4, or 8.
        -: 1221: *
        -: 1222: * @param typecode the type
        -: 1223: * @returns alignment of 1, 4, or 8
        -: 1224: */
        -: 1225:int
        -: 1226:_dbus_type_get_alignment (int typecode)
function _dbus_type_get_alignment called 10374897 returned 100% blocks executed 86%
 10374897: 1227:{
 10374897: 1228:  switch (typecode)
branch  0 taken 10%
branch  1 taken 1%
branch  2 taken 76%
branch  3 taken 13%
branch  4 taken 0%
        -: 1229:    {
        -: 1230:    case DBUS_TYPE_BYTE:
        -: 1231:    case DBUS_TYPE_VARIANT:
        -: 1232:    case DBUS_TYPE_SIGNATURE:
  1079775: 1233:      return 1;
        -: 1234:    case DBUS_TYPE_INT16:
        -: 1235:    case DBUS_TYPE_UINT16:
    10995: 1236:      return 2;
        -: 1237:    case DBUS_TYPE_BOOLEAN:
        -: 1238:    case DBUS_TYPE_INT32:
        -: 1239:    case DBUS_TYPE_UINT32:
        -: 1240:      /* this stuff is 4 since it starts with a length */
        -: 1241:    case DBUS_TYPE_STRING:
        -: 1242:    case DBUS_TYPE_OBJECT_PATH:
        -: 1243:    case DBUS_TYPE_ARRAY:
  7917127: 1244:      return 4;
        -: 1245:    case DBUS_TYPE_INT64:
        -: 1246:    case DBUS_TYPE_UINT64:
        -: 1247:    case DBUS_TYPE_DOUBLE:
        -: 1248:      /* struct is 8 since it could contain an 8-aligned item
        -: 1249:       * and it's simpler to just always align structs to 8;
        -: 1250:       * we want the amount of padding in a struct of a given
        -: 1251:       * type to be predictable, not location-dependent.
        -: 1252:       * DICT_ENTRY is always the same as struct.
        -: 1253:       */
        -: 1254:    case DBUS_TYPE_STRUCT:
        -: 1255:    case DBUS_TYPE_DICT_ENTRY:
  1367000: 1256:      return 8;
        -: 1257:
        -: 1258:    default:
    #####: 1259:      _dbus_assert_not_reached ("unknown typecode in _dbus_type_get_alignment()");
call    0 never executed
        -: 1260:      return 0;
        -: 1261:    }
        -: 1262:}
        -: 1263:
        -: 1264:
        -: 1265:/**
        -: 1266: * Return #TRUE if the typecode is a valid typecode.
        -: 1267: * #DBUS_TYPE_INVALID surprisingly enough is not considered valid, and
        -: 1268: * random unknown bytes aren't either. This function is safe with
        -: 1269: * untrusted data.
        -: 1270: *
        -: 1271: * @returns #TRUE if valid
        -: 1272: */
        -: 1273:dbus_bool_t
        -: 1274:_dbus_type_is_valid (int typecode)
function _dbus_type_is_valid called 12845218 returned 100% blocks executed 75%
 12845218: 1275:{
 12845218: 1276:  switch (typecode)
branch  0 taken 100%
branch  1 taken 0%
        -: 1277:    {
        -: 1278:    case DBUS_TYPE_BYTE:
        -: 1279:    case DBUS_TYPE_BOOLEAN:
        -: 1280:    case DBUS_TYPE_INT16:
        -: 1281:    case DBUS_TYPE_UINT16:
        -: 1282:    case DBUS_TYPE_INT32:
        -: 1283:    case DBUS_TYPE_UINT32:
        -: 1284:    case DBUS_TYPE_INT64:
        -: 1285:    case DBUS_TYPE_UINT64:
        -: 1286:    case DBUS_TYPE_DOUBLE:
        -: 1287:    case DBUS_TYPE_STRING:
        -: 1288:    case DBUS_TYPE_OBJECT_PATH:
        -: 1289:    case DBUS_TYPE_SIGNATURE:
        -: 1290:    case DBUS_TYPE_ARRAY:
        -: 1291:    case DBUS_TYPE_STRUCT:
        -: 1292:    case DBUS_TYPE_DICT_ENTRY:
        -: 1293:    case DBUS_TYPE_VARIANT:
 12845218: 1294:      return TRUE;
        -: 1295:
        -: 1296:    default:
    #####: 1297:      return FALSE;
        -: 1298:    }
        -: 1299:}
        -: 1300:
        -: 1301:/**
        -: 1302: * Returns a string describing the given type.
        -: 1303: *
        -: 1304: * @param typecode the type to describe
        -: 1305: * @returns a constant string describing the type
        -: 1306: */
        -: 1307:const char *
        -: 1308:_dbus_type_to_string (int typecode)
function _dbus_type_to_string called 1624 returned 100% blocks executed 18%
     1624: 1309:{
     1624: 1310:  switch (typecode)
branch  0 taken 50%
branch  1 taken 0%
branch  2 taken 0%
branch  3 taken 0%
branch  4 taken 0%
branch  5 taken 0%
branch  6 taken 0%
branch  7 taken 0%
branch  8 taken 50%
branch  9 taken 0%
branch 10 taken 0%
branch 11 taken 0%
branch 12 taken 0%
branch 13 taken 0%
branch 14 taken 0%
branch 15 taken 0%
branch 16 taken 0%
branch 17 taken 0%
branch 18 taken 0%
branch 19 taken 0%
        -: 1311:    {
        -: 1312:    case DBUS_TYPE_INVALID:
      812: 1313:      return "invalid";
        -: 1314:    case DBUS_TYPE_BOOLEAN:
    #####: 1315:      return "boolean";
        -: 1316:    case DBUS_TYPE_BYTE:
    #####: 1317:      return "byte";
        -: 1318:    case DBUS_TYPE_INT16:
    #####: 1319:      return "int16";
        -: 1320:    case DBUS_TYPE_UINT16:
    #####: 1321:      return "uint16";
        -: 1322:    case DBUS_TYPE_INT32:
    #####: 1323:      return "int32";
        -: 1324:    case DBUS_TYPE_UINT32:
    #####: 1325:      return "uint32";
        -: 1326:    case DBUS_TYPE_DOUBLE:
    #####: 1327:      return "double";
        -: 1328:    case DBUS_TYPE_STRING:
      812: 1329:      return "string";
        -: 1330:    case DBUS_TYPE_OBJECT_PATH:
    #####: 1331:      return "object_path";
        -: 1332:    case DBUS_TYPE_SIGNATURE:
    #####: 1333:      return "signature";
        -: 1334:    case DBUS_TYPE_STRUCT:
    #####: 1335:      return "struct";
        -: 1336:    case DBUS_TYPE_DICT_ENTRY:
    #####: 1337:      return "dict_entry";
        -: 1338:    case DBUS_TYPE_ARRAY:
    #####: 1339:      return "array";
        -: 1340:    case DBUS_TYPE_VARIANT:
    #####: 1341:      return "variant";
        -: 1342:    case DBUS_STRUCT_BEGIN_CHAR:
    #####: 1343:      return "begin_struct";
        -: 1344:    case DBUS_STRUCT_END_CHAR:
    #####: 1345:      return "end_struct";
        -: 1346:    case DBUS_DICT_ENTRY_BEGIN_CHAR:
    #####: 1347:      return "begin_dict_entry";
        -: 1348:    case DBUS_DICT_ENTRY_END_CHAR:
    #####: 1349:      return "end_dict_entry";
        -: 1350:    default:
    #####: 1351:      return "unknown";
        -: 1352:    }
        -: 1353:}
        -: 1354:
        -: 1355:/**
        -: 1356: * If in verbose mode, print a block of binary data.
        -: 1357: *
        -: 1358: * @todo right now it prints even if not in verbose mode
        -: 1359: *
        -: 1360: * @param data the data
        -: 1361: * @param len the length of the data
        -: 1362: * @param offset where to start counting for byte indexes
        -: 1363: */
        -: 1364:void
        -: 1365:_dbus_verbose_bytes (const unsigned char *data,
        -: 1366:                     int                  len,
        -: 1367:                     int                  offset)
function _dbus_verbose_bytes called 115842 returned 100% blocks executed 82%
   115842: 1368:{
        -: 1369:  int i;
        -: 1370:  const unsigned char *aligned;
        -: 1371:
   115842: 1372:  _dbus_assert (len >= 0);
call    0 returned 100%
        -: 1373:
        -: 1374:  /* Print blanks on first row if appropriate */
   115842: 1375:  aligned = _DBUS_ALIGN_ADDRESS (data, 4);
   115842: 1376:  if (aligned > data)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####: 1377:    aligned -= 4;
   115842: 1378:  _dbus_assert (aligned <= data);
call    0 returned 100%
        -: 1379:
   115842: 1380:  if (aligned != data)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -: 1381:    {
    #####: 1382:      _dbus_verbose ("%4d\t%p: ", - (data - aligned), aligned);
call    0 never executed
    #####: 1383:      while (aligned != data)
branch  0 never executed
branch  1 never executed
        -: 1384:        {
    #####: 1385:          _dbus_verbose ("    ");
call    0 never executed
    #####: 1386:          ++aligned;
        -: 1387:        }
        -: 1388:    }
        -: 1389:
        -: 1390:  /* now print the bytes */
   115842: 1391:  i = 0;
 13426536: 1392:  while (i < len)
branch  0 taken 99%
branch  1 taken 1% (fallthrough)
        -: 1393:    {
 13194852: 1394:      if (_DBUS_ALIGN_ADDRESS (&data[i], 4) == &data[i])
branch  0 taken 25% (fallthrough)
branch  1 taken 75%
        -: 1395:        {
  3326334: 1396:          _dbus_verbose ("%4d\t%p: ",
call    0 returned 100%
        -: 1397:                         offset + i, &data[i]);
        -: 1398:        }
        -: 1399:
 16926644: 1400:      if (data[i] >= 32 &&
branch  0 taken 30% (fallthrough)
branch  1 taken 70%
branch  2 taken 94% (fallthrough)
branch  3 taken 6%
        -: 1401:          data[i] <= 126)
  3731792: 1402:        _dbus_verbose (" '%c' ", data[i]);
call    0 returned 100%
        -: 1403:      else
  9463060: 1404:        _dbus_verbose ("0x%s%x ",
branch  0 taken 97% (fallthrough)
branch  1 taken 3%
call    2 returned 100%
        -: 1405:                       data[i] <= 0xf ? "0" : "", data[i]);
        -: 1406:
 13194852: 1407:      ++i;
        -: 1408:
 13194852: 1409:      if (_DBUS_ALIGN_ADDRESS (&data[i], 4) == &data[i])
branch  0 taken 25% (fallthrough)
branch  1 taken 75%
        -: 1410:        {
  3274062: 1411:          if (i > 3)
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
  3274062: 1412:            _dbus_verbose ("BE: %d LE: %d",
call    0 returned 100%
call    1 returned 100%
call    2 returned 100%
        -: 1413:                           _dbus_unpack_uint32 (DBUS_BIG_ENDIAN, &data[i-4]),
        -: 1414:                           _dbus_unpack_uint32 (DBUS_LITTLE_ENDIAN, &data[i-4]));
        -: 1415:
  3274062: 1416:          if (i > 7 &&
branch  0 taken 96% (fallthrough)
branch  1 taken 4%
branch  2 taken 51% (fallthrough)
branch  3 taken 49%
        -: 1417:              _DBUS_ALIGN_ADDRESS (&data[i], 8) == &data[i])
        -: 1418:            {
        -: 1419:#ifdef DBUS_HAVE_INT64
        -: 1420:              /* I think I probably mean "GNU libc printf" and not "GNUC"
        -: 1421:               * but we'll wait until someone complains. If you hit this,
        -: 1422:               * just turn off verbose mode as a workaround.
        -: 1423:               */
        -: 1424:#if __GNUC__
  1611932: 1425:              _dbus_verbose (" u64: 0x%llx",
call    0 returned 100%
        -: 1426:                             *(dbus_uint64_t*)&data[i-8]);
        -: 1427:#endif
        -: 1428:#endif
  1611932: 1429:              _dbus_verbose (" dbl: %g",
call    0 returned 100%
        -: 1430:                             *(double*)&data[i-8]);
        -: 1431:            }
        -: 1432:
  3274062: 1433:          _dbus_verbose ("\n");
call    0 returned 100%
        -: 1434:        }
        -: 1435:    }
        -: 1436:
   115842: 1437:  _dbus_verbose ("\n");
call    0 returned 100%
   115842: 1438:}
        -: 1439:
        -: 1440:/**
        -: 1441: * Dump the given part of the string to verbose log.
        -: 1442: *
        -: 1443: * @param str the string
        -: 1444: * @param start the start of range to dump
        -: 1445: * @param len length of range
        -: 1446: */
        -: 1447:void
        -: 1448:_dbus_verbose_bytes_of_string (const DBusString    *str,
        -: 1449:                               int                  start,
        -: 1450:                               int                  len)
function _dbus_verbose_bytes_of_string called 115842 returned 100% blocks executed 64%
   115842: 1451:{
        -: 1452:  const char *d;
        -: 1453:  int real_len;
        -: 1454:
   115842: 1455:  real_len = _dbus_string_get_length (str);
call    0 returned 100%
        -: 1456:
   115842: 1457:  _dbus_assert (start >= 0);
call    0 returned 100%
        -: 1458:
   115842: 1459:  if (start > real_len)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -: 1460:    {
    #####: 1461:      _dbus_verbose ("  [%d,%d) is not inside string of length %d\n",
call    0 never executed
        -: 1462:                     start, len, real_len);
    #####: 1463:      return;
        -: 1464:    }
        -: 1465:
   115842: 1466:  if ((start + len) > real_len)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -: 1467:    {
    #####: 1468:      _dbus_verbose ("  [%d,%d) extends outside string of length %d\n",
call    0 never executed
        -: 1469:                     start, len, real_len);
    #####: 1470:      len = real_len - start;
        -: 1471:    }
        -: 1472:
   115842: 1473:  d = _dbus_string_get_const_data_len (str, start, len);
call    0 returned 100%
        -: 1474:
   115842: 1475:  _dbus_verbose_bytes (d, len, start);
call    0 returned 100%
        -: 1476:}
        -: 1477:
        -: 1478:static int
        -: 1479:map_type_char_to_type (int t)
function map_type_char_to_type called 95092686 returned 100% blocks executed 100%
 95092686: 1480:{
 95092686: 1481:  if (t == DBUS_STRUCT_BEGIN_CHAR)
branch  0 taken 25% (fallthrough)
branch  1 taken 75%
 23701765: 1482:    return DBUS_TYPE_STRUCT;
 71390921: 1483:  else if (t == DBUS_DICT_ENTRY_BEGIN_CHAR)
branch  0 taken 1% (fallthrough)
branch  1 taken 99%
    35358: 1484:    return DBUS_TYPE_DICT_ENTRY;
        -: 1485:  else
        -: 1486:    {
 71355563: 1487:      _dbus_assert (t != DBUS_STRUCT_END_CHAR);
call    0 returned 100%
 71355563: 1488:      _dbus_assert (t != DBUS_DICT_ENTRY_END_CHAR);
call    0 returned 100%
 71355563: 1489:      return t;
        -: 1490:    }
        -: 1491:}
        -: 1492:
        -: 1493:/**
        -: 1494: * Get the first type in the signature. The difference between this
        -: 1495: * and just getting the first byte of the signature is that you won't
        -: 1496: * get DBUS_STRUCT_BEGIN_CHAR, you'll get DBUS_TYPE_STRUCT
        -: 1497: * instead.
        -: 1498: *
        -: 1499: * @param str string containing signature
        -: 1500: * @param pos where the signature starts
        -: 1501: * @returns the first type in the signature
        -: 1502: */
        -: 1503:int
        -: 1504:_dbus_first_type_in_signature (const DBusString *str,
        -: 1505:                               int               pos)
function _dbus_first_type_in_signature called 95091176 returned 100% blocks executed 100%
 95091176: 1506:{
 95091176: 1507:  return map_type_char_to_type (_dbus_string_get_byte (str, pos));
call    0 returned 100%
call    1 returned 100%
        -: 1508:}
        -: 1509:
        -: 1510:/**
        -: 1511: * Similar to #_dbus_first_type_in_signature, but operates
        -: 1512: * on a C string buffer.
        -: 1513: *
        -: 1514: * @param str a C string buffer
        -: 1515: * @param pos where the signature starts
        -: 1516: * @returns the first type in the signature
        -: 1517: */
        -: 1518:int
        -: 1519:_dbus_first_type_in_signature_c_str (const char       *str,
        -: 1520:				     int               pos)
function _dbus_first_type_in_signature_c_str called 1510 returned 100% blocks executed 100%
     1510: 1521:{
     1510: 1522:  return map_type_char_to_type (str[pos]);
call    0 returned 100%
        -: 1523:}
        -: 1524:
        -: 1525:/** @} */
        -: 1526:
        -: 1527:#ifdef DBUS_BUILD_TESTS
        -: 1528:#include "dbus-test.h"
        -: 1529:#include <stdio.h>
        -: 1530:
        -: 1531:static void
        -: 1532:swap_test_array (void *array,
        -: 1533:                 int   len_bytes,
        -: 1534:                 int   byte_order,
        -: 1535:                 int   alignment)
function swap_test_array called 12 returned 100% blocks executed 100%
       12: 1536:{
        -: 1537:  DBusString t;
        -: 1538:
       12: 1539:  if (alignment == 1)
branch  0 taken 17% (fallthrough)
branch  1 taken 83%
        2: 1540:    return;
        -: 1541:  
       10: 1542:  _dbus_string_init_const_len (&t, array, len_bytes);
call    0 returned 100%
       10: 1543:  swap_array (&t, 0, len_bytes / alignment, byte_order, alignment);
call    0 returned 100%
        -: 1544:}
        -: 1545:
        -: 1546:#define MARSHAL_BASIC(typename, byte_order, literal)                    \
        -: 1547:  do {                                                                  \
        -: 1548:     v_##typename = literal;                                            \
        -: 1549:     if (!_dbus_marshal_write_basic (&str, pos, DBUS_TYPE_##typename,   \
        -: 1550:                                    &v_##typename,                      \
        -: 1551:                                    byte_order, NULL))                  \
        -: 1552:       _dbus_assert_not_reached ("no memory");                          \
        -: 1553:   } while (0)
        -: 1554:
        -: 1555:#define DEMARSHAL_BASIC(typename, byte_order)                                   \
        -: 1556:  do {                                                                          \
        -: 1557:    _dbus_marshal_read_basic (&str, pos, DBUS_TYPE_##typename, &v_##typename,   \
        -: 1558:                              byte_order, &pos);                                \
        -: 1559:  } while (0)
        -: 1560:
        -: 1561:#define DEMARSHAL_BASIC_AND_CHECK(typename, byte_order, literal)                        \
        -: 1562:  do {                                                                                  \
        -: 1563:    DEMARSHAL_BASIC (typename, byte_order);                                             \
        -: 1564:    if (literal != v_##typename)                                                        \
        -: 1565:      {                                                                                 \
        -: 1566:        _dbus_verbose_bytes_of_string (&str, dump_pos,                                  \
        -: 1567:                                     _dbus_string_get_length (&str) - dump_pos);        \
        -: 1568:        _dbus_assert_not_reached ("demarshaled wrong value");                           \
        -: 1569:      }                                                                                 \
        -: 1570:  } while (0)
        -: 1571:
        -: 1572:#define MARSHAL_TEST(typename, byte_order, literal)             \
        -: 1573:  do {                                                          \
        -: 1574:    MARSHAL_BASIC (typename, byte_order, literal);              \
        -: 1575:    dump_pos = pos;                                             \
        -: 1576:    DEMARSHAL_BASIC_AND_CHECK (typename, byte_order, literal);  \
        -: 1577:  } while (0)
        -: 1578:
        -: 1579:#define MARSHAL_TEST_STRCMP(typename, byte_order, literal)                              \
        -: 1580:  do {                                                                                  \
        -: 1581:    MARSHAL_BASIC (typename, byte_order, literal);                                      \
        -: 1582:    dump_pos = pos;                                                                     \
        -: 1583:    DEMARSHAL_BASIC (typename, byte_order);                                             \
        -: 1584:    if (strcmp (literal, v_##typename) != 0)                                            \
        -: 1585:      {                                                                                 \
        -: 1586:        _dbus_verbose_bytes_of_string (&str, dump_pos,                                  \
        -: 1587:                                       _dbus_string_get_length (&str) - dump_pos);      \
        -: 1588:        _dbus_warn ("literal '%s'\nvalue  '%s'\n", literal, v_##typename);              \
        -: 1589:        _dbus_assert_not_reached ("demarshaled wrong value");                           \
        -: 1590:      }                                                                                 \
        -: 1591:  } while (0)
        -: 1592:
        -: 1593:#define MARSHAL_FIXED_ARRAY(typename, byte_order, literal)                                      \
        -: 1594:  do {                                                                                          \
        -: 1595:     int next;                                                                                  \
        -: 1596:     v_UINT32 = sizeof(literal);                                                                \
        -: 1597:     if (!_dbus_marshal_write_basic (&str, pos, DBUS_TYPE_UINT32, &v_UINT32,                    \
        -: 1598:                                     byte_order, &next))                                        \
        -: 1599:       _dbus_assert_not_reached ("no memory");                                                  \
        -: 1600:     v_ARRAY_##typename = literal;                                                              \
        -: 1601:     if (!_dbus_marshal_write_fixed_multi (&str, next, DBUS_TYPE_##typename,                    \
        -: 1602:                                           &v_ARRAY_##typename, _DBUS_N_ELEMENTS(literal),      \
        -: 1603:                                           byte_order, NULL))                                   \
        -: 1604:       _dbus_assert_not_reached ("no memory");                                                  \
        -: 1605:   } while (0)
        -: 1606:
        -: 1607:#define DEMARSHAL_FIXED_ARRAY(typename, byte_order)                                             \
        -: 1608:  do {                                                                                          \
        -: 1609:    int next;                                                                                   \
        -: 1610:    alignment = _dbus_type_get_alignment (DBUS_TYPE_##typename);                                \
        -: 1611:    v_UINT32 = _dbus_marshal_read_uint32 (&str, dump_pos, byte_order, &next);                   \
        -: 1612:    _dbus_marshal_read_fixed_multi (&str, next, DBUS_TYPE_##typename, &v_ARRAY_##typename,      \
        -: 1613:                                    v_UINT32/alignment,                                         \
        -: 1614:                                    byte_order, NULL);                                          \
        -: 1615:    swap_test_array (v_ARRAY_##typename, v_UINT32,                                              \
        -: 1616:                     byte_order, alignment);                                                    \
        -: 1617:  } while (0)
        -: 1618:
        -: 1619:#define DEMARSHAL_FIXED_ARRAY_AND_CHECK(typename, byte_order, literal)                  \
        -: 1620:  do {                                                                                  \
        -: 1621:    DEMARSHAL_FIXED_ARRAY (typename, byte_order);                                       \
        -: 1622:    if (memcmp (literal, v_ARRAY_##typename, sizeof (literal) != 0))                    \
        -: 1623:      {                                                                                 \
        -: 1624:        _dbus_verbose ("MARSHALED DATA\n");                                             \
        -: 1625:        _dbus_verbose_bytes_of_string (&str, dump_pos,                                  \
        -: 1626:                                      _dbus_string_get_length (&str) - dump_pos);       \
        -: 1627:        _dbus_verbose ("LITERAL DATA\n");                                               \
        -: 1628:        _dbus_verbose_bytes ((char*)literal, sizeof (literal), 0);                      \
        -: 1629:        _dbus_verbose ("READ DATA\n");                                                  \
        -: 1630:        _dbus_verbose_bytes ((char*)v_ARRAY_##typename, sizeof (literal), 0);           \
        -: 1631:        _dbus_assert_not_reached ("demarshaled wrong fixed array value");               \
        -: 1632:      }                                                                                 \
        -: 1633:  } while (0)
        -: 1634:
        -: 1635:#define MARSHAL_TEST_FIXED_ARRAY(typename, byte_order, literal)         \
        -: 1636:  do {                                                                  \
        -: 1637:    MARSHAL_FIXED_ARRAY (typename, byte_order, literal);                \
        -: 1638:    dump_pos = pos;                                                     \
        -: 1639:    DEMARSHAL_FIXED_ARRAY_AND_CHECK (typename, byte_order, literal);    \
        -: 1640:  } while (0)
        -: 1641:
        -: 1642:dbus_bool_t
        -: 1643:_dbus_marshal_test (void)
function _dbus_marshal_test called 1 returned 100% blocks executed 52%
        1: 1644:{
        -: 1645:  int alignment;
        -: 1646:  DBusString str;
        -: 1647:  int pos, dump_pos;
        1: 1648:  unsigned char array1[5] = { 3, 4, 0, 1, 9 };
        1: 1649:  dbus_int16_t array2[3] = { 124, 457, 780 };
        1: 1650:  dbus_int32_t array4[3] = { 123, 456, 789 };
        -: 1651:#ifdef DBUS_HAVE_INT64
        -: 1652:  dbus_int64_t array8[3] = { DBUS_INT64_CONSTANT (0x123ffffffff),
        -: 1653:                             DBUS_INT64_CONSTANT (0x456ffffffff),
        1: 1654:                             DBUS_INT64_CONSTANT (0x789ffffffff) };
        -: 1655:  dbus_int64_t *v_ARRAY_INT64;
        -: 1656:#endif
        -: 1657:  unsigned char *v_ARRAY_BYTE;
        -: 1658:  dbus_int16_t *v_ARRAY_INT16;
        -: 1659:  dbus_uint16_t *v_ARRAY_UINT16;
        -: 1660:  dbus_int32_t *v_ARRAY_INT32;
        -: 1661:  dbus_uint32_t *v_ARRAY_UINT32;
        -: 1662:  double *v_ARRAY_DOUBLE;
        -: 1663:  DBusString t;
        -: 1664:  double v_DOUBLE;
        -: 1665:  double t_DOUBLE;
        -: 1666:  dbus_int16_t v_INT16;
        -: 1667:  dbus_uint16_t v_UINT16;
        -: 1668:  dbus_int32_t v_INT32;
        -: 1669:  dbus_uint32_t v_UINT32;
        -: 1670:  dbus_int64_t v_INT64;
        -: 1671:  dbus_uint64_t v_UINT64;
        -: 1672:  unsigned char v_BYTE;
        -: 1673:  dbus_bool_t v_BOOLEAN;
        -: 1674:  const char *v_STRING;
        -: 1675:  const char *v_SIGNATURE;
        -: 1676:  const char *v_OBJECT_PATH;
        -: 1677:  int byte_order;
        -: 1678:
        1: 1679:  if (!_dbus_string_init (&str))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 1680:    _dbus_assert_not_reached ("failed to init string");
call    0 never executed
        -: 1681:
        1: 1682:  pos = 0;
        -: 1683:
        -: 1684:  /* Marshal doubles */
        1: 1685:  MARSHAL_BASIC (DOUBLE, DBUS_BIG_ENDIAN, 3.14);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
        1: 1686:  DEMARSHAL_BASIC (DOUBLE, DBUS_BIG_ENDIAN);
call    0 returned 100%
        1: 1687:  t_DOUBLE = 3.14;
        1: 1688:  if (!_DBUS_DOUBLES_BITWISE_EQUAL (t_DOUBLE, v_DOUBLE))
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
branch  2 taken 100% (fallthrough)
branch  3 taken 0%
branch  4 taken 100% (fallthrough)
branch  5 taken 0%
branch  6 taken 100% (fallthrough)
branch  7 taken 0%
branch  8 taken 100% (fallthrough)
branch  9 taken 0%
branch 10 taken 100% (fallthrough)
branch 11 taken 0%
branch 12 taken 100% (fallthrough)
branch 13 taken 0%
branch 14 taken 0% (fallthrough)
branch 15 taken 100%
    #####: 1689:    _dbus_assert_not_reached ("got wrong double value");
call    0 never executed
        -: 1690:
        1: 1691:  MARSHAL_BASIC (DOUBLE, DBUS_LITTLE_ENDIAN, 3.14);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
        1: 1692:  DEMARSHAL_BASIC (DOUBLE, DBUS_LITTLE_ENDIAN);
call    0 returned 100%
        1: 1693:  t_DOUBLE = 3.14;
        1: 1694:  if (!_DBUS_DOUBLES_BITWISE_EQUAL (t_DOUBLE, v_DOUBLE))
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
branch  2 taken 100% (fallthrough)
branch  3 taken 0%
branch  4 taken 100% (fallthrough)
branch  5 taken 0%
branch  6 taken 100% (fallthrough)
branch  7 taken 0%
branch  8 taken 100% (fallthrough)
branch  9 taken 0%
branch 10 taken 100% (fallthrough)
branch 11 taken 0%
branch 12 taken 100% (fallthrough)
branch 13 taken 0%
branch 14 taken 0% (fallthrough)
branch 15 taken 100%
    #####: 1695:    _dbus_assert_not_reached ("got wrong double value");
call    0 never executed
        -: 1696:
        -: 1697:  /* Marshal signed 16 integers */
        1: 1698:  MARSHAL_TEST (INT16, DBUS_BIG_ENDIAN, -12345);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
        1: 1699:  MARSHAL_TEST (INT16, DBUS_LITTLE_ENDIAN, -12345);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
        -: 1700:
        -: 1701:  /* Marshal unsigned 16 integers */
        1: 1702:  MARSHAL_TEST (UINT16, DBUS_BIG_ENDIAN, 0x1234);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
        1: 1703:  MARSHAL_TEST (UINT16, DBUS_LITTLE_ENDIAN, 0x1234);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
        -: 1704:  
        -: 1705:  /* Marshal signed integers */
        1: 1706:  MARSHAL_TEST (INT32, DBUS_BIG_ENDIAN, -12345678);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
        1: 1707:  MARSHAL_TEST (INT32, DBUS_LITTLE_ENDIAN, -12345678);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
        -: 1708:
        -: 1709:  /* Marshal unsigned integers */
        1: 1710:  MARSHAL_TEST (UINT32, DBUS_BIG_ENDIAN, 0x12345678);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
        1: 1711:  MARSHAL_TEST (UINT32, DBUS_LITTLE_ENDIAN, 0x12345678);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
        -: 1712:
        -: 1713:#ifdef DBUS_HAVE_INT64
        -: 1714:  /* Marshal signed integers */
        1: 1715:  MARSHAL_TEST (INT64, DBUS_BIG_ENDIAN, DBUS_INT64_CONSTANT (-0x123456789abc7));
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
        1: 1716:  MARSHAL_TEST (INT64, DBUS_LITTLE_ENDIAN, DBUS_INT64_CONSTANT (-0x123456789abc7));
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
        -: 1717:
        -: 1718:  /* Marshal unsigned integers */
        1: 1719:  MARSHAL_TEST (UINT64, DBUS_BIG_ENDIAN, DBUS_UINT64_CONSTANT (0x123456789abc7));
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
        1: 1720:  MARSHAL_TEST (UINT64, DBUS_LITTLE_ENDIAN, DBUS_UINT64_CONSTANT (0x123456789abc7));
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
        -: 1721:#endif /* DBUS_HAVE_INT64 */
        -: 1722:
        -: 1723:  /* Marshal byte */
        1: 1724:  MARSHAL_TEST (BYTE, DBUS_BIG_ENDIAN, 5);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
        1: 1725:  MARSHAL_TEST (BYTE, DBUS_LITTLE_ENDIAN, 5);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
        -: 1726:
        -: 1727:  /* Marshal all possible bools! */
        1: 1728:  MARSHAL_TEST (BOOLEAN, DBUS_BIG_ENDIAN, FALSE);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
        1: 1729:  MARSHAL_TEST (BOOLEAN, DBUS_LITTLE_ENDIAN, FALSE);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
        1: 1730:  MARSHAL_TEST (BOOLEAN, DBUS_BIG_ENDIAN, TRUE);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
        1: 1731:  MARSHAL_TEST (BOOLEAN, DBUS_LITTLE_ENDIAN, TRUE);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
        -: 1732:
        -: 1733:  /* Marshal strings */
        1: 1734:  MARSHAL_TEST_STRCMP (STRING, DBUS_BIG_ENDIAN, "");
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
call   10 never executed
        1: 1735:  MARSHAL_TEST_STRCMP (STRING, DBUS_LITTLE_ENDIAN, "");
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
call   10 never executed
        1: 1736:  MARSHAL_TEST_STRCMP (STRING, DBUS_BIG_ENDIAN, "This is the dbus test string");
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
call    5 returned 100%
branch  6 taken 0% (fallthrough)
branch  7 taken 100%
call    8 never executed
call    9 never executed
call   10 never executed
call   11 never executed
        1: 1737:  MARSHAL_TEST_STRCMP (STRING, DBUS_LITTLE_ENDIAN, "This is the dbus test string");
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
call    5 returned 100%
branch  6 taken 0% (fallthrough)
branch  7 taken 100%
call    8 never executed
call    9 never executed
call   10 never executed
call   11 never executed
        -: 1738:
        -: 1739:  /* object paths */
        1: 1740:  MARSHAL_TEST_STRCMP (OBJECT_PATH, DBUS_BIG_ENDIAN, "/a/b/c");
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
call    5 returned 100%
branch  6 taken 0% (fallthrough)
branch  7 taken 100%
call    8 never executed
call    9 never executed
call   10 never executed
call   11 never executed
        1: 1741:  MARSHAL_TEST_STRCMP (OBJECT_PATH, DBUS_LITTLE_ENDIAN, "/a/b/c");
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
call    5 returned 100%
branch  6 taken 0% (fallthrough)
branch  7 taken 100%
call    8 never executed
call    9 never executed
call   10 never executed
call   11 never executed
        -: 1742:
        -: 1743:  /* signatures */
        1: 1744:  MARSHAL_TEST_STRCMP (SIGNATURE, DBUS_BIG_ENDIAN, "");
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
call   10 never executed
        1: 1745:  MARSHAL_TEST_STRCMP (SIGNATURE, DBUS_LITTLE_ENDIAN, "");
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 never executed
call    9 never executed
call   10 never executed
        1: 1746:  MARSHAL_TEST_STRCMP (SIGNATURE, DBUS_BIG_ENDIAN, "a(ii)");
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
call    5 returned 100%
branch  6 taken 0% (fallthrough)
branch  7 taken 100%
call    8 never executed
call    9 never executed
call   10 never executed
call   11 never executed
        1: 1747:  MARSHAL_TEST_STRCMP (SIGNATURE, DBUS_LITTLE_ENDIAN, "a(ii)");
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
call    5 returned 100%
branch  6 taken 0% (fallthrough)
branch  7 taken 100%
call    8 never executed
call    9 never executed
call   10 never executed
call   11 never executed
        -: 1748:
        -: 1749:  /* Arrays */
        1: 1750:  MARSHAL_TEST_FIXED_ARRAY (INT16, DBUS_BIG_ENDIAN, array2);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 returned 100%
call    9 returned 100%
call   10 returned 100%
call   11 returned 100%
branch 12 taken 0% (fallthrough)
branch 13 taken 100%
call   14 never executed
call   15 never executed
call   16 never executed
call   17 never executed
call   18 never executed
call   19 never executed
call   20 never executed
call   21 never executed
        1: 1751:  MARSHAL_TEST_FIXED_ARRAY (INT16, DBUS_LITTLE_ENDIAN, array2);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 returned 100%
call    9 returned 100%
call   10 returned 100%
call   11 returned 100%
branch 12 taken 0% (fallthrough)
branch 13 taken 100%
call   14 never executed
call   15 never executed
call   16 never executed
call   17 never executed
call   18 never executed
call   19 never executed
call   20 never executed
call   21 never executed
        1: 1752:  MARSHAL_TEST_FIXED_ARRAY (UINT16, DBUS_BIG_ENDIAN, array2);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 returned 100%
call    9 returned 100%
call   10 returned 100%
call   11 returned 100%
branch 12 taken 0% (fallthrough)
branch 13 taken 100%
call   14 never executed
call   15 never executed
call   16 never executed
call   17 never executed
call   18 never executed
call   19 never executed
call   20 never executed
call   21 never executed
        1: 1753:  MARSHAL_TEST_FIXED_ARRAY (UINT16, DBUS_LITTLE_ENDIAN, array2);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 returned 100%
call    9 returned 100%
call   10 returned 100%
call   11 returned 100%
branch 12 taken 0% (fallthrough)
branch 13 taken 100%
call   14 never executed
call   15 never executed
call   16 never executed
call   17 never executed
call   18 never executed
call   19 never executed
call   20 never executed
call   21 never executed
        -: 1754:  
        1: 1755:  MARSHAL_TEST_FIXED_ARRAY (INT32, DBUS_BIG_ENDIAN, array4);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 returned 100%
call    9 returned 100%
call   10 returned 100%
call   11 returned 100%
branch 12 taken 0% (fallthrough)
branch 13 taken 100%
call   14 never executed
call   15 never executed
call   16 never executed
call   17 never executed
call   18 never executed
call   19 never executed
call   20 never executed
call   21 never executed
        1: 1756:  MARSHAL_TEST_FIXED_ARRAY (INT32, DBUS_LITTLE_ENDIAN, array4);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 returned 100%
call    9 returned 100%
call   10 returned 100%
call   11 returned 100%
branch 12 taken 0% (fallthrough)
branch 13 taken 100%
call   14 never executed
call   15 never executed
call   16 never executed
call   17 never executed
call   18 never executed
call   19 never executed
call   20 never executed
call   21 never executed
        1: 1757:  MARSHAL_TEST_FIXED_ARRAY (UINT32, DBUS_BIG_ENDIAN, array4);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 returned 100%
call    9 returned 100%
call   10 returned 100%
call   11 returned 100%
branch 12 taken 0% (fallthrough)
branch 13 taken 100%
call   14 never executed
call   15 never executed
call   16 never executed
call   17 never executed
call   18 never executed
call   19 never executed
call   20 never executed
call   21 never executed
        1: 1758:  MARSHAL_TEST_FIXED_ARRAY (UINT32, DBUS_LITTLE_ENDIAN, array4);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 returned 100%
call    9 returned 100%
call   10 returned 100%
call   11 returned 100%
branch 12 taken 0% (fallthrough)
branch 13 taken 100%
call   14 never executed
call   15 never executed
call   16 never executed
call   17 never executed
call   18 never executed
call   19 never executed
call   20 never executed
call   21 never executed
        -: 1759:
        1: 1760:  MARSHAL_TEST_FIXED_ARRAY (BYTE, DBUS_BIG_ENDIAN, array1);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 returned 100%
call    9 returned 100%
call   10 returned 100%
call   11 returned 100%
branch 12 taken 0% (fallthrough)
branch 13 taken 100%
call   14 never executed
call   15 never executed
call   16 never executed
call   17 never executed
call   18 never executed
call   19 never executed
call   20 never executed
call   21 never executed
        1: 1761:  MARSHAL_TEST_FIXED_ARRAY (BYTE, DBUS_LITTLE_ENDIAN, array1);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 returned 100%
call    9 returned 100%
call   10 returned 100%
call   11 returned 100%
branch 12 taken 0% (fallthrough)
branch 13 taken 100%
call   14 never executed
call   15 never executed
call   16 never executed
call   17 never executed
call   18 never executed
call   19 never executed
call   20 never executed
call   21 never executed
        -: 1762:  
        -: 1763:#ifdef DBUS_HAVE_INT64
        1: 1764:  MARSHAL_TEST_FIXED_ARRAY (INT64, DBUS_BIG_ENDIAN, array8);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 returned 100%
call    9 returned 100%
call   10 returned 100%
call   11 returned 100%
branch 12 taken 0% (fallthrough)
branch 13 taken 100%
call   14 never executed
call   15 never executed
call   16 never executed
call   17 never executed
call   18 never executed
call   19 never executed
call   20 never executed
call   21 never executed
        1: 1765:  MARSHAL_TEST_FIXED_ARRAY (INT64, DBUS_LITTLE_ENDIAN, array8);
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
branch  5 taken 0% (fallthrough)
branch  6 taken 100%
call    7 never executed
call    8 returned 100%
call    9 returned 100%
call   10 returned 100%
call   11 returned 100%
branch 12 taken 0% (fallthrough)
branch 13 taken 100%
call   14 never executed
call   15 never executed
call   16 never executed
call   17 never executed
call   18 never executed
call   19 never executed
call   20 never executed
call   21 never executed
        -: 1766:#endif
        -: 1767:
        -: 1768:#if 0
        -: 1769:
        -: 1770:  /*
        -: 1771:   * FIXME restore the set/pack tests
        -: 1772:   */
        -: 1773:
        -: 1774:#ifdef DBUS_HAVE_INT64
        -: 1775:  /* set/pack 64-bit integers */
        -: 1776:  _dbus_string_set_length (&str, 8);
        -: 1777:
        -: 1778:  /* signed little */
        -: 1779:  _dbus_marshal_set_int64 (&str, DBUS_LITTLE_ENDIAN,
        -: 1780:                           0, DBUS_INT64_CONSTANT (-0x123456789abc7));
        -: 1781:
        -: 1782:  _dbus_assert (DBUS_INT64_CONSTANT (-0x123456789abc7) ==
        -: 1783:                _dbus_unpack_int64 (DBUS_LITTLE_ENDIAN,
        -: 1784:                                    _dbus_string_get_const_data (&str)));
        -: 1785:
        -: 1786:  /* signed big */
        -: 1787:  _dbus_marshal_set_int64 (&str, DBUS_BIG_ENDIAN,
        -: 1788:                           0, DBUS_INT64_CONSTANT (-0x123456789abc7));
        -: 1789:
        -: 1790:  _dbus_assert (DBUS_INT64_CONSTANT (-0x123456789abc7) ==
        -: 1791:                _dbus_unpack_int64 (DBUS_BIG_ENDIAN,
        -: 1792:                                    _dbus_string_get_const_data (&str)));
        -: 1793:
        -: 1794:  /* signed little pack */
        -: 1795:  _dbus_pack_int64 (DBUS_INT64_CONSTANT (-0x123456789abc7),
        -: 1796:                    DBUS_LITTLE_ENDIAN,
        -: 1797:                    _dbus_string_get_data (&str));
        -: 1798:
        -: 1799:  _dbus_assert (DBUS_INT64_CONSTANT (-0x123456789abc7) ==
        -: 1800:                _dbus_unpack_int64 (DBUS_LITTLE_ENDIAN,
        -: 1801:                                    _dbus_string_get_const_data (&str)));
        -: 1802:
        -: 1803:  /* signed big pack */
        -: 1804:  _dbus_pack_int64 (DBUS_INT64_CONSTANT (-0x123456789abc7),
        -: 1805:                    DBUS_BIG_ENDIAN,
        -: 1806:                    _dbus_string_get_data (&str));
        -: 1807:
        -: 1808:  _dbus_assert (DBUS_INT64_CONSTANT (-0x123456789abc7) ==
        -: 1809:                _dbus_unpack_int64 (DBUS_BIG_ENDIAN,
        -: 1810:                                    _dbus_string_get_const_data (&str)));
        -: 1811:
        -: 1812:  /* unsigned little */
        -: 1813:  _dbus_marshal_set_uint64 (&str, DBUS_LITTLE_ENDIAN,
        -: 1814:                            0, DBUS_UINT64_CONSTANT (0x123456789abc7));
        -: 1815:
        -: 1816:  _dbus_assert (DBUS_UINT64_CONSTANT (0x123456789abc7) ==
        -: 1817:                _dbus_unpack_uint64 (DBUS_LITTLE_ENDIAN,
        -: 1818:                                     _dbus_string_get_const_data (&str)));
        -: 1819:
        -: 1820:  /* unsigned big */
        -: 1821:  _dbus_marshal_set_uint64 (&str, DBUS_BIG_ENDIAN,
        -: 1822:                            0, DBUS_UINT64_CONSTANT (0x123456789abc7));
        -: 1823:
        -: 1824:  _dbus_assert (DBUS_UINT64_CONSTANT (0x123456789abc7) ==
        -: 1825:                _dbus_unpack_uint64 (DBUS_BIG_ENDIAN,
        -: 1826:                                     _dbus_string_get_const_data (&str)));
        -: 1827:
        -: 1828:  /* unsigned little pack */
        -: 1829:  _dbus_pack_uint64 (DBUS_UINT64_CONSTANT (0x123456789abc7),
        -: 1830:                     DBUS_LITTLE_ENDIAN,
        -: 1831:                     _dbus_string_get_data (&str));
        -: 1832:
        -: 1833:  _dbus_assert (DBUS_UINT64_CONSTANT (0x123456789abc7) ==
        -: 1834:                _dbus_unpack_uint64 (DBUS_LITTLE_ENDIAN,
        -: 1835:                                     _dbus_string_get_const_data (&str)));
        -: 1836:
        -: 1837:  /* unsigned big pack */
        -: 1838:  _dbus_pack_uint64 (DBUS_UINT64_CONSTANT (0x123456789abc7),
        -: 1839:                     DBUS_BIG_ENDIAN,
        -: 1840:                     _dbus_string_get_data (&str));
        -: 1841:
        -: 1842:  _dbus_assert (DBUS_UINT64_CONSTANT (0x123456789abc7) ==
        -: 1843:                _dbus_unpack_uint64 (DBUS_BIG_ENDIAN,
        -: 1844:                                     _dbus_string_get_const_data (&str)));
        -: 1845:#endif /* DBUS_HAVE_INT64 */
        -: 1846:
        -: 1847:  /* set/pack 32-bit integers */
        -: 1848:  _dbus_string_set_length (&str, 4);
        -: 1849:
        -: 1850:  /* signed little */
        -: 1851:  _dbus_marshal_set_int32 (&str, DBUS_LITTLE_ENDIAN,
        -: 1852:                           0, -0x123456);
        -: 1853:
        -: 1854:  _dbus_assert (-0x123456 ==
        -: 1855:                _dbus_unpack_int32 (DBUS_LITTLE_ENDIAN,
        -: 1856:                                    _dbus_string_get_const_data (&str)));
        -: 1857:
        -: 1858:  /* signed big */
        -: 1859:  _dbus_marshal_set_int32 (&str, DBUS_BIG_ENDIAN,
        -: 1860:                           0, -0x123456);
        -: 1861:
        -: 1862:  _dbus_assert (-0x123456 ==
        -: 1863:                _dbus_unpack_int32 (DBUS_BIG_ENDIAN,
        -: 1864:                                    _dbus_string_get_const_data (&str)));
        -: 1865:
        -: 1866:  /* signed little pack */
        -: 1867:  _dbus_pack_int32 (-0x123456,
        -: 1868:                    DBUS_LITTLE_ENDIAN,
        -: 1869:                    _dbus_string_get_data (&str));
        -: 1870:
        -: 1871:  _dbus_assert (-0x123456 ==
        -: 1872:                _dbus_unpack_int32 (DBUS_LITTLE_ENDIAN,
        -: 1873:                                    _dbus_string_get_const_data (&str)));
        -: 1874:
        -: 1875:  /* signed big pack */
        -: 1876:  _dbus_pack_int32 (-0x123456,
        -: 1877:                    DBUS_BIG_ENDIAN,
        -: 1878:                    _dbus_string_get_data (&str));
        -: 1879:
        -: 1880:  _dbus_assert (-0x123456 ==
        -: 1881:                _dbus_unpack_int32 (DBUS_BIG_ENDIAN,
        -: 1882:                                    _dbus_string_get_const_data (&str)));
        -: 1883:
        -: 1884:  /* unsigned little */
        -: 1885:  _dbus_marshal_set_uint32 (&str,
        -: 1886:                            0, 0x123456,
        -: 1887:                            DBUS_LITTLE_ENDIAN);
        -: 1888:
        -: 1889:  _dbus_assert (0x123456 ==
        -: 1890:                _dbus_unpack_uint32 (DBUS_LITTLE_ENDIAN,
        -: 1891:                                     _dbus_string_get_const_data (&str)));
        -: 1892:
        -: 1893:  /* unsigned big */
        -: 1894:  _dbus_marshal_set_uint32 (&str,
        -: 1895:                            0, 0x123456,
        -: 1896:                            DBUS_BIG_ENDIAN);
        -: 1897:
        -: 1898:  _dbus_assert (0x123456 ==
        -: 1899:                _dbus_unpack_uint32 (DBUS_BIG_ENDIAN,
        -: 1900:                                     _dbus_string_get_const_data (&str)));
        -: 1901:
        -: 1902:  /* unsigned little pack */
        -: 1903:  _dbus_pack_uint32 (0x123456,
        -: 1904:                     DBUS_LITTLE_ENDIAN,
        -: 1905:                     _dbus_string_get_data (&str));
        -: 1906:
        -: 1907:  _dbus_assert (0x123456 ==
        -: 1908:                _dbus_unpack_uint32 (DBUS_LITTLE_ENDIAN,
        -: 1909:                                     _dbus_string_get_const_data (&str)));
        -: 1910:
        -: 1911:  /* unsigned big pack */
        -: 1912:  _dbus_pack_uint32 (0x123456,
        -: 1913:                     DBUS_BIG_ENDIAN,
        -: 1914:                     _dbus_string_get_data (&str));
        -: 1915:
        -: 1916:  _dbus_assert (0x123456 ==
        -: 1917:                _dbus_unpack_uint32 (DBUS_BIG_ENDIAN,
        -: 1918:                                     _dbus_string_get_const_data (&str)));
        -: 1919:
        -: 1920:#endif /* set/pack tests for integers */
        -: 1921:
        -: 1922:  /* Strings in-place set */
        1: 1923:  byte_order = DBUS_LITTLE_ENDIAN;
        -: 1924:  while (TRUE)
        -: 1925:    {
        -: 1926:      /* Init a string */
        2: 1927:      _dbus_string_set_length (&str, 0);
call    0 returned 100%
        -: 1928:
        -: 1929:      /* reset pos for the macros */
        2: 1930:      pos = 0;
        -: 1931:
        2: 1932:      MARSHAL_TEST_STRCMP (STRING, byte_order, "Hello world");
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
call    3 never executed
call    4 returned 100%
call    5 returned 100%
branch  6 taken 0% (fallthrough)
branch  7 taken 100%
call    8 never executed
call    9 never executed
call   10 never executed
call   11 never executed
        -: 1933:
        -: 1934:      /* Set it to something longer */
        2: 1935:      _dbus_string_init_const (&t, "Hello world foo");
call    0 returned 100%
        -: 1936:
        2: 1937:      v_STRING = _dbus_string_get_const_data (&t);
call    0 returned 100%
        2: 1938:      _dbus_marshal_set_basic (&str, 0, DBUS_TYPE_STRING,
call    0 returned 100%
        -: 1939:                               &v_STRING, byte_order, NULL, NULL);
        -: 1940:
        2: 1941:      _dbus_marshal_read_basic (&str, 0, DBUS_TYPE_STRING,
call    0 returned 100%
        -: 1942:                                &v_STRING, byte_order,
        -: 1943:                                NULL);
        2: 1944:      _dbus_assert (strcmp (v_STRING, "Hello world foo") == 0);
call    0 returned 100%
call    1 returned 100%
        -: 1945:
        -: 1946:      /* Set it to something shorter */
        2: 1947:      _dbus_string_init_const (&t, "Hello");
call    0 returned 100%
        -: 1948:
        2: 1949:      v_STRING = _dbus_string_get_const_data (&t);
call    0 returned 100%
        2: 1950:      _dbus_marshal_set_basic (&str, 0, DBUS_TYPE_STRING,
call    0 returned 100%
        -: 1951:                               &v_STRING, byte_order, NULL, NULL);
        2: 1952:      _dbus_marshal_read_basic (&str, 0, DBUS_TYPE_STRING,
call    0 returned 100%
        -: 1953:                                &v_STRING, byte_order,
        -: 1954:                                NULL);
        2: 1955:      _dbus_assert (strcmp (v_STRING, "Hello") == 0);
call    0 returned 100%
call    1 returned 100%
        -: 1956:
        -: 1957:      /* Do the other byte order */
        2: 1958:      if (byte_order == DBUS_LITTLE_ENDIAN)
branch  0 taken 50% (fallthrough)
branch  1 taken 50%
        1: 1959:        byte_order = DBUS_BIG_ENDIAN;
        -: 1960:      else
        1: 1961:        break;
        1: 1962:    }
        -: 1963:
        -: 1964:  /* Clean up */
        1: 1965:  _dbus_string_free (&str);
call    0 returned 100%
        -: 1966:
        1: 1967:  return TRUE;
        -: 1968:}
        -: 1969:
        -: 1970:#endif /* DBUS_BUILD_TESTS */