check_services_view.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. ============================================================================
  3. Name : check_stack.c
  4. Author :
  5. Version :
  6. Copyright : Your copyright notice
  7. Description :
  8. ============================================================================
  9. */
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. #include "ua_types.h"
  13. #include "ua_services.h"
  14. #include "ua_statuscodes.h"
  15. #include "check.h"
  16. START_TEST(Service_TranslateBrowsePathsToNodeIds_SmokeTest)
  17. {
  18. UA_TranslateBrowsePathsToNodeIdsRequest request;
  19. UA_TranslateBrowsePathsToNodeIdsRequest_init(&request);
  20. UA_TranslateBrowsePathsToNodeIdsResponse response;
  21. UA_TranslateBrowsePathsToNodeIdsResponse_init(&response);
  22. request.browsePathsSize = 1;
  23. UA_Array_new((void**)&request.browsePaths,request.browsePathsSize, &UA_.types[UA_BROWSEPATH]);
  24. Service_TranslateBrowsePathsToNodeIds(UA_NULL,&request,&response);
  25. ck_assert_int_eq(response.resultsSize,request.browsePathsSize);
  26. ck_assert_int_eq(response.results[0].statusCode,UA_STATUSCODE_BADNOMATCH);
  27. //finally
  28. UA_TranslateBrowsePathsToNodeIdsRequest_deleteMembers(&request);
  29. UA_TranslateBrowsePathsToNodeIdsResponse_deleteMembers(&response);
  30. }
  31. END_TEST
  32. Suite* testSuite_Service_TranslateBrowsePathsToNodeIds()
  33. {
  34. Suite *s = suite_create("Service_TranslateBrowsePathsToNodeIds");
  35. TCase *tc_core = tcase_create("Core");
  36. tcase_add_test(tc_core, Service_TranslateBrowsePathsToNodeIds_SmokeTest);
  37. suite_add_tcase(s,tc_core);
  38. return s;
  39. }
  40. int main (void)
  41. {
  42. int number_failed = 0;
  43. Suite *s;
  44. SRunner *sr;
  45. s = testSuite_Service_TranslateBrowsePathsToNodeIds();
  46. sr = srunner_create(s);
  47. srunner_run_all(sr,CK_NORMAL);
  48. number_failed += srunner_ntests_failed(sr);
  49. srunner_free(sr);
  50. return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
  51. }