check_services_view.c 1.5 KB

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