123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- /*
- ============================================================================
- Name : check_stack.c
- Author :
- Version :
- Copyright : Your copyright notice
- Description :
- ============================================================================
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include "opcua.h"
- #include "ua_services.h"
- #include "ua_statuscodes.h"
- #include "check.h"
- START_TEST(Service_TranslateBrowsePathsToNodeIds_SmokeTest)
- {
- UA_TranslateBrowsePathsToNodeIdsRequest* request;
- UA_TranslateBrowsePathsToNodeIdsRequest_new(&request);
- UA_TranslateBrowsePathsToNodeIdsResponse* response;
- UA_TranslateBrowsePathsToNodeIdsResponse_new(&response);
- request->browsePathsSize = 1;
- UA_Array_new((void***)&(request->browsePaths),request->browsePathsSize,UA_BROWSEPATH);
- Service_TranslateBrowsePathsToNodeIds(UA_NULL,request,response);
- ck_assert_int_eq(response->resultsSize,request->browsePathsSize);
- ck_assert_int_eq(response->results[0]->statusCode,UA_STATUSCODE_BADQUERYTOOCOMPLEX);
- }
- END_TEST
- Suite* testSuite_Service_TranslateBrowsePathsToNodeIds()
- {
- Suite *s = suite_create("Service_TranslateBrowsePathsToNodeIds");
- TCase *tc_core = tcase_create("Core");
- tcase_add_test(tc_core, Service_TranslateBrowsePathsToNodeIds_SmokeTest);
- suite_add_tcase(s,tc_core);
- return s;
- }
- int main (void)
- {
- int number_failed = 0;
- Suite *s;
- SRunner *sr;
- s = testSuite_Service_TranslateBrowsePathsToNodeIds();
- sr = srunner_create(s);
- srunner_run_all(sr,CK_NORMAL);
- number_failed += srunner_ntests_failed(sr);
- srunner_free(sr);
- return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
- }
|