souffle  2.0.2-371-g6315b36
Functions
souffle::ram::test Namespace Reference

Functions

 TEST (AutoIncrement, CloneAndEquals)
 
 TEST (Clear, CloneAndEquals)
 
 TEST (Conjunction, CloneAndEquals)
 
 TEST (Constraint, CloneAndEquals)
 
 TEST (DebugInfo, CloneAndEquals)
 
 TEST (EmptinessCheck, CloneAndEquals)
 
 TEST (ExistenceCheck, CloneAndEquals)
 
 TEST (Exit, CloneAndEquals)
 
 TEST (Extend, CloneAndEquals)
 
 TEST (False, CloneAndEquals)
 
 TEST (IntrinsicOperator, CloneAndEquals)
 
 TEST (IO1, CloneAndEquals)
 
 TEST (LogRelationTimer, CloneAndEquals)
 
 TEST (LogSize, CloneAndEquals)
 
 TEST (LogTimer, CloneAndEquals)
 
 TEST (Loop, CloneAndEquals)
 
 TEST (Negation, CloneAndEquals)
 
 TEST (PackRecord, CloneAndEquals)
 
 TEST (Parallel, CloneAndEquals)
 
 TEST (Query, CloneAndEquals)
 
 TEST (RamAggregate, CloneAndEquals)
 
 TEST (RamBreak, CloneAndEquals)
 
 TEST (RamChoice, CloneAndEquals)
 
 TEST (RamFilter, CloneAndEquals)
 
 TEST (RamIndexAggregate, CloneAndEquals)
 
 TEST (RamIndexChoice, CloneAndEquals)
 
 TEST (RamIndexScan, CloneAndEquals)
 
 TEST (RamiParallelIndexChoice, CloneAndEquals)
 
 TEST (RamParallelChoice, CloneAndEquals)
 
 TEST (RamParallelIndexScan, CloneAndEquals)
 
 TEST (RamParallelScan, CloneAndEquals)
 
 TEST (RamProject, CloneAndEquals)
 
 TEST (RamProvenanceExistCheck, CloneAndEquals)
 
 TEST (RamScan, CloneAndEquals)
 
 TEST (RamSubrountineArgument, CloneAndEquals)
 
 TEST (RamSubroutineReturn, CloneAndEquals)
 
 TEST (RamUnpackedRecord, CloneAndEquals)
 
 TEST (randomConversions, RamFloat)
 
 TEST (randomConversions, RamSigned)
 
 TEST (randomConversions, RamUnsigned)
 
 TEST (Relation, CloneAndEquals)
 
 TEST (Sequence, CloneAndEquals)
 
 TEST (SignedConstant, CloneAndEquals)
 
 TEST (Swap, CloneAndEquals)
 
 TEST (True, CloneAndEquals)
 
 TEST (TupleElement, CloneAndEquals)
 
 TEST (UndefValue, CloneAndEquals)
 
 TEST (UserDefinedOperator, CloneAndEquals)
 

Function Documentation

◆ TEST() [1/48]

souffle::ram::test::TEST ( AutoIncrement  ,
CloneAndEquals   
)

Definition at line 136 of file ram_expression_equal_clone_test.cpp.

136  {
137  UndefValue a;
138  UndefValue b;
139  EXPECT_EQ(a, b);
140  EXPECT_NE(&a, &b);
141 
142  UndefValue* aClone = a.clone();
143  EXPECT_EQ(a, *aClone);
144  EXPECT_NE(&a, aClone);
145  delete aClone;
146 }

References b, souffle::ram::UndefValue::clone(), EXPECT_EQ, and EXPECT_NE.

Here is the call graph for this function:

◆ TEST() [2/48]

souffle::ram::test::TEST ( Clear  ,
CloneAndEquals   
)

Definition at line 93 of file ram_statement_equal_clone_test.cpp.

95  {
96  // MERGE B WITH A
97  Relation A("A", 1, 1, {"x"}, {"i"}, RelationRepresentation::DEFAULT);
98  Relation B("B", 1, 1, {"x"}, {"i"}, RelationRepresentation::DEFAULT);
99  Extend a("B", "A");
100  Extend b("B", "A");
101  EXPECT_EQ(a, b);
102  EXPECT_NE(&a, &b);
103 
104  Extend* c = a.clone();
105  EXPECT_EQ(a, *c);

◆ TEST() [3/48]

souffle::ram::test::TEST ( Conjunction  ,
CloneAndEquals   
)

Definition at line 78 of file ram_condition_equal_clone_test.cpp.

104  {
105  auto a = mk<True>();
106  auto neg_a = mk<Negation>(std::move(a));
107  auto b = mk<True>();
108  auto neg_b = mk<Negation>(std::move(b));
109  EXPECT_EQ(*neg_a, *neg_b);
110  EXPECT_NE(neg_a, neg_b);
111 
112  auto c = mk<False>();
113  auto neg_neg_c = mk<Negation>(mk<Negation>(std::move(c)));
114  auto d = mk<False>();

◆ TEST() [4/48]

souffle::ram::test::TEST ( Constraint  ,
CloneAndEquals   
)

Definition at line 132 of file ram_condition_equal_clone_test.cpp.

154  {
155  // N(1) in relation N(x:number)
156  Relation N("N", 1, 1, {"x"}, {"i"}, RelationRepresentation::DEFAULT);
157  VecOwn<Expression> tuple_a;
158  tuple_a.emplace_back(new SignedConstant(1));
159  ExistenceCheck a("N", std::move(tuple_a));
160  VecOwn<Expression> tuple_b;
161  tuple_b.emplace_back(new SignedConstant(1));
162  ExistenceCheck b("N", std::move(tuple_b));
163  EXPECT_EQ(a, b);
164  EXPECT_NE(&a, &b);

◆ TEST() [5/48]

souffle::ram::test::TEST ( DebugInfo  ,
CloneAndEquals   
)

Definition at line 371 of file ram_statement_equal_clone_test.cpp.

390  :- \n edge(x,y,_,@level_num_0).\nin file /edge.dl [17:1-17:26];");
391 
392  VecOwn<Expression> b_project_list;
393  b_project_list.emplace_back(new TupleElement(0, 0));
394  b_project_list.emplace_back(new TupleElement(0, 1));
395  b_project_list.emplace_back(new SignedConstant(1));
396  VecOwn<Expression> b_project_add;
397  b_project_add.emplace_back(new TupleElement(0, 3));
398  b_project_add.emplace_back(new SignedConstant(1));
399  b_project_list.emplace_back(new IntrinsicOperator(FunctorOp::ADD, std::move(b_project_add)));
400  auto b_project = mk<Project>("path", std::move(b_project_list));
401  VecOwn<Expression> b_filter1_list;
402  b_filter1_list.emplace_back(new TupleElement(0, 0));
403  b_filter1_list.emplace_back(new TupleElement(0, 1));
404  b_filter1_list.emplace_back(new UndefValue);
405  b_filter1_list.emplace_back(new UndefValue);
406  auto b_existence_check1 = mk<ExistenceCheck>("path", std::move(b_filter1_list));
407  auto b_cond1 = mk<Negation>(std::move(b_existence_check1));
408  auto b_filter1 = mk<Filter>(std::move(b_cond1), std::move(b_project), "");
409  auto b_cond2 = mk<Negation>(mk<EmptinessCheck>("edge"));
410  auto b_filter2 = mk<Filter>(std::move(b_cond2), std::move(b_filter1), "");
411  auto b_scan = mk<Scan>("edge", 0, std::move(b_filter2), "");
412  auto b_query = mk<Query>(std::move(b_scan));
413  DebugInfo b(std::move(b_query),
414  "path(x,y,1,(@level_num_0+1)) :- \n edge(x,y,_,@level_num_0).\nin file /edge.dl [17:1-17:26];");
415 
416  EXPECT_EQ(a, b);
417  EXPECT_NE(&a, &b);
418 
419  DebugInfo* c = a.clone();
420  EXPECT_EQ(a, *c);
421  EXPECT_NE(&a, c);
422  delete c;
423 }
424 
425 TEST(LogSize, CloneAndEquals) {
426  Relation A("A", 1, 1, {"x"}, {"i"}, RelationRepresentation::DEFAULT);
427  LogSize a("A", "Log message");
428  LogSize b("A", "Log message");
429  EXPECT_EQ(a, b);
430  EXPECT_NE(&a, &b);
431 
432  LogSize* c = a.clone();
433  EXPECT_EQ(a, *c);
434  EXPECT_NE(&a, c);
435  delete c;

◆ TEST() [6/48]

souffle::ram::test::TEST ( EmptinessCheck  ,
CloneAndEquals   
)

Definition at line 252 of file ram_condition_equal_clone_test.cpp.

◆ TEST() [7/48]

souffle::ram::test::TEST ( ExistenceCheck  ,
CloneAndEquals   
)

Definition at line 166 of file ram_condition_equal_clone_test.cpp.

175  {"x", "y"}, {"i", "i"}, RelationRepresentation::BRIE);
176  VecOwn<Expression> tuple_d;
177  tuple_d.emplace_back(new SignedConstant(1));
178  tuple_d.emplace_back(new SignedConstant(2));
179  ExistenceCheck d("edge", std::move(tuple_d));
180  VecOwn<Expression> tuple_e;
181  tuple_e.emplace_back(new SignedConstant(1));
182  tuple_e.emplace_back(new SignedConstant(2));
183  ExistenceCheck e("edge", std::move(tuple_e));
184  EXPECT_EQ(d, e);
185  EXPECT_NE(&d, &e);
186 
187  ExistenceCheck* f = d.clone();
188  EXPECT_EQ(d, *f);
189  EXPECT_EQ(e, *f);
190  EXPECT_NE(&d, f);
191  EXPECT_NE(&e, f);
192 
193  delete f;
194 }
195 
196 TEST(RamProvenanceExistCheck, CloneAndEquals) {
197  Relation N("N", 1, 1, {"x"}, {"i"}, RelationRepresentation::DEFAULT);
198  VecOwn<Expression> tuple_a;
199  tuple_a.emplace_back(new SignedConstant(1));
200  ExistenceCheck a("N", std::move(tuple_a));
201  VecOwn<Expression> tuple_b;
202  tuple_b.emplace_back(new SignedConstant(1));
203  ExistenceCheck b("N", std::move(tuple_b));
204  EXPECT_EQ(a, b);
205  EXPECT_NE(&a, &b);
206 

◆ TEST() [8/48]

souffle::ram::test::TEST ( Exit  ,
CloneAndEquals   
)

Definition at line 317 of file ram_statement_equal_clone_test.cpp.

319  {
320  Relation A("A", 1, 1, {"x"}, {"i"}, RelationRepresentation::DEFAULT);
321  /*
322  * START_TIMER ON A "file.dl [8:1-8:8]"
323  * IO A()
324  * END_TIMER
325  * */
326  std::map<std::string, std::string> a_IODir;
327  std::map<std::string, std::string> b_IODir;
328  LogRelationTimer a(mk<IO>("A", std::move(a_IODir)), "file.dl [8:1-8:8]", "A");
329  LogRelationTimer b(mk<IO>("A", std::move(b_IODir)), "file.dl [8:1-8:8]", "A");

◆ TEST() [9/48]

souffle::ram::test::TEST ( Extend  ,
CloneAndEquals   
)

Definition at line 107 of file ram_statement_equal_clone_test.cpp.

110  {
111  // SWAP(A,B)
112  Relation A("A", 1, 1, {"x"}, {"i"}, RelationRepresentation::DEFAULT);
113  Relation B("B", 1, 1, {"x"}, {"i"}, RelationRepresentation::DEFAULT);
114  Swap a("A", "B");
115  Swap b("A", "B");
116  EXPECT_EQ(a, b);
117  EXPECT_NE(&a, &b);
118 
119  Swap* c = a.clone();
120  EXPECT_EQ(a, *c);

◆ TEST() [10/48]

souffle::ram::test::TEST ( False  ,
CloneAndEquals   
)

Definition at line 66 of file ram_condition_equal_clone_test.cpp.

66  {
67  // true /\ false
68  auto a = mk<Conjunction>(mk<True>(), mk<False>());
69  auto b = mk<Conjunction>(mk<True>(), mk<False>());
70  EXPECT_EQ(*a, *b);
71  EXPECT_NE(a, b);
72 
73  Own<Conjunction> c(a->clone());
74  EXPECT_EQ(*a, *c);
75  EXPECT_NE(a, c);
76 

References b, EXPECT_EQ, and EXPECT_NE.

◆ TEST() [11/48]

souffle::ram::test::TEST ( IntrinsicOperator  ,
CloneAndEquals   
)

Definition at line 51 of file ram_expression_equal_clone_test.cpp.

75  {
76  // define binary functor NE check if two Expressions are not equal
77  // NE(number(1), number(10))
78  VecOwn<Expression> a_args;
79  a_args.emplace_back(new SignedConstant(1));
80  a_args.emplace_back(new SignedConstant(10));
81  UserDefinedOperator a("NE", {TypeAttribute::Signed, TypeAttribute::Signed}, TypeAttribute::Signed, false,
82  std::move(a_args));
83 
84  VecOwn<Expression> b_args;
85  b_args.emplace_back(new SignedConstant(1));

◆ TEST() [12/48]

souffle::ram::test::TEST ( IO1  ,
CloneAndEquals   
)

Definition at line 77 of file ram_statement_equal_clone_test.cpp.

81  {
82  // CLEAR A
83  Relation A("A", 1, 1, {"x"}, {"i"}, RelationRepresentation::DEFAULT);
84  Clear a("A");
85  Clear b("A");
86  EXPECT_EQ(a, b);
87  EXPECT_NE(&a, &b);
88 
89  Clear* c = a.clone();
90  EXPECT_EQ(a, *c);
91  EXPECT_NE(&a, c);

◆ TEST() [13/48]

souffle::ram::test::TEST ( LogRelationTimer  ,
CloneAndEquals   
)

Definition at line 331 of file ram_statement_equal_clone_test.cpp.

339  {
340  Relation A("A", 1, 1, {"x"}, {"i"}, RelationRepresentation::DEFAULT);
341  /*
342  * START_TIMER "@runtime"
343  * IO .. (..)
344  * END_TIMER
345  * */
346  std::map<std::string, std::string> a_IODir;
347  std::map<std::string, std::string> b_IODir;
348  LogTimer a(mk<IO>("A", std::move(a_IODir)), "@runtime");
349  LogTimer b(mk<IO>("A", std::move(a_IODir)), "@runtime");

◆ TEST() [14/48]

souffle::ram::test::TEST ( LogSize  ,
CloneAndEquals   
)

Definition at line 437 of file ram_statement_equal_clone_test.cpp.

◆ TEST() [15/48]

souffle::ram::test::TEST ( LogTimer  ,
CloneAndEquals   
)

Definition at line 351 of file ram_statement_equal_clone_test.cpp.

359  {
360  Relation edge(
361  "edge", 4, 1, {"src", "dest", "a", "b"}, {"i", "i", "i", "i"}, RelationRepresentation::DEFAULT);
362  Relation path(
363  "path", 4, 1, {"src", "dest", "a", "b"}, {"i", "i", "i", "i"}, RelationRepresentation::DEFAULT);
364  /* BEGIN_DEBUG "path(x,y,1,(@level_num_0+1)) :- \n edge(x,y,_,@level_num_0).\nin file /edge.dl
365  * [17:1-17:26];" QUERY FOR t0 IN edge IF (NOT (edge = ∅)) IF (NOT (t0.0,t0.1,⊥,⊥) ∈ path) PROJECT (t0.0,
366  * t0.1, number(1), (t0.3+number(1))) INTO path END DEBUG
367  * */
368  VecOwn<Expression> a_project_list;
369  a_project_list.emplace_back(new TupleElement(0, 0));

◆ TEST() [16/48]

souffle::ram::test::TEST ( Loop  ,
CloneAndEquals   
)

Definition at line 279 of file ram_statement_equal_clone_test.cpp.

305  {
306  Relation A("A", 1, 1, {"x"}, {"i"}, RelationRepresentation::DEFAULT);
307  // EXIT (A = ∅)
308  Exit a(mk<EmptinessCheck>("A"));
309  Exit b(mk<EmptinessCheck>("A"));
310  EXPECT_EQ(a, b);
311  EXPECT_NE(&a, &b);
312 
313  Exit* c = a.clone();
314  EXPECT_EQ(a, *c);
315  EXPECT_NE(&a, c);
316  delete c;

◆ TEST() [17/48]

souffle::ram::test::TEST ( Negation  ,
CloneAndEquals   
)

Definition at line 116 of file ram_condition_equal_clone_test.cpp.

120  {
121  // constraint t0.1 = t1.0
122  Own<Expression> a_lhs(new TupleElement(0, 1));
123  Own<Expression> a_rhs(new TupleElement(1, 0));
124  Own<Constraint> a(new Constraint(BinaryConstraintOp::EQ, std::move(a_lhs), std::move(a_rhs)));
125  Own<Expression> b_lhs(new TupleElement(0, 1));
126  Own<Expression> b_rhs(new TupleElement(1, 0));
127  Own<Constraint> b(new Constraint(BinaryConstraintOp::EQ, std::move(b_lhs), std::move(b_rhs)));
128  EXPECT_EQ(*a, *b);
129  EXPECT_NE(a, b);
130 

◆ TEST() [18/48]

souffle::ram::test::TEST ( PackRecord  ,
CloneAndEquals   
)

Definition at line 160 of file ram_expression_equal_clone_test.cpp.

200  {
201  SubroutineArgument a(2);
202  SubroutineArgument b(2);
203  EXPECT_EQ(a, b);
204  EXPECT_NE(&a, &b);
205 
206  SubroutineArgument* aClone = a.clone();
207  EXPECT_EQ(a, *aClone);
208  EXPECT_NE(&a, aClone);
209  delete aClone;
210 }

◆ TEST() [19/48]

souffle::ram::test::TEST ( Parallel  ,
CloneAndEquals   
)

Definition at line 237 of file ram_statement_equal_clone_test.cpp.

267  {
268  Relation A("A", 1, 1, {"x"}, {"i"}, RelationRepresentation::DEFAULT);
269  Relation B("B", 1, 1, {"x"}, {"i"}, RelationRepresentation::DEFAULT);
270  /*
271  * LOOP
272  * QUERY
273  * FOR t0 IN A
274  * IF t0.0 = 4 BREAK
275  * PROJECT (t0.0) INTO B
276  * END LOOP
277  * */
278  VecOwn<Expression> a_expressions;

◆ TEST() [20/48]

souffle::ram::test::TEST ( Query  ,
CloneAndEquals   
)

Definition at line 137 of file ram_statement_equal_clone_test.cpp.

184  {
185  // no statements in the sequence
186  Sequence a;
187  Sequence b;
188  EXPECT_EQ(a, b);
189  EXPECT_NE(&a, &b);
190 
191  Sequence* c = a.clone();
192  EXPECT_EQ(a, *c);
193  EXPECT_NE(&a, c);
194  delete c;

◆ TEST() [21/48]

souffle::ram::test::TEST ( RamAggregate  ,
CloneAndEquals   
)

Definition at line 346 of file ram_operation_equal_clone_test.cpp.

362  {
363  Relation sqrt("sqrt", 2, 1, {"nth", "value"}, {"i", "i"}, RelationRepresentation::DEFAULT);
364  // t0.0 = MIN t1.1 SEARCH t1 IN sqrt ON INDEX t1.0 = ⊥ AND t1.1 = ⊥
365  // WHERE t1.1 > 80
366  // RETURN t0.0

◆ TEST() [22/48]

souffle::ram::test::TEST ( RamBreak  ,
CloneAndEquals   
)

Definition at line 462 of file ram_operation_equal_clone_test.cpp.

478  {
479  Relation A("A", 2, 1, {"a", "b"}, {"i", "i"}, RelationRepresentation::DEFAULT);
480  // PROJECT (t0.1, t0.3) INTO A
481  VecOwn<Expression> a_args;
482  a_args.emplace_back(new TupleElement(0, 1));

◆ TEST() [23/48]

souffle::ram::test::TEST ( RamChoice  ,
CloneAndEquals   
)

Definition at line 184 of file ram_operation_equal_clone_test.cpp.

218  {
219  Relation edge("edge", 2, 1, {"x", "y"}, {"i", "i"}, RelationRepresentation::DEFAULT);
220  // parallel choose an edge not adjcent to vertex 5
221  // PARALLEL CHOICE t1 IN edge WHERE NOT t1.0 = 5 AND NOT t1.1 = 5
222  // RETURN (t1.0, t1.1)

◆ TEST() [24/48]

souffle::ram::test::TEST ( RamFilter  ,
CloneAndEquals   
)

Definition at line 434 of file ram_operation_equal_clone_test.cpp.

456  {
457  Relation A("A", 1, 1, {"a"}, {"i"}, RelationRepresentation::DEFAULT);
458  // IF (A = ∅) BREAK
459  // RETURN number(0)
460  VecOwn<Expression> a_return_args;

◆ TEST() [25/48]

souffle::ram::test::TEST ( RamIndexAggregate  ,
CloneAndEquals   
)

Definition at line 368 of file ram_operation_equal_clone_test.cpp.

399  {
400  // UNPACK (t0.0, t0.2) INTO t1
401  // RETURN number(0)
402  VecOwn<Expression> a_return_args;
403  a_return_args.emplace_back(new SignedConstant(0));

◆ TEST() [26/48]

souffle::ram::test::TEST ( RamIndexChoice  ,
CloneAndEquals   
)

Definition at line 264 of file ram_operation_equal_clone_test.cpp.

299  {
300  Relation edge("edge", 2, 1, {"x", "y"}, {"i", "i"}, RelationRepresentation::DEFAULT);
301  // PARALLEL FOR t1 IN edge ON INDEX t1.x = 5 AND t1.y = ⊥
302  // WHERE NOT t1.1 = 5
303  // RETURN (t1.0, t1.1)

◆ TEST() [27/48]

souffle::ram::test::TEST ( RamIndexScan  ,
CloneAndEquals   
)

Definition at line 110 of file ram_operation_equal_clone_test.cpp.

140  {
141  Relation edge("edge", 2, 1, {"x", "y"}, {"i", "i"}, RelationRepresentation::DEFAULT);
142  Relation new_edge("new_edge", 2, 1, {"x", "y"}, {"i", "i"}, RelationRepresentation::DEFAULT);
143  // get edges direct to vertex 5
144  // PARALLEL FOR t1 IN edge ON INDEX t1.x = ⊥ AND t1.y = 5

◆ TEST() [28/48]

souffle::ram::test::TEST ( RamiParallelIndexChoice  ,
CloneAndEquals   
)

Definition at line 305 of file ram_operation_equal_clone_test.cpp.

340  {
341  Relation edge("edge", 2, 1, {"x", "y"}, {"i", "i"}, RelationRepresentation::DEFAULT);
342  // t0.0 = COUNT FOR ALL t1 IN edge
343  // RETURN t0.0
344  VecOwn<Expression> a_return_args;

◆ TEST() [29/48]

souffle::ram::test::TEST ( RamParallelChoice  ,
CloneAndEquals   
)

Definition at line 224 of file ram_operation_equal_clone_test.cpp.

258  {
259  Relation edge("edge", 2, 1, {"x", "y"}, {"i", "i"}, RelationRepresentation::DEFAULT);
260  // FOR t1 IN edge ON INDEX t1.x = 5 AND t1.y = ⊥
261  // WHERE NOT t1.1 = 5
262  // RETURN (t1.0, t1.1)

◆ TEST() [30/48]

souffle::ram::test::TEST ( RamParallelIndexScan  ,
CloneAndEquals   
)

Definition at line 146 of file ram_operation_equal_clone_test.cpp.

178  {
179  Relation edge("edge", 2, 1, {"x", "y"}, {"i", "i"}, RelationRepresentation::DEFAULT);
180  // choose an edge not adjcent to vertex 5
181  // CHOICE t1 IN edge WHERE NOT t1.0 = 5 AND NOT t1.1 = 5
182  // RETURN (t1.0, t1.1)

◆ TEST() [31/48]

souffle::ram::test::TEST ( RamParallelScan  ,
CloneAndEquals   
)

Definition at line 87 of file ram_operation_equal_clone_test.cpp.

104  {
105  Relation edge("edge", 2, 1, {"x", "y"}, {"i", "i"}, RelationRepresentation::DEFAULT);
106  Relation vertex("vertex", 1, 1, {"x"}, {"i"}, RelationRepresentation::DEFAULT);
107  // get vertices contain self loop
108  // FOR t1 IN edge ON INDEX t1.x = t1.1 AND t1.y = ⊥

◆ TEST() [32/48]

souffle::ram::test::TEST ( RamProject  ,
CloneAndEquals   
)

Definition at line 484 of file ram_operation_equal_clone_test.cpp.

499  {
500  // RETURN (t0.1, t0.2)
501  VecOwn<Expression> a_args;
502  a_args.emplace_back(new TupleElement(0, 1));
503  a_args.emplace_back(new TupleElement(0, 2));

◆ TEST() [33/48]

souffle::ram::test::TEST ( RamProvenanceExistCheck  ,
CloneAndEquals   
)

Definition at line 208 of file ram_condition_equal_clone_test.cpp.

216  {"state", "postCode", "street"}, {"s", "i", "s"},
217  RelationRepresentation::DEFAULT);
218  VecOwn<Expression> tuple_d;
219  tuple_d.emplace_back(new SignedConstant(0));
220  tuple_d.emplace_back(new SignedConstant(2000));
221  tuple_d.emplace_back(new SignedConstant(0));
222  ProvenanceExistenceCheck d("address", std::move(tuple_d));
223  VecOwn<Expression> tuple_e;
224  tuple_e.emplace_back(new SignedConstant(0));
225  tuple_e.emplace_back(new SignedConstant(2000));
226  tuple_e.emplace_back(new SignedConstant(0));
227  ProvenanceExistenceCheck e("address", std::move(tuple_e));
228  EXPECT_EQ(d, e);
229  EXPECT_NE(&d, &e);
230 
231  ProvenanceExistenceCheck* f = d.clone();
232  EXPECT_EQ(d, *f);
233  EXPECT_EQ(e, *f);
234  EXPECT_NE(&d, f);
235  EXPECT_NE(&e, f);
236 
237  delete f;
238 }
239 
240 TEST(EmptinessCheck, CloneAndEquals) {
241  // Check A(x:number)
242  Relation A("A", 1, 1, {"x"}, {"i"}, RelationRepresentation::DEFAULT);
243  EmptinessCheck a("A");
244  EmptinessCheck b("A");
245  EXPECT_EQ(a, b);
246  EXPECT_NE(&a, &b);
247  EmptinessCheck* c = a.clone();
248  EXPECT_EQ(a, *c);
249  EXPECT_EQ(b, *c);
250  EXPECT_NE(&a, c);

◆ TEST() [34/48]

souffle::ram::test::TEST ( RamScan  ,
CloneAndEquals   
)

Definition at line 64 of file ram_operation_equal_clone_test.cpp.

81  {
82  Relation A("A", 1, 1, {"x"}, {"i"}, RelationRepresentation::DEFAULT);
83  // PARALLEL FOR t0 in A
84  // RETURN number(0)
85  VecOwn<Expression> a_return_args;

◆ TEST() [35/48]

souffle::ram::test::TEST ( RamSubrountineArgument  ,
CloneAndEquals   
)

Definition at line 212 of file ram_expression_equal_clone_test.cpp.

◆ TEST() [36/48]

souffle::ram::test::TEST ( RamSubroutineReturn  ,
CloneAndEquals   
)

Definition at line 505 of file ram_operation_equal_clone_test.cpp.

◆ TEST() [37/48]

souffle::ram::test::TEST ( RamUnpackedRecord  ,
CloneAndEquals   
)

Definition at line 405 of file ram_operation_equal_clone_test.cpp.

428  {
429  Relation A("A", 1, 1, {"a"}, {"i"}, RelationRepresentation::DEFAULT);
430  // IF (NOT t0.1 in A)
431  // RETURN number(0)
432  VecOwn<Expression> a_return_args;

◆ TEST() [38/48]

souffle::ram::test::TEST ( randomConversions  ,
RamFloat   
)

Definition at line 63 of file ram_type_conversion_test.cpp.

◆ TEST() [39/48]

souffle::ram::test::TEST ( randomConversions  ,
RamSigned   
)

Definition at line 33 of file ram_type_conversion_test.cpp.

42  {
43  std::mt19937 randomGenerator(3);
44  std::uniform_int_distribution<RamUnsigned> dist(0, 1000);
45 
46  for (int i = 0; i < NUMBER_OF_CONVERSION_TESTS; ++i) {

◆ TEST() [40/48]

souffle::ram::test::TEST ( randomConversions  ,
RamUnsigned   
)

Definition at line 48 of file ram_type_conversion_test.cpp.

57  {
58  std::mt19937 randomGenerator(3);
59  std::uniform_real_distribution<RamFloat> dist(-100.0, 100.0);
60 
61  for (int i = 0; i < NUMBER_OF_CONVERSION_TESTS; ++i) {

◆ TEST() [41/48]

souffle::ram::test::TEST ( Relation  ,
CloneAndEquals   
)

Definition at line 39 of file ram_relation_equal_clone_test.cpp.

◆ TEST() [42/48]

souffle::ram::test::TEST ( Sequence  ,
CloneAndEquals   
)

Definition at line 196 of file ram_statement_equal_clone_test.cpp.

196  {"x"}, {"i"}, RelationRepresentation::DEFAULT);
197  // one statement in the sequence
198  // CLEAR A
199  Sequence d(mk<Clear>("A"));
200  Sequence e(mk<Clear>("A"));
201  EXPECT_EQ(d, e);
202  EXPECT_NE(&d, &e);
203 
204  Sequence* f = d.clone();
205  EXPECT_EQ(d, *f);
206  EXPECT_NE(&d, f);
207  delete f;
208 
209  // multiple statements in the sequence
210  // IO A ()
211  // CLEAR A
212  std::map<std::string, std::string> g_load_IODir;
213  std::map<std::string, std::string> h_load_IODir;
214  Sequence g(mk<IO>("A", std::move(g_load_IODir)), mk<Clear>("A"));
215  Sequence h(mk<IO>("A", std::move(h_load_IODir)), mk<Clear>("A"));
216  EXPECT_EQ(g, h);
217  EXPECT_NE(&g, &h);
218 
219  Sequence* i = g.clone();
220  EXPECT_EQ(g, *i);
221  EXPECT_NE(&g, i);
222  delete i;
223 }
224 
225 TEST(Parallel, CloneAndEquals) {
226  Relation A("A", 3, 1, {"a", "b", "c"}, {"i", "s", "i"}, RelationRepresentation::DEFAULT);
227  Relation B("B", 2, 1, {"a", "c"}, {"i", "i"}, RelationRepresentation::DEFAULT);
228 
229  /* PARALLEL
230  * QUERY
231  * FOR t0 IN A
232  * IF (t0.0 > 0)
233  * PROJECT (t0.0, t0.2) INTO B
234  * END PARALLEL
235  * */

◆ TEST() [43/48]

souffle::ram::test::TEST ( SignedConstant  ,
CloneAndEquals   
)

Definition at line 123 of file ram_expression_equal_clone_test.cpp.

124  {
125  AutoIncrement a;
126  AutoIncrement b;
127  EXPECT_EQ(a, b);
128  EXPECT_NE(&a, &b);
129 
130  AutoIncrement* aClone = a.clone();
131  EXPECT_EQ(a, *aClone);
132  EXPECT_NE(&a, aClone);
133  delete aClone;
134 }

References b, souffle::ram::AutoIncrement::clone(), EXPECT_EQ, and EXPECT_NE.

Here is the call graph for this function:

◆ TEST() [44/48]

souffle::ram::test::TEST ( Swap  ,
CloneAndEquals   
)

Definition at line 122 of file ram_statement_equal_clone_test.cpp.

125  {
126  Relation A("A", 3, 1, {"a", "b", "c"}, {"i", "s", "i"}, RelationRepresentation::DEFAULT);
127  Relation B("B", 2, 1, {"a", "c"}, {"i", "i"}, RelationRepresentation::DEFAULT);
128  /*
129  * QUERY
130  * FOR t0 IN A
131  * PROJECT (t0.0, t0.2) INTO B
132  */
133  VecOwn<Expression> a_expressions;
134  a_expressions.emplace_back(new TupleElement(0, 0));
135  a_expressions.emplace_back(new TupleElement(0, 2));

◆ TEST() [45/48]

souffle::ram::test::TEST ( True  ,
CloneAndEquals   
)

Definition at line 54 of file ram_condition_equal_clone_test.cpp.

54  {
55  False a;
56  False b;
57  EXPECT_EQ(a, b);
58  EXPECT_NE(&a, &b);
59 
60  False* c = a.clone();
61  EXPECT_EQ(a, *c);
62  EXPECT_NE(&a, c);
63  delete c;
64 }

References b, souffle::ram::False::clone(), EXPECT_EQ, and EXPECT_NE.

Here is the call graph for this function:

◆ TEST() [46/48]

souffle::ram::test::TEST ( TupleElement  ,
CloneAndEquals   
)

Definition at line 110 of file ram_expression_equal_clone_test.cpp.

111  {
112  // number(5)
113  SignedConstant a(5);
114  SignedConstant b(5);
115  EXPECT_EQ(a, b);
116  EXPECT_NE(&a, &b);
117 
118  SignedConstant* aClone = a.clone();
119  EXPECT_EQ(a, *aClone);
120  EXPECT_NE(&a, aClone);
121  delete aClone;

References b, souffle::ram::SignedConstant::clone(), EXPECT_EQ, and EXPECT_NE.

Here is the call graph for this function:

◆ TEST() [47/48]

souffle::ram::test::TEST ( UndefValue  ,
CloneAndEquals   
)

Definition at line 148 of file ram_expression_equal_clone_test.cpp.

148  {
149  // {number{10), number(5), ⊥, ⊥}
150  VecOwn<Expression> a_args;
151  a_args.emplace_back(new SignedConstant(10));
152  a_args.emplace_back(new SignedConstant(5));
153  a_args.emplace_back(new UndefValue);
154  a_args.emplace_back(new UndefValue);
155  PackRecord a(std::move(a_args));
156 
157  VecOwn<Expression> b_args;
158  b_args.emplace_back(new SignedConstant(10));

◆ TEST() [48/48]

souffle::ram::test::TEST ( UserDefinedOperator  ,
CloneAndEquals   
)

Definition at line 87 of file ram_expression_equal_clone_test.cpp.

87  {TypeAttribute::Signed, TypeAttribute::Signed}, TypeAttribute::Signed, false,
88  std::move(b_args));
89  EXPECT_EQ(a, b);
90  EXPECT_NE(&a, &b);
91 
92  UserDefinedOperator* aClone = a.clone();
93  EXPECT_EQ(a, *aClone);
94  EXPECT_NE(&a, aClone);
95  delete aClone;
96 }
97 
98 TEST(TupleElement, CloneAndEquals) {
99  // t0.1
100  TupleElement a(0, 1);
101  TupleElement b(0, 1);
102  EXPECT_EQ(a, b);
103  EXPECT_NE(&a, &b);
104 
105  TupleElement* aClone = a.clone();
106  EXPECT_EQ(a, *aClone);
107  EXPECT_NE(&a, aClone);
108  delete aClone;

References souffle::Signed.

EXPECT_EQ
#define EXPECT_EQ(a, b)
Definition: test.h:191
e
l j a showGridBackground &&c b raw series this eventEmitter e
Definition: htmlJsChartistMin.h:15
n
var n
Definition: htmlJsChartistMin.h:15
i
size_t i
Definition: json11.h:663
NUMBER_OF_CONVERSION_TESTS
#define NUMBER_OF_CONVERSION_TESTS
Definition: ram_type_conversion_test.cpp:31
EXPECT_NE
#define EXPECT_NE(a, b)
Definition: test.h:195
b
l j a showGridBackground &&c b raw series this eventEmitter b
Definition: htmlJsChartistMin.h:15
d
else d
Definition: htmlJsChartistMin.h:15
souffle::ram::test::TEST
TEST(RamSubrountineArgument, CloneAndEquals)
Definition: ram_expression_equal_clone_test.cpp:212
souffle::ram::test::TEST
TEST(EmptinessCheck, CloneAndEquals)
Definition: ram_condition_equal_clone_test.cpp:252
souffle::ram::test::TEST
TEST(LogSize, CloneAndEquals)
Definition: ram_statement_equal_clone_test.cpp:437