LCOV - code coverage report
Current view: top level - tests - catch_version.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 15 15 100.0 %
Date: 2024-06-15 08:26:09 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :   Zipios -- a small C++ library that provides easy access to .zip files.
       3             : 
       4             :   Copyright (C) 2000-2007  Thomas Sondergaard
       5             :   Copyright (c) 2015-2022  Made to Order Software Corp.  All Rights Reserved
       6             : 
       7             :   This library is free software; you can redistribute it and/or
       8             :   modify it under the terms of the GNU Lesser General Public
       9             :   License as published by the Free Software Foundation; either
      10             :   version 2.1 of the License, or (at your option) any later version.
      11             : 
      12             :   This library is distributed in the hope that it will be useful,
      13             :   but WITHOUT ANY WARRANTY; without even the implied warranty of
      14             :   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      15             :   Lesser General Public License for more details.
      16             : 
      17             :   You should have received a copy of the GNU Lesser General Public License
      18             :   along with this library; if not, write to the Free Software Foundation,
      19             :   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
      20             : */
      21             : 
      22             : /** \file
      23             :  *
      24             :  * Zipios unit tests for the ZipFile class.
      25             :  */
      26             : 
      27             : #include "catch_main.hpp"
      28             : 
      29             : #include <zipios/zipfile.hpp>
      30             : #include <zipios/directorycollection.hpp>
      31             : #include <zipios/zipiosexceptions.hpp>
      32             : #include <zipios/dosdatetime.hpp>
      33             : 
      34             : #include <algorithm>
      35             : #include <fstream>
      36             : 
      37             : #include <unistd.h>
      38             : #include <string.h>
      39             : #include <zlib.h>
      40             : 
      41             : 
      42             : 
      43             : namespace
      44             : {
      45             : 
      46             : 
      47             : zipios::StorageMethod const g_supported_storage_methods[]
      48             : {
      49             :     zipios::StorageMethod::STORED,
      50             :     zipios::StorageMethod::DEFLATED
      51             : };
      52             : 
      53             : 
      54             : } // no name namespace
      55             : 
      56             : 
      57             : 
      58             : 
      59           1 : CATCH_TEST_CASE("CMakeLists_and_changelog_versions", "[Version]")
      60             : {
      61           1 :     CATCH_START_SECTION("compare the CMakeLists and the debian/changelog versions")
      62             :     {
      63           1 :         std::string cmd("cd ");
      64           1 :         cmd += SNAP_CATCH2_NAMESPACE::g_source_dir();
      65           1 :         cmd += " && dev/version";
      66           1 :         std::cout << "command to check version: `" << cmd << "`\n";
      67           1 :         CATCH_REQUIRE(system(cmd.c_str()) == 0);
      68           1 :     }
      69           1 :     CATCH_END_SECTION()
      70           1 : }
      71             : 
      72             : 
      73           1 : CATCH_TEST_CASE("library_version", "[Version]")
      74             : {
      75           1 :     CATCH_START_SECTION("compare the compile time version against the current library version")
      76             :     {
      77           1 :         CATCH_REQUIRE(strcmp(zipios::getVersion(), ZIPIOS_VERSION_STRING) == 0);
      78             :     }
      79           1 :     CATCH_END_SECTION()
      80           1 : }
      81             : 
      82             : 
      83             : // Local Variables:
      84             : // mode: cpp
      85             : // indent-tabs-mode: nil
      86             : // c-basic-offset: 4
      87             : // tab-width: 4
      88             : // End:
      89             : 
      90             : // vim: ts=4 sw=4 et
      91             : 

Generated by: LCOV version 1.14

Snap C++ | List of projects | List of versions