-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
692 additions
and
44 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
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,50 @@ | ||
<!-- | ||
TTS - Tiny Test System | ||
Copyright 2020 Joel FALCOU | ||
Licensed under the MIT License <http://opensource.org/licenses/MIT>. | ||
SPDX-License-Identifier: MIT | ||
--> | ||
|
||
<meta charset="utf-8"> | ||
|
||
TTS_CONSTEXPR_EQUAL | ||
---------------------------------------------------------------------------------------------------- | ||
|
||
**Synopsis:** | ||
|
||
<script type="preformatted"> | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c++ | ||
#define TTS_CONSTEXPR_EQUAL(LHS,RHS) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
</script> | ||
|
||
**Required header:** <script type="preformatted">`#include <tts/tts.hpp>`</script> | ||
|
||
Performs equality comparison between two values in a `constexpr` context. This comparison is | ||
performed by using the proper `operator==` overload or by a [custom comparison](extensions.htm#customizationpoints). | ||
|
||
**Parameters:** | ||
: | ||
- `LHS`, `RHS`: Expressions to compare | ||
|
||
**Example:** | ||
|
||
<script type="preformatted"> | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c++ | ||
#include <tts/tts.hpp> | ||
|
||
TTS_CASE( "Check correctness of constexpr equality tests" ) | ||
{ | ||
constexpr float a = 45.f; | ||
constexpr int b = 45; | ||
|
||
TTS_CONSTEXPR_EQUAL(a, b); | ||
} | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
</script> | ||
|
||
<!-- End of Document --> | ||
<!-- Markdeep: --> | ||
<script src="markdeep.min.js"></script> | ||
<script src="https://casual-effects.com/markdeep/latest/markdeep.min.js?"></script> |
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,52 @@ | ||
<!-- | ||
TTS - Tiny Test System | ||
Copyright 2020 Joel FALCOU | ||
Licensed under the MIT License <http://opensource.org/licenses/MIT>. | ||
SPDX-License-Identifier: MIT | ||
--> | ||
|
||
<meta charset="utf-8"> | ||
|
||
TTS_CONSTEXPR_EXPECT | ||
---------------------------------------------------------------------------------------------------- | ||
|
||
**Synopsis:** | ||
|
||
<script type="preformatted"> | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c++ | ||
#define TTS_CONSTEXPR_EXPECT(Expression) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
</script> | ||
|
||
**Required header:** <script type="preformatted">`#include <tts/tts.hpp>`</script> | ||
|
||
Checks if a given expression evaluates to `true` in a `constexpr` context. | ||
|
||
**Parameters:** | ||
: | ||
- `Expression`: Constexpr expression to evaluate and compare to `true`. | ||
|
||
**Example:** | ||
|
||
<script type="preformatted"> | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c++ | ||
#include <tts/tts.hpp> | ||
|
||
TTS_CASE( "Check that expectation can be met" ) | ||
{ | ||
constexpr int a = 42, b = 69; | ||
|
||
TTS_CONSTEXPR_EXPECT(a != b); | ||
TTS_CONSTEXPR_EXPECT(a < b); | ||
TTS_CONSTEXPR_EXPECT(a <= b); | ||
TTS_CONSTEXPR_EXPECT(b > a); | ||
TTS_CONSTEXPR_EXPECT(b >= a); | ||
} | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
</script> | ||
|
||
<!-- End of Document --> | ||
<!-- Markdeep: --> | ||
<script src="markdeep.min.js"></script> | ||
<script src="https://casual-effects.com/markdeep/latest/markdeep.min.js?"></script> |
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,52 @@ | ||
<!-- | ||
TTS - Tiny Test System | ||
Copyright 2020 Joel FALCOU | ||
Licensed under the MIT License <http://opensource.org/licenses/MIT>. | ||
SPDX-License-Identifier: MIT | ||
--> | ||
|
||
<meta charset="utf-8"> | ||
|
||
TTS_CONSTEXPR_EXPECT_NOT | ||
---------------------------------------------------------------------------------------------------- | ||
|
||
**Synopsis:** | ||
|
||
<script type="preformatted"> | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c++ | ||
#define TTS_CONSTEXPR_EXPECT_NOT(Expression) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
</script> | ||
|
||
**Required header:** <script type="preformatted">`#include <tts/tts.hpp>`</script> | ||
|
||
Checks if a given expression evaluates to `false`. | ||
|
||
**Parameters:** | ||
: | ||
- `Expression`: Expression to evaluate and compare to `false`. | ||
|
||
**Example:** | ||
|
||
<script type="preformatted"> | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c++ | ||
#include <tts/tts.hpp> | ||
|
||
TTS_CASE( "Check that counter-expectation can be met" ) | ||
{ | ||
constexpr int a = 42, b = 69; | ||
|
||
TTS_CONSTEXPR_EXPECT_NOT(a == b); | ||
TTS_CONSTEXPR_EXPECT_NOT(a > b); | ||
TTS_CONSTEXPR_EXPECT_NOT(a >= b); | ||
TTS_CONSTEXPR_EXPECT_NOT(b < a); | ||
TTS_CONSTEXPR_EXPECT_NOT(b <= a); | ||
} | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
</script> | ||
|
||
<!-- End of Document --> | ||
<!-- Markdeep: --> | ||
<script src="markdeep.min.js"></script> | ||
<script src="https://casual-effects.com/markdeep/latest/markdeep.min.js?"></script> |
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,48 @@ | ||
<!-- | ||
TTS - Tiny Test System | ||
Copyright 2020 Joel FALCOU | ||
Licensed under the MIT License <http://opensource.org/licenses/MIT>. | ||
SPDX-License-Identifier: MIT | ||
--> | ||
|
||
<meta charset="utf-8"> | ||
|
||
TTS_CONSTEXPR_GREATER | ||
---------------------------------------------------------------------------------------------------- | ||
|
||
**Synopsis:** | ||
|
||
<script type="preformatted"> | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c++ | ||
#define TTS_CONSTEXPR_GREATER(LHS,RHS) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
</script> | ||
|
||
**Required header:** <script type="preformatted">`#include <tts/tts.hpp>`</script> | ||
|
||
Performs greater-than comparison between two values in a `constexpr` context. | ||
This comparison is performed by using the proper `operator<` overload or | ||
by a [custom comparison](extensions.htm#customizationpoints). | ||
|
||
**Parameters:** | ||
: | ||
- `LHS`, `RHS`: Expressions to compare | ||
|
||
**Example:** | ||
|
||
<script type="preformatted"> | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c++ | ||
#include <tts/tts.hpp> | ||
|
||
TTS_CASE( "Check correctness of greater-than comparison tests" ) | ||
{ | ||
TTS_CONSTEXPR_GREATER(69LL, 42.f); | ||
} | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
</script> | ||
|
||
<!-- End of Document --> | ||
<!-- Markdeep: --> | ||
<script src="markdeep.min.js"></script> | ||
<script src="https://casual-effects.com/markdeep/latest/markdeep.min.js?"></script> |
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,49 @@ | ||
<!-- | ||
TTS - Tiny Test System | ||
Copyright 2020 Joel FALCOU | ||
Licensed under the MIT License <http://opensource.org/licenses/MIT>. | ||
SPDX-License-Identifier: MIT | ||
--> | ||
|
||
<meta charset="utf-8"> | ||
|
||
TTS_CONSTEXPR_GREATER_EQUAL | ||
---------------------------------------------------------------------------------------------------- | ||
|
||
**Synopsis:** | ||
|
||
<script type="preformatted"> | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c++ | ||
#define TTS_CONSTEXPR_GREATER_EQUAL(LHS,RHS) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
</script> | ||
|
||
**Required header:** <script type="preformatted">`#include <tts/tts.hpp>`</script> | ||
|
||
Performs greater-than-or-equal comparison between two values in a `constexpr` context. | ||
This comparison is performed by using the proper `operator<` and `operator==` overloads or | ||
by a [custom comparison](extensions.htm#customizationpoints). | ||
|
||
**Parameters:** | ||
: | ||
- `LHS`, `RHS`: Expressions to compare | ||
|
||
**Example:** | ||
|
||
<script type="preformatted"> | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c++ | ||
#include <tts/tts.hpp> | ||
|
||
TTS_CASE( "Check correctness of greater-equal comparison tests" ) | ||
{ | ||
TTS_CONSTEXPR_GREATER_EQUAL(69LL, 42.f); | ||
TTS_CONSTEXPR_GREATER_EQUAL(69., 69); | ||
} | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
</script> | ||
|
||
<!-- End of Document --> | ||
<!-- Markdeep: --> | ||
<script src="markdeep.min.js"></script> | ||
<script src="https://casual-effects.com/markdeep/latest/markdeep.min.js?"></script> |
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,48 @@ | ||
<!-- | ||
TTS - Tiny Test System | ||
Copyright 2020 Joel FALCOU | ||
Licensed under the MIT License <http://opensource.org/licenses/MIT>. | ||
SPDX-License-Identifier: MIT | ||
--> | ||
|
||
<meta charset="utf-8"> | ||
|
||
TTS_CONSTEXPR_LESS | ||
---------------------------------------------------------------------------------------------------- | ||
|
||
**Synopsis:** | ||
|
||
<script type="preformatted"> | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c++ | ||
#define TTS_CONSTEXPR_LESS(LHS,RHS) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
</script> | ||
|
||
**Required header:** <script type="preformatted">`#include <tts/tts.hpp>`</script> | ||
|
||
Performs less-than comparison between two values in a `constexpr` context. | ||
This comparison is performed by using the proper `operator<` overload or | ||
by a [custom comparison](extensions.htm#customizationpoints). | ||
|
||
**Parameters:** | ||
: | ||
- `LHS`, `RHS`: Expressions to compare | ||
|
||
**Example:** | ||
|
||
<script type="preformatted"> | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c++ | ||
#include <tts/tts.hpp> | ||
|
||
TTS_CASE( "Check correctness of less-than comparison tests" ) | ||
{ | ||
TTS_CONSTEXPR_LESS(42LL, 69.f); | ||
} | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
</script> | ||
|
||
<!-- End of Document --> | ||
<!-- Markdeep: --> | ||
<script src="markdeep.min.js"></script> | ||
<script src="https://casual-effects.com/markdeep/latest/markdeep.min.js?"></script> |
Oops, something went wrong.