LCOV - code coverage report
Current view: top level - common - pack.cc (source / functions) Hit Total Coverage
Test: Test Coverage for xapian-core 954b5873a738 Lines: 4 5 80.0 %
Date: 2019-06-30 05:20:33 Functions: 1 1 100.0 %
Branches: 4 8 50.0 %

           Branch data     Line data    Source code
       1                 :            : /** @file pack.cc
       2                 :            :  * @brief Pack types into strings and unpack them again.
       3                 :            :  */
       4                 :            : /* Copyright (C) 2019 Olly Betts
       5                 :            :  *
       6                 :            :  * This program is free software; you can redistribute it and/or modify
       7                 :            :  * it under the terms of the GNU General Public License as published by
       8                 :            :  * the Free Software Foundation; either version 2 of the License, or
       9                 :            :  * (at your option) any later version.
      10                 :            :  *
      11                 :            :  * This program is distributed in the hope that it will be useful,
      12                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      13                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      14                 :            :  * GNU General Public License for more details.
      15                 :            :  *
      16                 :            :  * You should have received a copy of the GNU General Public License
      17                 :            :  * along with this program; if not, write to the Free Software
      18                 :            :  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
      19                 :            :  */
      20                 :            : 
      21                 :            : #include <config.h>
      22                 :            : 
      23                 :            : #include "pack.h"
      24                 :            : 
      25                 :            : #include <xapian/error.h>
      26                 :            : 
      27                 :            : [[noreturn]]
      28                 :            : void
      29                 :          1 : unpack_throw_serialisation_error(const char* p)
      30                 :            : {
      31                 :            :     const char* m;
      32         [ +  - ]:          1 :     if (p == NULL) {
      33                 :          1 :         m = "Insufficient serialised data";
      34                 :            :     } else {
      35                 :          0 :         m = "Serialised data overflowed type";
      36                 :            :     }
      37 [ +  - ][ +  - ]:          1 :     throw Xapian::SerialisationError(m);
                 [ +  - ]
      38                 :            : }

Generated by: LCOV version 1.11