scsl 1.0.1
Shimmering Clarity Standard Library
Loading...
Searching...
No Matches
Namespaces | Macros
Checks.h File Reference

Provides a number of utility macros for testing. More...

#include <scmp/Math.h>
Include dependency graph for Checks.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  sctest
 Shimmering Clarity testing library.
 

Macros

#define SCTEST_CHECK(x)   if (!(x)) { return false; }
 
#define SCTEST_CHECK_FALSE(x)   if ((x)) { return false; }
 
#define SCTEST_CHECK_EQ(x, y)   if ((x) != (y)) { return false; }
 
#define SCTEST_CHECK_NE(x, y)   if ((x) == (y)) { return false; }
 
#define SCTEST_CHECK_GEQ(x, y)   if ((x) < (y)) { return false; }
 
#define SCTEST_CHECK_LEQ(x, y)   if ((x) > (y)) { return false; }
 
#define SCTEST_CHECK_FEQ(x, y)   { float eps; scmp::DefaultEpsilon(eps); if (!scmp::WithinTolerance((x), (y), eps)) { return false; }}
 
#define SCTEST_CHECK_DEQ(x, y)   { double eps; scmp::DefaultEpsilon(eps); if (!scmp::WithinTolerance((x), (y), eps)) { return false; }}
 
#define SCTEST_CHECK_FEQ_EPS(x, y, eps)   { if (!scmp::WithinTolerance<float>((x), (y), (eps))) { return false; }}
 
#define SCTEST_CHECK_FNE_EPS(x, y, eps)   { if (scmp::WithinTolerance<float>((x), (y), (eps))) { return false; }}
 
#define SCTEST_CHECK_DEQ_EPS(x, y, eps)   { if (!scmp::WithinTolerance<double>((x), (y), (eps))) { return false; }}
 
#define SCTEST_CHECK_DNE_EPS(x, y, eps)   { if (scmp::WithinTolerance<double>((x), (y), (eps))) { return false; }}
 

Detailed Description

Provides a number of utility macros for testing.

Author
K. Isom kyle@.nosp@m.imap.nosp@m..cc
Date
2017-06-05

Copyright 2017 K. Isom kyle@.nosp@m.imap.nosp@m..cc

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all /// copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Macro Definition Documentation

◆ SCTEST_CHECK

#define SCTEST_CHECK (   x)    if (!(x)) { return false; }

◆ SCTEST_CHECK_DEQ

#define SCTEST_CHECK_DEQ (   x,
 
)    { double eps; scmp::DefaultEpsilon(eps); if (!scmp::WithinTolerance((x), (y), eps)) { return false; }}

◆ SCTEST_CHECK_DEQ_EPS

#define SCTEST_CHECK_DEQ_EPS (   x,
  y,
  eps 
)    { if (!scmp::WithinTolerance<double>((x), (y), (eps))) { return false; }}

◆ SCTEST_CHECK_DNE_EPS

#define SCTEST_CHECK_DNE_EPS (   x,
  y,
  eps 
)    { if (scmp::WithinTolerance<double>((x), (y), (eps))) { return false; }}

◆ SCTEST_CHECK_EQ

#define SCTEST_CHECK_EQ (   x,
 
)    if ((x) != (y)) { return false; }

◆ SCTEST_CHECK_FALSE

#define SCTEST_CHECK_FALSE (   x)    if ((x)) { return false; }

◆ SCTEST_CHECK_FEQ

#define SCTEST_CHECK_FEQ (   x,
 
)    { float eps; scmp::DefaultEpsilon(eps); if (!scmp::WithinTolerance((x), (y), eps)) { return false; }}

◆ SCTEST_CHECK_FEQ_EPS

#define SCTEST_CHECK_FEQ_EPS (   x,
  y,
  eps 
)    { if (!scmp::WithinTolerance<float>((x), (y), (eps))) { return false; }}

◆ SCTEST_CHECK_FNE_EPS

#define SCTEST_CHECK_FNE_EPS (   x,
  y,
  eps 
)    { if (scmp::WithinTolerance<float>((x), (y), (eps))) { return false; }}

◆ SCTEST_CHECK_GEQ

#define SCTEST_CHECK_GEQ (   x,
 
)    if ((x) < (y)) { return false; }

◆ SCTEST_CHECK_LEQ

#define SCTEST_CHECK_LEQ (   x,
 
)    if ((x) > (y)) { return false; }

◆ SCTEST_CHECK_NE

#define SCTEST_CHECK_NE (   x,
 
)    if ((x) == (y)) { return false; }