-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1019 from dcoeurjo/catch
C++ unit test framework with Catch
- Loading branch information
Showing
9 changed files
with
9,624 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* @file DGtalCatch.h | ||
* @author David COEURJOLLY <David Coeurjolly <[email protected]>> | ||
* @date 28 Aug. 2015 | ||
* @brief Header file to enable catch unit test framework in DGtal. | ||
**/ | ||
|
||
#pragma once | ||
#define CATCH_CONFIG_MAIN | ||
#include "catch.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
**/ | ||
|
||
/** | ||
* @file testCatch | ||
* @ingroup Tests | ||
* @author David Coeurjolly (\c [email protected] ) | ||
* | ||
* | ||
* @date 2015/08/06 | ||
* | ||
* This file is part of the DGtal library | ||
*/ | ||
|
||
/** | ||
* Description of testCatch' <p> | ||
* Aim: simple test of \ref Catch unit test framework | ||
*/ | ||
|
||
#include "DGtalCatch.h" | ||
|
||
TEST_CASE( "Point Vector Unit tests" ) | ||
{ | ||
|
||
int a = 5; | ||
int b = 3+2; | ||
int c = a+1; | ||
|
||
SECTION("Comparisons") | ||
{ | ||
REQUIRE( (a == b) ); | ||
a=6; | ||
REQUIRE( (a == c) ); | ||
} | ||
|
||
SECTION("No side-effects on global variables in section scopes") | ||
{ | ||
REQUIRE( (a == 5) ); | ||
} | ||
|
||
} | ||
|
||
|
||
/** @ingroup Tests **/ |
Oops, something went wrong.