LCOV - code coverage report
Current view: top level - tests - point.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 15 15 100.0 %
Date: 2022-01-29 21:33:29 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : // Copyright (c) 2021-2022  Made to Order Software Corp.  All Rights Reserved
       2             : //
       3             : // https://snapwebsites.org/project/ftmesh
       4             : // contact@m2osw.com
       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 along
      17             : // with this program; if not, write to the Free Software Foundation, Inc.,
      18             : // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      19             : 
      20             : // self
      21             : //
      22             : #include    "main.h"
      23             : 
      24             : 
      25             : // ftmesh lib
      26             : //
      27             : #include    <ftmesh/point.h>
      28             : 
      29             : 
      30             : // snapdev lib
      31             : //
      32             : #include    <snapdev/not_reached.h>
      33             : 
      34             : 
      35             : // C lib
      36             : //
      37             : #include    <unistd.h>
      38             : 
      39             : 
      40             : // we're testing many of those here so ignore warnings
      41             : //
      42             : #pragma GCC diagnostic ignored "-Wfloat-equal"
      43             : 
      44             : 
      45           3 : CATCH_TEST_CASE("point", "[point]")
      46             : {
      47           2 :     CATCH_START_SECTION("Verify constructors and copy")
      48             :     {
      49           1 :         ftmesh::point a;
      50             : 
      51           1 :         CATCH_REQUIRE(SNAP_CATCH2_NAMESPACE::nearly_equal(a.f_coordinates[0], 0.0, 0.0));
      52           1 :         CATCH_REQUIRE(SNAP_CATCH2_NAMESPACE::nearly_equal(a.f_coordinates[1], 0.0, 0.0));
      53           1 :         CATCH_REQUIRE(SNAP_CATCH2_NAMESPACE::nearly_equal(a.f_coordinates[2], 0.0, 0.0));
      54             : 
      55           1 :         ftmesh::point b(-33.5, +55.0);
      56             : 
      57           1 :         CATCH_REQUIRE(SNAP_CATCH2_NAMESPACE::nearly_equal(b.f_coordinates[0], -33.5, 0.0));
      58           1 :         CATCH_REQUIRE(SNAP_CATCH2_NAMESPACE::nearly_equal(b.f_coordinates[1], 55.0, 0.0));
      59           1 :         CATCH_REQUIRE(SNAP_CATCH2_NAMESPACE::nearly_equal(b.f_coordinates[2], 0.0, 0.0));
      60             : 
      61           1 :         a = b;
      62             : 
      63           1 :         CATCH_REQUIRE(SNAP_CATCH2_NAMESPACE::nearly_equal(a.f_coordinates[0], -33.5, 0.0));
      64           1 :         CATCH_REQUIRE(SNAP_CATCH2_NAMESPACE::nearly_equal(a.f_coordinates[1], 55.0, 0.0));
      65           1 :         CATCH_REQUIRE(SNAP_CATCH2_NAMESPACE::nearly_equal(a.f_coordinates[2], 0.0, 0.0));
      66             :     }
      67             :     CATCH_END_SECTION()
      68           7 : }
      69             : 
      70             : 
      71             : // vim: ts=4 sw=4 et

Generated by: LCOV version 1.13