MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / test_node

Function test_node

tests/unit/test_value.c:143–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143void test_node() {
144 AttributeSet attr;
145
146 Node n0;
147 n0.id = 0;
148 n0.attributes = &attr;
149 SIValue node = SI_Node(&n0);
150
151 Node n0Other = n0;
152 SIValue nodeOther = SI_Node(&n0Other);
153
154 // Validate same hashCode for the same value, different address.
155 uint64_t origHashCode = SIValue_HashCode(node);
156 uint64_t otherHashCode = SIValue_HashCode(nodeOther);
157 TEST_ASSERT(origHashCode == otherHashCode);
158
159 // Change entity id.
160 Node n1 = n0;
161 n1.id = 1;
162 nodeOther = SI_Node(&n1);
163 otherHashCode = SIValue_HashCode(nodeOther);
164 TEST_ASSERT(origHashCode != otherHashCode);
165}
166
167void test_array() {
168 SIValue arr = SI_EmptyArray();

Callers

nothing calls this directly

Calls 2

SI_NodeFunction · 0.85
SIValue_HashCodeFunction · 0.85

Tested by

no test coverage detected