historical_read_test_data.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  4. *
  5. * Copyright 2018 (c) basysKom GmbH <opensource@basyskom.com> (Author: Peter Rustler)
  6. */
  7. /* Data in this header is gathered from OPC Unified Architecture, Part 11, Release
  8. 1.03 Page 5-6 from OPC Foundation */
  9. #ifndef UA_HISTORICAL_READ_TEST_DATA_H_
  10. #define UA_HISTORICAL_READ_TEST_DATA_H_
  11. #include "ua_types.h"
  12. #include <limits.h>
  13. #define TESTDATA_START_TIME 1
  14. #define TESTDATA_STOP_TIME 601
  15. static UA_DateTime testData[] = {
  16. 100,
  17. 200,
  18. 300,
  19. 400,
  20. 500
  21. };
  22. static const size_t testDataSize = (sizeof(testData) / sizeof(testData[0]));
  23. static UA_DateTime testInsertDataSuccess[] = {
  24. 50,
  25. 250,
  26. 550
  27. };
  28. static const size_t testInsertDataSuccessSize = (sizeof(testInsertDataSuccess) / sizeof(testInsertDataSuccess[0]));
  29. static UA_DateTime testInsertResultData[] = {
  30. 50,
  31. 100,
  32. 200,
  33. 250,
  34. 300,
  35. 400,
  36. 500,
  37. 550
  38. };
  39. static size_t testInsertResultDataSize = (sizeof(testInsertResultData) / sizeof(testInsertResultData[0]));
  40. static UA_DateTime testReplaceDataSuccess[] = {
  41. 100,
  42. 300,
  43. 500
  44. };
  45. static const size_t testReplaceDataSuccessSize = (sizeof(testReplaceDataSuccess) / sizeof(testReplaceDataSuccess[0]));
  46. struct DeleteRange {
  47. UA_DateTime start;
  48. UA_DateTime end;
  49. size_t historySize;
  50. UA_StatusCode statusCode;
  51. };
  52. static struct DeleteRange testDeleteRangeData[] = {
  53. {200, 400, 3, UA_STATUSCODE_GOOD},
  54. {100, 400, 2, UA_STATUSCODE_GOOD},
  55. {200, 500, 2, UA_STATUSCODE_GOOD},
  56. {100, 500, 1, UA_STATUSCODE_GOOD},
  57. {100, 550, 0, UA_STATUSCODE_GOOD},
  58. {50, 550, 0, UA_STATUSCODE_GOOD},
  59. {500, 550, 4, UA_STATUSCODE_GOOD},
  60. {50, 150, 4, UA_STATUSCODE_GOOD},
  61. {100, 100, 4, UA_STATUSCODE_GOOD},
  62. {500, 500, 4, UA_STATUSCODE_GOOD},
  63. {200, 200, 4, UA_STATUSCODE_GOOD},
  64. {50, 50, 5, UA_STATUSCODE_BADNODATA},
  65. {550, 550, 5, UA_STATUSCODE_BADNODATA},
  66. {150, 150, 5, UA_STATUSCODE_BADNODATA},
  67. {200, 100, 5, UA_STATUSCODE_BADTIMESTAMPNOTSUPPORTED},
  68. {LLONG_MIN, LLONG_MAX, 0, UA_STATUSCODE_GOOD},
  69. {0, LLONG_MAX, 0, UA_STATUSCODE_GOOD},
  70. {LLONG_MIN, 0, 5, UA_STATUSCODE_BADNODATA},
  71. {0, 0, 5, UA_STATUSCODE_BADNODATA},
  72. {50, 75, 5, UA_STATUSCODE_BADNODATA},
  73. {50, 100, 5, UA_STATUSCODE_BADNODATA},
  74. {550, 600, 5, UA_STATUSCODE_BADNODATA}
  75. };
  76. static const size_t testDeleteRangeDataSize = (sizeof(testDeleteRangeData) / sizeof(testDeleteRangeData[0]));
  77. #endif /*UA_HISTORICAL_READ_TEST_DATA_H_*/