#include "souffle/utility/CacheUtil.h"
#include "souffle/utility/ContainerUtil.h"
#include "souffle/utility/FileUtil.h"
#include "souffle/utility/FunctionalUtil.h"
#include "souffle/utility/MiscUtil.h"
#include "souffle/utility/ParallelUtil.h"
#include "souffle/utility/StreamUtil.h"
#include "souffle/utility/StringUtil.h"
#include <algorithm>
#include <fstream>
#include <iostream>
#include <limits>
#include <random>
#include <set>
#include <string>
#include <utility>
#include <vector>
Go to the source code of this file.
|  | 
| #define | _EXPECT(condition,  loc) | 
|  | 
| #define | ASSERT_LE(a,  b)   fatal((a) <= (b), "LE(" #a "," #b ")", LOC) | 
|  | 
| #define | ASSERT_TRUE(a)   fatal(a, #a, LOC) | 
|  | 
| #define | EXPECT_EQ(a,  b) | 
|  | 
| #define | EXPECT_FALSE(a)   _EXPECT(!(a), LOC) << "expecting " << #a << " to be false, evaluated to true" | 
|  | 
| #define | EXPECT_LT(a,  b) | 
|  | 
| #define | EXPECT_NE(a,  b) | 
|  | 
| #define | EXPECT_PRED2(p,  a,  b) | 
|  | 
| #define | EXPECT_STREQ(a,  b) | 
|  | 
| #define | EXPECT_TRUE(a)   _EXPECT(a, LOC) << "expecting " << #a << " to be true, evaluated to false" | 
|  | 
| #define | LOC   S__LINE__ | 
|  | 
| #define | S(x)   #x | 
|  | 
| #define | S_(x)   S(x) | 
|  | 
| #define | S__LINE__   S_(__LINE__) | 
|  | 
| #define | TEST(a,  b) | 
|  | 
◆ _EXPECT
      
        
          | #define _EXPECT | ( |  | condition, | 
        
          |  |  |  | loc | 
        
          |  | ) |  |  | 
      
 
Value:    if (auto __res = evaluate(condition)) { \
    } else                                  \
        logstream << "\t\tTEST FAILED @ line " << (loc) << " : "
Definition at line 184 of file test.h.
 
 
◆ ASSERT_LE
      
        
          | #define ASSERT_LE | ( |  | a, | 
        
          |  |  |  | b | 
        
          |  | ) |  | fatal((a) <= (b), "LE(" #a "," #b ")", LOC) | 
      
 
 
◆ ASSERT_TRUE
      
        
          | #define ASSERT_TRUE | ( |  | a | ) | fatal(a, #a, LOC) | 
      
 
 
◆ EXPECT_EQ
      
        
          | #define EXPECT_EQ | ( |  | a, | 
        
          |  |  |  | b | 
        
          |  | ) |  |  | 
      
 
Value:    _EXPECT((a) == (
b), 
LOC) << 
"expected " << #a << 
" == " << #
b << 
" where\n\t\t\t" << #a             \
 
                             << 
" evaluates to " << 
toString(a) << 
"\n\t\t\t" << #
b << 
" evaluates to " \
Definition at line 191 of file test.h.
 
 
◆ EXPECT_FALSE
      
        
          | #define EXPECT_FALSE | ( |  | a | ) | _EXPECT(!(a), LOC) << "expecting " << #a << " to be false, evaluated to true" | 
      
 
 
◆ EXPECT_LT
      
        
          | #define EXPECT_LT | ( |  | a, | 
        
          |  |  |  | b | 
        
          |  | ) |  |  | 
      
 
Value:    _EXPECT((a) < (
b), 
LOC) << 
"expected " << #a << 
" < " << #
b << 
" where\n\t\t\t" << #a              \
 
                            << 
" evaluates to " << 
toString(a) << 
"\n\t\t\t" << #
b << 
" evaluates to " \
Definition at line 199 of file test.h.
 
 
◆ EXPECT_NE
      
        
          | #define EXPECT_NE | ( |  | a, | 
        
          |  |  |  | b | 
        
          |  | ) |  |  | 
      
 
Value:    _EXPECT((a) != (
b), 
LOC) << 
"expected " << #a << 
" != " << #
b << 
" where\n\t\t\t" << #a             \
 
                             << 
" evaluates to " << 
toString(a) << 
"\n\t\t\t" << #
b << 
" evaluates to " \
Definition at line 195 of file test.h.
 
 
◆ EXPECT_PRED2
      
        
          | #define EXPECT_PRED2 | ( |  | p, | 
        
          |  |  |  | a, | 
        
          |  |  |  | b | 
        
          |  | ) |  |  | 
      
 
Value:    _EXPECT(
p(a, 
b), 
LOC) << 
"expected " << (#
p "(" #a 
"," #
b ")") << 
" where\n\t\t\t" << #a         \
 
                          << 
" evaluates to " << 
toString(a) << 
"\n\t\t\t" << #
b << 
" evaluates to " \
Definition at line 207 of file test.h.
 
 
◆ EXPECT_STREQ
      
        
          | #define EXPECT_STREQ | ( |  | a, | 
        
          |  |  |  | b | 
        
          |  | ) |  |  | 
      
 
Value:
            << 
"expected std::string(" << #a << 
") == std::string(" << #
b << 
") where\n\t\t\t" << #a \
 
Definition at line 203 of file test.h.
 
 
◆ EXPECT_TRUE
      
        
          | #define EXPECT_TRUE | ( |  | a | ) | _EXPECT(a, LOC) << "expecting " << #a << " to be true, evaluated to false" | 
      
 
 
◆ LOC
◆ S_
◆ S__LINE__
      
        
          | #define S__LINE__   S_(__LINE__) | 
      
 
 
◆ TEST
Value:
    public:                                                              \
        test_##a##_##
b(std::string g, std::string t) : 
TestCase(g, t) {} \
    } Test_##a##_##
b(#a, #
b);                                            \
    void test_##a##_##b::run()
 
Definition at line 171 of file test.h.
 
 
◆ main()
      
        
          | int main | ( | int | , | 
        
          |  |  | char ** |  | 
        
          |  | ) |  |  | 
      
 
Main program of a unit test. 
Definition at line 218 of file test.h.
  220     std::set<std::string> groups;
 
  222         groups.insert(
p->getGroup());
 
  227     for (
auto& group : groups) {
 
  228         std::cout << group << 
"\n";
 
  230             if (
p->getGroup() == group) {
 
  232                 std::cerr << 
"\t" << ((
p->getFailed() == 0) ? 
"OK" : 
"FAILED");
 
  233                 std::cerr << 
" (" << 
p->getChecks() - 
p->getFailed();
 
  234                 std::cerr << 
"/" << 
p->getChecks();
 
  235                 std::cerr << 
")\t" << 
p->getTest() << 
"\n";
 
  236                 if (
p->getFailed() != 0) {
 
  244         std::cerr << 
"Tests failed.\n";
 
 
References base, and p.
 
 
◆ base
 
a horizontalBars(j=m=void 0===a.axisX.type?new c.AutoScaleAxis(c.Axis.units.x, b.normalized.series, o, c.extend({}, a.axisX,{highLow:d, referenceValue:0})):a.axisX.type.call(c, c.Axis.units.x, b.normalized.series, o, c.extend({}, a.axisX,{highLow:d, referenceValue:0})), l=n=void 0===a.axisY.type?new c.StepAxis(c.Axis.units.y, b.normalized.series, o,{ticks:k}):a.axisY.type.call(c, c.Axis.units.y, b.normalized.series, o, a.axisY)) var p