check_services_view.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. static Suite* testSuite_Service_TranslateBrowsePathsToNodeIds(void) {
  24. Suite *s = suite_create("Service_TranslateBrowsePathsToNodeIds");
  25. TCase *tc_core = tcase_create("Core");
  26. //tcase_add_test(tc_core, Service_TranslateBrowsePathsToNodeIds_SmokeTest);
  27. suite_add_tcase(s,tc_core);
  28. return s;
  29. }
  30. int main(void) {
  31. int number_failed = 0;
  32. Suite *s;
  33. SRunner *sr;
  34. s = testSuite_Service_TranslateBrowsePathsToNodeIds();
  35. sr = srunner_create(s);
  36. srunner_run_all(sr,CK_NORMAL);
  37. number_failed += srunner_ntests_failed(sr);
  38. srunner_free(sr);
  39. return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
  40. }