check_services_view.c 1.5 KB

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