wpkg test coverage results

Coverage test results of the Windows Packager by Made to Order Software Corporation.

LCOV - code coverage report
Current view: top level - libexpr/libexpr - exceptions.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 18 19 94.7 %
Date: 2013-07-16 Functions: 18 29 62.1 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*    exceptions -- the libexpr exceptions implementation
       2             :  *    Copyright (C) 2007-2013  Made to Order Software Corporation
       3             :  *
       4             :  *    This program is free software; you can redistribute it and/or modify
       5             :  *    it under the terms of the GNU General Public License as published by
       6             :  *    the Free Software Foundation; either version 2 of the License, or
       7             :  *    (at your option) any later version.
       8             :  *
       9             :  *    This program is distributed in the hope that it will be useful,
      10             :  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
      11             :  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      12             :  *    GNU General Public License for more details.
      13             :  *
      14             :  *    You should have received a copy of the GNU General Public License along
      15             :  *    with this program; if not, write to the Free Software Foundation, Inc.,
      16             :  *    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      17             :  *
      18             :  *    Authors
      19             :  *    Alexis Wilke   alexis@m2osw.com
      20             :  */
      21             : #ifndef LIBEXPR_EXCEPTIONS_H
      22             : #define LIBEXPR_EXCEPTIONS_H
      23             : 
      24             : #include        "libexpr/expr_export.h"
      25             : 
      26             : #include        <stdexcept>
      27             : #include        <string>
      28             : 
      29             : namespace libexpr
      30             : {
      31             : 
      32             : /// All the libexpr exceptions
      33         153 : class libexpr_exception : public std::runtime_error
      34             : {
      35             : public:
      36         153 :         libexpr_exception(const std::string& msg) : runtime_error(msg) {}
      37             : };
      38             : 
      39             : /// Run-time errors in the libexpr (syntax errors, overflows, etc.)
      40         153 : class libexpr_runtime_error : public libexpr_exception
      41             : {
      42             : public:
      43         153 :         libexpr_runtime_error(const std::string& msg) : libexpr_exception(msg) {}
      44             : };
      45             : 
      46             : /// Some internal error (i.e. invalid value for a variable)
      47           0 : class libexpr_internal_error : public libexpr_exception
      48             : {
      49             : public:
      50             :         libexpr_internal_error(const std::string& msg) : libexpr_exception(msg) {}
      51             : };
      52             : 
      53             : /// Type is not valid for the required operation
      54           6 : class invalid_type : public libexpr_runtime_error
      55             : {
      56             : public:
      57           6 :         invalid_type(const std::string& msg) : libexpr_runtime_error(msg) {}
      58             : };
      59             : 
      60             : /// Type is valid, but not compatible for the operation
      61          81 : class incompatible_type : public libexpr_runtime_error
      62             : {
      63             : public:
      64          81 :         incompatible_type(const std::string& msg) : libexpr_runtime_error(msg) {}
      65             : };
      66             : 
      67             : /// Syntax error (unexpected or missing token)
      68          27 : class syntax_error : public libexpr_runtime_error
      69             : {
      70             : public:
      71          27 :         syntax_error(const std::string& msg) : libexpr_runtime_error(msg) {}
      72             : };
      73             : 
      74             : /// Expected a variable instead of a value (3 = 5, "3" incorrect, or 7++)
      75          19 : class expected_a_variable : public libexpr_runtime_error
      76             : {
      77             : public:
      78          19 :         expected_a_variable(const std::string& msg) : libexpr_runtime_error(msg) {}
      79             : };
      80             : 
      81             : /// Trying to read a variable that is not set yet
      82          16 : class undefined_variable : public libexpr_runtime_error
      83             : {
      84             : public:
      85          16 :         undefined_variable(const std::string& msg) : libexpr_runtime_error(msg) {}
      86             : };
      87             : 
      88             : /// Trying to call a function that is not defined
      89           1 : class undefined_function : public libexpr_runtime_error
      90             : {
      91             : public:
      92           1 :         undefined_function(const std::string& msg) : libexpr_runtime_error(msg) {}
      93             : };
      94             : 
      95             : /// Trying to call a function with an invalid argument
      96           2 : class function_args : public libexpr_runtime_error
      97             : {
      98             : public:
      99           2 :         function_args(const std::string& msg) : libexpr_runtime_error(msg) {}
     100             : };
     101             : 
     102             : 
     103             : }               // namespace libexpr
     104             : 
     105             : 
     106             : #endif // LIBEXPR_EXCEPTIONS_H

Generated by: LCOV version 1.9

The wpkg tool is an open source tool created by Made to Order Software Corporation.