|
@@ -3,7 +3,7 @@
|
|
#include <time.h>
|
|
#include <time.h>
|
|
|
|
|
|
#include "ua_types.h"
|
|
#include "ua_types.h"
|
|
-#include "server/ua_nodestore.h"
|
|
|
|
|
|
+#include "server/nodestore/open62541_nodestore.h"
|
|
#include "ua_util.h"
|
|
#include "ua_util.h"
|
|
#include "check.h"
|
|
#include "check.h"
|
|
|
|
|
|
@@ -23,10 +23,10 @@ void printVisitor(const UA_Node* node) {
|
|
printf("%d\n", node->nodeId.identifier.numeric);
|
|
printf("%d\n", node->nodeId.identifier.numeric);
|
|
}
|
|
}
|
|
|
|
|
|
-START_TEST(test_UA_NodeStore) {
|
|
|
|
- UA_NodeStore *ns = UA_NULL;
|
|
|
|
- UA_NodeStore_new(&ns);
|
|
|
|
- UA_NodeStore_delete(ns);
|
|
|
|
|
|
+START_TEST(test_open62541NodeStore) {
|
|
|
|
+ open62541NodeStore *ns = UA_NULL;
|
|
|
|
+ open62541NodeStore_new(&ns);
|
|
|
|
+ open62541NodeStore_delete(ns);
|
|
}
|
|
}
|
|
END_TEST
|
|
END_TEST
|
|
|
|
|
|
@@ -39,113 +39,113 @@ UA_StatusCode createNode(UA_Node** p, UA_Int16 nsid, UA_Int32 id) {
|
|
return UA_STATUSCODE_GOOD;
|
|
return UA_STATUSCODE_GOOD;
|
|
}
|
|
}
|
|
|
|
|
|
-START_TEST(findNodeInUA_NodeStoreWithSingleEntry) {
|
|
|
|
|
|
+START_TEST(findNodeInopen62541NodeStoreWithSingleEntry) {
|
|
#ifdef MULTITHREADING
|
|
#ifdef MULTITHREADING
|
|
rcu_register_thread();
|
|
rcu_register_thread();
|
|
#endif
|
|
#endif
|
|
// given
|
|
// given
|
|
- UA_NodeStore *ns;
|
|
|
|
- UA_NodeStore_new(&ns);
|
|
|
|
|
|
+ open62541NodeStore *ns;
|
|
|
|
+ open62541NodeStore_new(&ns);
|
|
UA_Node* n1; createNode(&n1,0,2253);
|
|
UA_Node* n1; createNode(&n1,0,2253);
|
|
- UA_NodeStore_insert(ns, &n1, UA_NODESTORE_INSERT_UNIQUE | UA_NODESTORE_INSERT_GETMANAGED);
|
|
|
|
|
|
+ open62541NodeStore_insert(ns, &n1, UA_NODESTORE_INSERT_UNIQUE | UA_NODESTORE_INSERT_GETMANAGED);
|
|
const UA_Node* nr = UA_NULL;
|
|
const UA_Node* nr = UA_NULL;
|
|
UA_Int32 retval;
|
|
UA_Int32 retval;
|
|
// when
|
|
// when
|
|
- retval = UA_NodeStore_get(ns,&n1->nodeId,&nr);
|
|
|
|
|
|
+ retval = open62541NodeStore_get(ns,&n1->nodeId,&nr);
|
|
// then
|
|
// then
|
|
ck_assert_int_eq(retval, UA_STATUSCODE_GOOD);
|
|
ck_assert_int_eq(retval, UA_STATUSCODE_GOOD);
|
|
ck_assert_ptr_eq((void*)nr, (void*)n1);
|
|
ck_assert_ptr_eq((void*)nr, (void*)n1);
|
|
// finally
|
|
// finally
|
|
- UA_NodeStore_release(n1);
|
|
|
|
- UA_NodeStore_release(nr);
|
|
|
|
- UA_NodeStore_delete(ns);
|
|
|
|
|
|
+ open62541NodeStore_release(n1);
|
|
|
|
+ open62541NodeStore_release(nr);
|
|
|
|
+ open62541NodeStore_delete(ns);
|
|
#ifdef MULTITHREADING
|
|
#ifdef MULTITHREADING
|
|
rcu_unregister_thread();
|
|
rcu_unregister_thread();
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
END_TEST
|
|
END_TEST
|
|
|
|
|
|
-START_TEST(failToFindNodeInOtherUA_NodeStore) {
|
|
|
|
|
|
+START_TEST(failToFindNodeInOtheropen62541NodeStore) {
|
|
#ifdef MULTITHREADING
|
|
#ifdef MULTITHREADING
|
|
rcu_register_thread();
|
|
rcu_register_thread();
|
|
#endif
|
|
#endif
|
|
// given
|
|
// given
|
|
- UA_NodeStore *ns = UA_NULL;
|
|
|
|
- UA_NodeStore_new(&ns);
|
|
|
|
|
|
+ open62541NodeStore *ns = UA_NULL;
|
|
|
|
+ open62541NodeStore_new(&ns);
|
|
|
|
|
|
- UA_Node* n1; createNode(&n1,0,2253); UA_NodeStore_insert(ns, &n1, 0);
|
|
|
|
- UA_Node* n2; createNode(&n2,0,2253); UA_NodeStore_insert(ns, &n2, 0);
|
|
|
|
|
|
+ UA_Node* n1; createNode(&n1,0,2253); open62541NodeStore_insert(ns, &n1, 0);
|
|
|
|
+ UA_Node* n2; createNode(&n2,0,2253); open62541NodeStore_insert(ns, &n2, 0);
|
|
|
|
|
|
const UA_Node* nr = UA_NULL;
|
|
const UA_Node* nr = UA_NULL;
|
|
// when
|
|
// when
|
|
UA_Node* n; createNode(&n,1,2255);
|
|
UA_Node* n; createNode(&n,1,2255);
|
|
- UA_Int32 retval = UA_NodeStore_get(ns,&n->nodeId, &nr);
|
|
|
|
|
|
+ UA_Int32 retval = open62541NodeStore_get(ns,&n->nodeId, &nr);
|
|
// then
|
|
// then
|
|
ck_assert_int_ne(retval, UA_STATUSCODE_GOOD);
|
|
ck_assert_int_ne(retval, UA_STATUSCODE_GOOD);
|
|
// finally
|
|
// finally
|
|
UA_Node_delete(n);
|
|
UA_Node_delete(n);
|
|
- UA_NodeStore_release(nr);
|
|
|
|
- UA_NodeStore_delete(ns);
|
|
|
|
|
|
+ open62541NodeStore_release(nr);
|
|
|
|
+ open62541NodeStore_delete(ns);
|
|
#ifdef MULTITHREADING
|
|
#ifdef MULTITHREADING
|
|
rcu_unregister_thread();
|
|
rcu_unregister_thread();
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
END_TEST
|
|
END_TEST
|
|
|
|
|
|
-START_TEST(findNodeInUA_NodeStoreWithSeveralEntries) {
|
|
|
|
|
|
+START_TEST(findNodeInopen62541NodeStoreWithSeveralEntries) {
|
|
#ifdef MULTITHREADING
|
|
#ifdef MULTITHREADING
|
|
rcu_register_thread();
|
|
rcu_register_thread();
|
|
#endif
|
|
#endif
|
|
// given
|
|
// given
|
|
- UA_NodeStore *ns;
|
|
|
|
- UA_NodeStore_new(&ns);
|
|
|
|
- UA_Node* n1; createNode(&n1,0,2253); UA_NodeStore_insert(ns, &n1, 0);
|
|
|
|
- UA_Node* n2; createNode(&n2,0,2255); UA_NodeStore_insert(ns, &n2, 0);
|
|
|
|
- UA_Node* n3; createNode(&n3,0,2257); UA_NodeStore_insert(ns, &n3, UA_NODESTORE_INSERT_GETMANAGED);
|
|
|
|
- UA_Node* n4; createNode(&n4,0,2200); UA_NodeStore_insert(ns, &n4, 0);
|
|
|
|
- UA_Node* n5; createNode(&n5,0,1); UA_NodeStore_insert(ns, &n5, 0);
|
|
|
|
- UA_Node* n6; createNode(&n6,0,12); UA_NodeStore_insert(ns, &n6, 0);
|
|
|
|
|
|
+ open62541NodeStore *ns;
|
|
|
|
+ open62541NodeStore_new(&ns);
|
|
|
|
+ UA_Node* n1; createNode(&n1,0,2253); open62541NodeStore_insert(ns, &n1, 0);
|
|
|
|
+ UA_Node* n2; createNode(&n2,0,2255); open62541NodeStore_insert(ns, &n2, 0);
|
|
|
|
+ UA_Node* n3; createNode(&n3,0,2257); open62541NodeStore_insert(ns, &n3, UA_NODESTORE_INSERT_GETMANAGED);
|
|
|
|
+ UA_Node* n4; createNode(&n4,0,2200); open62541NodeStore_insert(ns, &n4, 0);
|
|
|
|
+ UA_Node* n5; createNode(&n5,0,1); open62541NodeStore_insert(ns, &n5, 0);
|
|
|
|
+ UA_Node* n6; createNode(&n6,0,12); open62541NodeStore_insert(ns, &n6, 0);
|
|
|
|
|
|
const UA_Node* nr = UA_NULL;
|
|
const UA_Node* nr = UA_NULL;
|
|
UA_Int32 retval;
|
|
UA_Int32 retval;
|
|
// when
|
|
// when
|
|
- retval = UA_NodeStore_get(ns,&(n3->nodeId),&nr);
|
|
|
|
|
|
+ retval = open62541NodeStore_get(ns,&(n3->nodeId),&nr);
|
|
// then
|
|
// then
|
|
ck_assert_int_eq(retval, UA_STATUSCODE_GOOD);
|
|
ck_assert_int_eq(retval, UA_STATUSCODE_GOOD);
|
|
ck_assert_ptr_eq((void*)nr, (void*)n3);
|
|
ck_assert_ptr_eq((void*)nr, (void*)n3);
|
|
// finally
|
|
// finally
|
|
- UA_NodeStore_release(n3);
|
|
|
|
- UA_NodeStore_release(nr);
|
|
|
|
- UA_NodeStore_delete(ns);
|
|
|
|
|
|
+ open62541NodeStore_release(n3);
|
|
|
|
+ open62541NodeStore_release(nr);
|
|
|
|
+ open62541NodeStore_delete(ns);
|
|
#ifdef MULTITHREADING
|
|
#ifdef MULTITHREADING
|
|
rcu_unregister_thread();
|
|
rcu_unregister_thread();
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
END_TEST
|
|
END_TEST
|
|
|
|
|
|
-START_TEST(iterateOverUA_NodeStoreShallNotVisitEmptyNodes) {
|
|
|
|
|
|
+START_TEST(iterateOveropen62541NodeStoreShallNotVisitEmptyNodes) {
|
|
#ifdef MULTITHREADING
|
|
#ifdef MULTITHREADING
|
|
rcu_register_thread();
|
|
rcu_register_thread();
|
|
#endif
|
|
#endif
|
|
// given
|
|
// given
|
|
- UA_NodeStore *ns;
|
|
|
|
- UA_NodeStore_new(&ns);
|
|
|
|
- UA_Node* n1; createNode(&n1,0,2253); UA_NodeStore_insert(ns, &n1, 0);
|
|
|
|
- UA_Node* n2; createNode(&n2,0,2255); UA_NodeStore_insert(ns, &n2, 0);
|
|
|
|
- UA_Node* n3; createNode(&n3,0,2257); UA_NodeStore_insert(ns, &n3, 0);
|
|
|
|
- UA_Node* n4; createNode(&n4,0,2200); UA_NodeStore_insert(ns, &n4, 0);
|
|
|
|
- UA_Node* n5; createNode(&n5,0,1); UA_NodeStore_insert(ns, &n5, 0);
|
|
|
|
- UA_Node* n6; createNode(&n6,0,12); UA_NodeStore_insert(ns, &n6, 0);
|
|
|
|
|
|
+ open62541NodeStore *ns;
|
|
|
|
+ open62541NodeStore_new(&ns);
|
|
|
|
+ UA_Node* n1; createNode(&n1,0,2253); open62541NodeStore_insert(ns, &n1, 0);
|
|
|
|
+ UA_Node* n2; createNode(&n2,0,2255); open62541NodeStore_insert(ns, &n2, 0);
|
|
|
|
+ UA_Node* n3; createNode(&n3,0,2257); open62541NodeStore_insert(ns, &n3, 0);
|
|
|
|
+ UA_Node* n4; createNode(&n4,0,2200); open62541NodeStore_insert(ns, &n4, 0);
|
|
|
|
+ UA_Node* n5; createNode(&n5,0,1); open62541NodeStore_insert(ns, &n5, 0);
|
|
|
|
+ UA_Node* n6; createNode(&n6,0,12); open62541NodeStore_insert(ns, &n6, 0);
|
|
|
|
|
|
// when
|
|
// when
|
|
zeroCnt = 0;
|
|
zeroCnt = 0;
|
|
visitCnt = 0;
|
|
visitCnt = 0;
|
|
- UA_NodeStore_iterate(ns,checkZeroVisitor);
|
|
|
|
|
|
+ open62541NodeStore_iterate(ns,checkZeroVisitor);
|
|
// then
|
|
// then
|
|
ck_assert_int_eq(zeroCnt, 0);
|
|
ck_assert_int_eq(zeroCnt, 0);
|
|
ck_assert_int_eq(visitCnt, 6);
|
|
ck_assert_int_eq(visitCnt, 6);
|
|
// finally
|
|
// finally
|
|
- UA_NodeStore_delete(ns);
|
|
|
|
|
|
+ open62541NodeStore_delete(ns);
|
|
#ifdef MULTITHREADING
|
|
#ifdef MULTITHREADING
|
|
rcu_unregister_thread();
|
|
rcu_unregister_thread();
|
|
#endif
|
|
#endif
|
|
@@ -157,25 +157,25 @@ START_TEST(findNodeInExpandedNamespace) {
|
|
rcu_register_thread();
|
|
rcu_register_thread();
|
|
#endif
|
|
#endif
|
|
// given
|
|
// given
|
|
- UA_NodeStore *ns;
|
|
|
|
- UA_NodeStore_new(&ns);
|
|
|
|
|
|
+ open62541NodeStore *ns;
|
|
|
|
+ open62541NodeStore_new(&ns);
|
|
UA_Node* n;
|
|
UA_Node* n;
|
|
UA_Int32 i=0;
|
|
UA_Int32 i=0;
|
|
for (; i<200; i++) {
|
|
for (; i<200; i++) {
|
|
- createNode(&n,0,i); UA_NodeStore_insert(ns, &n, 0);
|
|
|
|
|
|
+ createNode(&n,0,i); open62541NodeStore_insert(ns, &n, 0);
|
|
}
|
|
}
|
|
const UA_Node* nr = UA_NULL;
|
|
const UA_Node* nr = UA_NULL;
|
|
UA_Int32 retval;
|
|
UA_Int32 retval;
|
|
// when
|
|
// when
|
|
createNode(&n,0,25);
|
|
createNode(&n,0,25);
|
|
- retval = UA_NodeStore_get(ns,&(n->nodeId),&nr);
|
|
|
|
|
|
+ retval = open62541NodeStore_get(ns,&(n->nodeId),&nr);
|
|
// then
|
|
// then
|
|
ck_assert_int_eq(retval, UA_STATUSCODE_GOOD);
|
|
ck_assert_int_eq(retval, UA_STATUSCODE_GOOD);
|
|
ck_assert_int_eq(nr->nodeId.identifier.numeric,n->nodeId.identifier.numeric);
|
|
ck_assert_int_eq(nr->nodeId.identifier.numeric,n->nodeId.identifier.numeric);
|
|
// finally
|
|
// finally
|
|
UA_free((void*)n);
|
|
UA_free((void*)n);
|
|
- UA_NodeStore_release(nr);
|
|
|
|
- UA_NodeStore_delete(ns);
|
|
|
|
|
|
+ open62541NodeStore_release(nr);
|
|
|
|
+ open62541NodeStore_delete(ns);
|
|
#ifdef MULTITHREADING
|
|
#ifdef MULTITHREADING
|
|
rcu_unregister_thread();
|
|
rcu_unregister_thread();
|
|
#endif
|
|
#endif
|
|
@@ -187,51 +187,51 @@ START_TEST(iterateOverExpandedNamespaceShallNotVisitEmptyNodes) {
|
|
rcu_register_thread();
|
|
rcu_register_thread();
|
|
#endif
|
|
#endif
|
|
// given
|
|
// given
|
|
- UA_NodeStore *ns;
|
|
|
|
- UA_NodeStore_new(&ns);
|
|
|
|
|
|
+ open62541NodeStore *ns;
|
|
|
|
+ open62541NodeStore_new(&ns);
|
|
UA_Node* n;
|
|
UA_Node* n;
|
|
UA_Int32 i=0;
|
|
UA_Int32 i=0;
|
|
for (; i<200; i++) {
|
|
for (; i<200; i++) {
|
|
- createNode(&n,0,i); UA_NodeStore_insert(ns, &n, 0);
|
|
|
|
|
|
+ createNode(&n,0,i); open62541NodeStore_insert(ns, &n, 0);
|
|
}
|
|
}
|
|
// when
|
|
// when
|
|
zeroCnt = 0;
|
|
zeroCnt = 0;
|
|
visitCnt = 0;
|
|
visitCnt = 0;
|
|
- UA_NodeStore_iterate(ns,checkZeroVisitor);
|
|
|
|
|
|
+ open62541NodeStore_iterate(ns,checkZeroVisitor);
|
|
// then
|
|
// then
|
|
ck_assert_int_eq(zeroCnt, 0);
|
|
ck_assert_int_eq(zeroCnt, 0);
|
|
ck_assert_int_eq(visitCnt, 200);
|
|
ck_assert_int_eq(visitCnt, 200);
|
|
// finally
|
|
// finally
|
|
- UA_NodeStore_delete(ns);
|
|
|
|
|
|
+ open62541NodeStore_delete(ns);
|
|
#ifdef MULTITHREADING
|
|
#ifdef MULTITHREADING
|
|
rcu_unregister_thread();
|
|
rcu_unregister_thread();
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
END_TEST
|
|
END_TEST
|
|
|
|
|
|
-START_TEST(failToFindNonExistantNodeInUA_NodeStoreWithSeveralEntries) {
|
|
|
|
|
|
+START_TEST(failToFindNonExistantNodeInopen62541NodeStoreWithSeveralEntries) {
|
|
#ifdef MULTITHREADING
|
|
#ifdef MULTITHREADING
|
|
rcu_register_thread();
|
|
rcu_register_thread();
|
|
#endif
|
|
#endif
|
|
// given
|
|
// given
|
|
- UA_NodeStore *ns;
|
|
|
|
- UA_NodeStore_new(&ns);
|
|
|
|
- UA_Node* n1; createNode(&n1,0,2253); UA_NodeStore_insert(ns, &n1, 0);
|
|
|
|
- UA_Node* n2; createNode(&n2,0,2255); UA_NodeStore_insert(ns, &n2, 0);
|
|
|
|
- UA_Node* n3; createNode(&n3,0,2257); UA_NodeStore_insert(ns, &n3, 0);
|
|
|
|
- UA_Node* n4; createNode(&n4,0,2200); UA_NodeStore_insert(ns, &n4, 0);
|
|
|
|
- UA_Node* n5; createNode(&n5,0,1); UA_NodeStore_insert(ns, &n5, 0);
|
|
|
|
|
|
+ open62541NodeStore *ns;
|
|
|
|
+ open62541NodeStore_new(&ns);
|
|
|
|
+ UA_Node* n1; createNode(&n1,0,2253); open62541NodeStore_insert(ns, &n1, 0);
|
|
|
|
+ UA_Node* n2; createNode(&n2,0,2255); open62541NodeStore_insert(ns, &n2, 0);
|
|
|
|
+ UA_Node* n3; createNode(&n3,0,2257); open62541NodeStore_insert(ns, &n3, 0);
|
|
|
|
+ UA_Node* n4; createNode(&n4,0,2200); open62541NodeStore_insert(ns, &n4, 0);
|
|
|
|
+ UA_Node* n5; createNode(&n5,0,1); open62541NodeStore_insert(ns, &n5, 0);
|
|
UA_Node* n6; createNode(&n6,0,12);
|
|
UA_Node* n6; createNode(&n6,0,12);
|
|
|
|
|
|
const UA_Node* nr = UA_NULL;
|
|
const UA_Node* nr = UA_NULL;
|
|
UA_Int32 retval;
|
|
UA_Int32 retval;
|
|
// when
|
|
// when
|
|
- retval = UA_NodeStore_get(ns, &(n6->nodeId), &nr);
|
|
|
|
|
|
+ retval = open62541NodeStore_get(ns, &(n6->nodeId), &nr);
|
|
// then
|
|
// then
|
|
ck_assert_int_ne(retval, UA_STATUSCODE_GOOD);
|
|
ck_assert_int_ne(retval, UA_STATUSCODE_GOOD);
|
|
// finally
|
|
// finally
|
|
UA_free((void *)n6);
|
|
UA_free((void *)n6);
|
|
- UA_NodeStore_delete(ns);
|
|
|
|
|
|
+ open62541NodeStore_delete(ns);
|
|
#ifdef MULTITHREADING
|
|
#ifdef MULTITHREADING
|
|
rcu_unregister_thread();
|
|
rcu_unregister_thread();
|
|
#endif
|
|
#endif
|
|
@@ -243,8 +243,8 @@ END_TEST
|
|
/************************************/
|
|
/************************************/
|
|
|
|
|
|
#ifdef MULTITHREADING
|
|
#ifdef MULTITHREADING
|
|
-struct UA_NodeStoreProfileTest {
|
|
|
|
- UA_NodeStore *ns;
|
|
|
|
|
|
+struct open62541NodeStoreProfileTest {
|
|
|
|
+ open62541NodeStore *ns;
|
|
UA_Int32 min_val;
|
|
UA_Int32 min_val;
|
|
UA_Int32 max_val;
|
|
UA_Int32 max_val;
|
|
UA_Int32 rounds;
|
|
UA_Int32 rounds;
|
|
@@ -252,16 +252,16 @@ struct UA_NodeStoreProfileTest {
|
|
|
|
|
|
void *profileGetThread(void *arg) {
|
|
void *profileGetThread(void *arg) {
|
|
rcu_register_thread();
|
|
rcu_register_thread();
|
|
- struct UA_NodeStoreProfileTest *test = (struct UA_NodeStoreProfileTest*) arg;
|
|
|
|
|
|
+ struct open62541NodeStoreProfileTest *test = (struct open62541NodeStoreProfileTest*) arg;
|
|
UA_NodeId id = NS0NODEID(0);
|
|
UA_NodeId id = NS0NODEID(0);
|
|
const UA_Node *cn;
|
|
const UA_Node *cn;
|
|
UA_Int32 max_val = test->max_val;
|
|
UA_Int32 max_val = test->max_val;
|
|
- UA_NodeStore *ns = test->ns;
|
|
|
|
|
|
+ open62541NodeStore *ns = test->ns;
|
|
for(UA_Int32 x = 0; x<test->rounds; x++) {
|
|
for(UA_Int32 x = 0; x<test->rounds; x++) {
|
|
for (UA_Int32 i=test->min_val; i<max_val; i++) {
|
|
for (UA_Int32 i=test->min_val; i<max_val; i++) {
|
|
id.identifier.numeric = i;
|
|
id.identifier.numeric = i;
|
|
- UA_NodeStore_get(ns,&id, &cn);
|
|
|
|
- UA_NodeStore_release(cn);
|
|
|
|
|
|
+ open62541NodeStore_get(ns,&id, &cn);
|
|
|
|
+ open62541NodeStore_release(cn);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
rcu_unregister_thread();
|
|
rcu_unregister_thread();
|
|
@@ -276,21 +276,21 @@ START_TEST(profileGetDelete) {
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#define N 1000000
|
|
#define N 1000000
|
|
- UA_NodeStore *ns;
|
|
|
|
- UA_NodeStore_new(&ns);
|
|
|
|
|
|
+ open62541NodeStore *ns;
|
|
|
|
+ open62541NodeStore_new(&ns);
|
|
UA_Int32 i=0;
|
|
UA_Int32 i=0;
|
|
UA_Node *n;
|
|
UA_Node *n;
|
|
for (; i<N; i++) {
|
|
for (; i<N; i++) {
|
|
- createNode(&n,0,i); UA_NodeStore_insert(ns, &n, 0);
|
|
|
|
|
|
+ createNode(&n,0,i); open62541NodeStore_insert(ns, &n, 0);
|
|
}
|
|
}
|
|
clock_t begin, end;
|
|
clock_t begin, end;
|
|
begin = clock();
|
|
begin = clock();
|
|
#ifdef MULTITHREADING
|
|
#ifdef MULTITHREADING
|
|
#define THREADS 4
|
|
#define THREADS 4
|
|
pthread_t t[THREADS];
|
|
pthread_t t[THREADS];
|
|
- struct UA_NodeStoreProfileTest p[THREADS];
|
|
|
|
|
|
+ struct open62541NodeStoreProfileTest p[THREADS];
|
|
for (int i = 0; i < THREADS; i++) {
|
|
for (int i = 0; i < THREADS; i++) {
|
|
- p[i] = (struct UA_NodeStoreProfileTest){ns, i*(N/THREADS), (i+1)*(N/THREADS), 50};
|
|
|
|
|
|
+ p[i] = (struct open62541NodeStoreProfileTest){ns, i*(N/THREADS), (i+1)*(N/THREADS), 50};
|
|
pthread_create(&t[i], NULL, profileGetThread, &p[i]);
|
|
pthread_create(&t[i], NULL, profileGetThread, &p[i]);
|
|
}
|
|
}
|
|
for (int i = 0; i < THREADS; i++)
|
|
for (int i = 0; i < THREADS; i++)
|
|
@@ -303,15 +303,15 @@ START_TEST(profileGetDelete) {
|
|
for(UA_Int32 x = 0; x<50; x++) {
|
|
for(UA_Int32 x = 0; x<50; x++) {
|
|
for(i=0; i<N; i++) {
|
|
for(i=0; i<N; i++) {
|
|
id.identifier.numeric = i;
|
|
id.identifier.numeric = i;
|
|
- UA_NodeStore_get(ns,&id, &cn);
|
|
|
|
- UA_NodeStore_release(cn);
|
|
|
|
|
|
+ open62541NodeStore_get(ns,&id, &cn);
|
|
|
|
+ open62541NodeStore_release(cn);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end = clock();
|
|
end = clock();
|
|
printf("Time for single-threaded %d create/get/delete in a namespace: %fs.\n", N, (double)(end - begin) / CLOCKS_PER_SEC);
|
|
printf("Time for single-threaded %d create/get/delete in a namespace: %fs.\n", N, (double)(end - begin) / CLOCKS_PER_SEC);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
- UA_NodeStore_delete(ns);
|
|
|
|
|
|
+ open62541NodeStore_delete(ns);
|
|
|
|
|
|
#ifdef MULTITHREADING
|
|
#ifdef MULTITHREADING
|
|
rcu_unregister_thread();
|
|
rcu_unregister_thread();
|
|
@@ -320,22 +320,22 @@ START_TEST(profileGetDelete) {
|
|
END_TEST
|
|
END_TEST
|
|
|
|
|
|
Suite * namespace_suite (void) {
|
|
Suite * namespace_suite (void) {
|
|
- Suite *s = suite_create ("UA_NodeStore");
|
|
|
|
|
|
+ Suite *s = suite_create ("open62541NodeStore");
|
|
|
|
|
|
TCase *tc_cd = tcase_create ("Create/Delete");
|
|
TCase *tc_cd = tcase_create ("Create/Delete");
|
|
- tcase_add_test (tc_cd, test_UA_NodeStore);
|
|
|
|
|
|
+ tcase_add_test (tc_cd, test_open62541NodeStore);
|
|
suite_add_tcase (s, tc_cd);
|
|
suite_add_tcase (s, tc_cd);
|
|
|
|
|
|
TCase* tc_find = tcase_create ("Find");
|
|
TCase* tc_find = tcase_create ("Find");
|
|
- tcase_add_test (tc_find, findNodeInUA_NodeStoreWithSingleEntry);
|
|
|
|
- tcase_add_test (tc_find, findNodeInUA_NodeStoreWithSeveralEntries);
|
|
|
|
|
|
+ tcase_add_test (tc_find, findNodeInopen62541NodeStoreWithSingleEntry);
|
|
|
|
+ tcase_add_test (tc_find, findNodeInopen62541NodeStoreWithSeveralEntries);
|
|
tcase_add_test (tc_find, findNodeInExpandedNamespace);
|
|
tcase_add_test (tc_find, findNodeInExpandedNamespace);
|
|
- tcase_add_test (tc_find, failToFindNonExistantNodeInUA_NodeStoreWithSeveralEntries);
|
|
|
|
- tcase_add_test (tc_find, failToFindNodeInOtherUA_NodeStore);
|
|
|
|
|
|
+ tcase_add_test (tc_find, failToFindNonExistantNodeInopen62541NodeStoreWithSeveralEntries);
|
|
|
|
+ tcase_add_test (tc_find, failToFindNodeInOtheropen62541NodeStore);
|
|
suite_add_tcase (s, tc_find);
|
|
suite_add_tcase (s, tc_find);
|
|
|
|
|
|
TCase* tc_iterate = tcase_create ("Iterate");
|
|
TCase* tc_iterate = tcase_create ("Iterate");
|
|
- tcase_add_test (tc_iterate, iterateOverUA_NodeStoreShallNotVisitEmptyNodes);
|
|
|
|
|
|
+ tcase_add_test (tc_iterate, iterateOveropen62541NodeStoreShallNotVisitEmptyNodes);
|
|
tcase_add_test (tc_iterate, iterateOverExpandedNamespaceShallNotVisitEmptyNodes);
|
|
tcase_add_test (tc_iterate, iterateOverExpandedNamespaceShallNotVisitEmptyNodes);
|
|
suite_add_tcase (s, tc_iterate);
|
|
suite_add_tcase (s, tc_iterate);
|
|
|
|
|