souffle  2.0.2-371-g6315b36
ram_relation_equal_clone_test.cpp
Go to the documentation of this file.
1 /*
2  * Souffle - A Datalog Compiler
3  * Copyright (c) 2020, The Souffle Developers. All rights reserved
4  * Licensed under the Universal Permissive License v 1.0 as shown at:
5  * - https://opensource.org/licenses/UPL
6  * - <souffle root>/licenses/SOUFFLE-UPL.txt
7  */
8 
9 /************************************************************************
10  *
11  * @file ram_relation_equal_clone_test.cpp
12  *
13  * Tests equal and clone function of Relation class.
14  *
15  ***********************************************************************/
16 
17 #include "tests/test.h"
18 
19 #include "RelationTag.h"
20 #include "ram/Relation.h"
21 #include <string>
22 
23 namespace souffle::ram {
24 
25 namespace test {
26 
27 TEST(Relation, CloneAndEquals) {
28  Relation a("A", 4, 1, {"a", "b", "c", "d"}, {"i", "i", "i", "i"}, RelationRepresentation::DEFAULT);
29  Relation b("A", 4, 1, {"a", "b", "c", "d"}, {"i", "i", "i", "i"}, RelationRepresentation::DEFAULT);
30  EXPECT_EQ(a, b);
31  EXPECT_NE(&a, &b);
32 
33  Relation* c = a.clone();
34  EXPECT_EQ(a, *c);
35  EXPECT_NE(&a, c);
36  delete c;
37 }
38 
39 } // end namespace test
40 } // namespace souffle::ram
EXPECT_EQ
#define EXPECT_EQ(a, b)
Definition: test.h:191
souffle::ram
Definition: AstToRamTranslator.h:54
RelationTag.h
Relation.h
test.h
EXPECT_NE
#define EXPECT_NE(a, b)
Definition: test.h:195
souffle::ram::test::TEST
TEST(True, CloneAndEquals)
Definition: ram_condition_equal_clone_test.cpp:54
b
l j a showGridBackground &&c b raw series this eventEmitter b
Definition: htmlJsChartistMin.h:15
souffle::RelationRepresentation::DEFAULT
@ DEFAULT