historical_read_test_data.h 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  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. typedef struct {
  14. UA_DateTime start;
  15. UA_DateTime end;
  16. UA_UInt32 numValuesPerNode;
  17. UA_Boolean returnBounds;
  18. UA_DateTime result[8];
  19. UA_Boolean returnContinuationPoint;
  20. } testTuple;
  21. #define TIMESTAMP_UNSPECIFIED LLONG_MIN
  22. #define NODATA 0
  23. #define TIMESTAMP_FIRST 1
  24. #define TIMESTAMP_4_48 (448 * UA_DATETIME_SEC)
  25. #define TIMESTAMP_4_58 (458 * UA_DATETIME_SEC)
  26. #define TIMESTAMP_4_59 (459 * UA_DATETIME_SEC)
  27. #define TIMESTAMP_5_00 (500 * UA_DATETIME_SEC)
  28. #define TIMESTAMP_5_01 (501 * UA_DATETIME_SEC)
  29. #define TIMESTAMP_5_02 (502 * UA_DATETIME_SEC)
  30. #define TIMESTAMP_5_03 (503 * UA_DATETIME_SEC)
  31. #define TIMESTAMP_5_04 (504 * UA_DATETIME_SEC)
  32. #define TIMESTAMP_5_05 (505 * UA_DATETIME_SEC)
  33. #define TIMESTAMP_5_06 (506 * UA_DATETIME_SEC)
  34. #define TIMESTAMP_5_07 (507 * UA_DATETIME_SEC)
  35. #define TIMESTAMP_LAST (600 * UA_DATETIME_SEC)
  36. static UA_DateTime testData[] = {
  37. TIMESTAMP_5_03,
  38. TIMESTAMP_5_00,
  39. TIMESTAMP_5_02,
  40. TIMESTAMP_5_06,
  41. TIMESTAMP_5_05,
  42. 0 // last element
  43. };
  44. #define DELETE_START_TIME TIMESTAMP_5_03
  45. #define DELETE_STOP_TIME TIMESTAMP_5_06
  46. static UA_DateTime testDataAfterDelete[] = {
  47. TIMESTAMP_5_00,
  48. TIMESTAMP_5_02,
  49. TIMESTAMP_5_06,
  50. 0 // last element
  51. };
  52. static UA_StatusCode testDataUpdateResult[] = {
  53. UA_STATUSCODE_GOODENTRYREPLACED,
  54. UA_STATUSCODE_GOODENTRYREPLACED,
  55. UA_STATUSCODE_GOODENTRYINSERTED,
  56. UA_STATUSCODE_GOODENTRYINSERTED,
  57. UA_STATUSCODE_GOODENTRYREPLACED
  58. };
  59. static testTuple testRequests[] =
  60. {
  61. { TIMESTAMP_5_00,
  62. TIMESTAMP_5_05,
  63. 0,
  64. true,
  65. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, TIMESTAMP_5_05, 0 },
  66. false
  67. },
  68. { TIMESTAMP_5_00,
  69. TIMESTAMP_5_05,
  70. 0,
  71. false,
  72. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  73. false
  74. },
  75. { TIMESTAMP_5_01,
  76. TIMESTAMP_5_04,
  77. 0,
  78. true,
  79. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, TIMESTAMP_5_05, 0 },
  80. false
  81. },
  82. { TIMESTAMP_5_01,
  83. TIMESTAMP_5_04,
  84. 0,
  85. false,
  86. { TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  87. false
  88. },
  89. { TIMESTAMP_5_05,
  90. TIMESTAMP_5_00,
  91. 0,
  92. true,
  93. { TIMESTAMP_5_05, TIMESTAMP_5_03, TIMESTAMP_5_02, TIMESTAMP_5_00, 0 },
  94. false
  95. },
  96. { TIMESTAMP_5_05,
  97. TIMESTAMP_5_00,
  98. 0,
  99. false,
  100. { TIMESTAMP_5_05, TIMESTAMP_5_03, TIMESTAMP_5_02, 0 },
  101. false
  102. },
  103. { TIMESTAMP_5_04,
  104. TIMESTAMP_5_01,
  105. 0,
  106. true,
  107. { TIMESTAMP_5_05, TIMESTAMP_5_03, TIMESTAMP_5_02, TIMESTAMP_5_00, 0 },
  108. false
  109. },
  110. { TIMESTAMP_5_04,
  111. TIMESTAMP_5_01,
  112. 0,
  113. false,
  114. { TIMESTAMP_5_03, TIMESTAMP_5_02, 0 },
  115. false
  116. },
  117. { TIMESTAMP_4_59,
  118. TIMESTAMP_5_05,
  119. 0,
  120. true,
  121. { TIMESTAMP_FIRST, TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, TIMESTAMP_5_05, 0 },
  122. false
  123. },
  124. { TIMESTAMP_4_59,
  125. TIMESTAMP_5_05,
  126. 0,
  127. false,
  128. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  129. false
  130. },
  131. { TIMESTAMP_5_01,
  132. TIMESTAMP_5_07,
  133. 0,
  134. true,
  135. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, TIMESTAMP_5_05, TIMESTAMP_5_06, TIMESTAMP_LAST, 0 },
  136. false
  137. },
  138. { TIMESTAMP_5_01,
  139. TIMESTAMP_5_07,
  140. 0,
  141. false,
  142. { TIMESTAMP_5_02, TIMESTAMP_5_03, TIMESTAMP_5_05, TIMESTAMP_5_06, 0 },
  143. false
  144. },
  145. { TIMESTAMP_5_00,
  146. TIMESTAMP_5_05,
  147. 3,
  148. true,
  149. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  150. true
  151. },
  152. { TIMESTAMP_5_00,
  153. TIMESTAMP_5_05,
  154. 3,
  155. false,
  156. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  157. false
  158. },
  159. { TIMESTAMP_5_01,
  160. TIMESTAMP_5_04,
  161. 3,
  162. true,
  163. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  164. true
  165. },
  166. { TIMESTAMP_5_01,
  167. TIMESTAMP_5_04,
  168. 3,
  169. false,
  170. { TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  171. false
  172. },
  173. { TIMESTAMP_5_05,
  174. TIMESTAMP_5_00,
  175. 3,
  176. true,
  177. { TIMESTAMP_5_05, TIMESTAMP_5_03, TIMESTAMP_5_02, 0 },
  178. true
  179. },
  180. { TIMESTAMP_5_05,
  181. TIMESTAMP_5_00,
  182. 3,
  183. false,
  184. { TIMESTAMP_5_05, TIMESTAMP_5_03, TIMESTAMP_5_02, 0 },
  185. false
  186. },
  187. { TIMESTAMP_5_04,
  188. TIMESTAMP_5_01,
  189. 3,
  190. true,
  191. { TIMESTAMP_5_05, TIMESTAMP_5_03, TIMESTAMP_5_02, 0 },
  192. true
  193. },
  194. { TIMESTAMP_5_04,
  195. TIMESTAMP_5_01,
  196. 3,
  197. false,
  198. { TIMESTAMP_5_03, TIMESTAMP_5_02, 0 },
  199. false
  200. },
  201. { TIMESTAMP_4_59,
  202. TIMESTAMP_5_05,
  203. 3,
  204. true,
  205. { TIMESTAMP_FIRST, TIMESTAMP_5_00, TIMESTAMP_5_02, 0 },
  206. true
  207. },
  208. { TIMESTAMP_4_59,
  209. TIMESTAMP_5_05,
  210. 3,
  211. false,
  212. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  213. false
  214. },
  215. { TIMESTAMP_5_01,
  216. TIMESTAMP_5_07,
  217. 3,
  218. true,
  219. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  220. true
  221. },
  222. { TIMESTAMP_5_01,
  223. TIMESTAMP_5_07,
  224. 3,
  225. false,
  226. { TIMESTAMP_5_02, TIMESTAMP_5_03, TIMESTAMP_5_05, 0 },
  227. true
  228. },
  229. { TIMESTAMP_5_00,
  230. TIMESTAMP_UNSPECIFIED,
  231. 3,
  232. true,
  233. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  234. true
  235. },
  236. { TIMESTAMP_5_00,
  237. TIMESTAMP_UNSPECIFIED,
  238. 3,
  239. false,
  240. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  241. true
  242. },
  243. { TIMESTAMP_5_00,
  244. TIMESTAMP_UNSPECIFIED,
  245. 6,
  246. true,
  247. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, TIMESTAMP_5_05, TIMESTAMP_5_06, TIMESTAMP_LAST, 0 },
  248. false
  249. },
  250. { TIMESTAMP_5_00,
  251. TIMESTAMP_UNSPECIFIED,
  252. 6,
  253. false,
  254. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, TIMESTAMP_5_05, TIMESTAMP_5_06, 0 },
  255. false
  256. },
  257. { TIMESTAMP_5_07,
  258. TIMESTAMP_UNSPECIFIED,
  259. 6,
  260. true,
  261. { TIMESTAMP_5_06, TIMESTAMP_LAST, 0 },
  262. false
  263. },
  264. { TIMESTAMP_5_07,
  265. TIMESTAMP_UNSPECIFIED,
  266. 6,
  267. false,
  268. { NODATA, 0 },
  269. false
  270. },
  271. { TIMESTAMP_UNSPECIFIED,
  272. TIMESTAMP_5_06,
  273. 3,
  274. true,
  275. { TIMESTAMP_5_06,TIMESTAMP_5_05,TIMESTAMP_5_03, 0 },
  276. true
  277. },
  278. { TIMESTAMP_UNSPECIFIED,
  279. TIMESTAMP_5_06,
  280. 3,
  281. false,
  282. { TIMESTAMP_5_06,TIMESTAMP_5_05,TIMESTAMP_5_03, 0 },
  283. true
  284. },
  285. { TIMESTAMP_UNSPECIFIED,
  286. TIMESTAMP_5_06,
  287. 6,
  288. true,
  289. { TIMESTAMP_5_06,TIMESTAMP_5_05,TIMESTAMP_5_03,TIMESTAMP_5_02,TIMESTAMP_5_00,TIMESTAMP_FIRST, 0 },
  290. false
  291. },
  292. { TIMESTAMP_UNSPECIFIED,
  293. TIMESTAMP_5_06,
  294. 6,
  295. false,
  296. { TIMESTAMP_5_06, TIMESTAMP_5_05, TIMESTAMP_5_03, TIMESTAMP_5_02, TIMESTAMP_5_00, 0 },
  297. false
  298. },
  299. { TIMESTAMP_UNSPECIFIED,
  300. TIMESTAMP_4_48,
  301. 6,
  302. true,
  303. { TIMESTAMP_5_00, TIMESTAMP_FIRST, 0 },
  304. false
  305. },
  306. { TIMESTAMP_UNSPECIFIED,
  307. TIMESTAMP_4_48,
  308. 6,
  309. false,
  310. { NODATA, 0 },
  311. false
  312. },
  313. { TIMESTAMP_4_48,
  314. TIMESTAMP_4_48,
  315. 0,
  316. true,
  317. { TIMESTAMP_FIRST, TIMESTAMP_5_00, 0 },
  318. false
  319. },
  320. { TIMESTAMP_4_48,
  321. TIMESTAMP_4_48,
  322. 0,
  323. false,
  324. { NODATA, 0 },
  325. false
  326. },
  327. { TIMESTAMP_4_48,
  328. TIMESTAMP_4_48,
  329. 1,
  330. true,
  331. { TIMESTAMP_FIRST, 0 },
  332. true
  333. },
  334. { TIMESTAMP_4_48,
  335. TIMESTAMP_4_48,
  336. 1,
  337. false,
  338. { NODATA, 0 },
  339. false
  340. },
  341. { TIMESTAMP_4_48,
  342. TIMESTAMP_4_48,
  343. 2,
  344. true,
  345. { TIMESTAMP_FIRST,TIMESTAMP_5_00, 0 },
  346. false
  347. },
  348. { TIMESTAMP_5_00,
  349. TIMESTAMP_5_00,
  350. 0,
  351. true,
  352. { TIMESTAMP_5_00,TIMESTAMP_5_02, 0 },
  353. false
  354. },
  355. { TIMESTAMP_5_00,
  356. TIMESTAMP_5_00,
  357. 0,
  358. false,
  359. { TIMESTAMP_5_00, 0 },
  360. false
  361. },
  362. { TIMESTAMP_5_00,
  363. TIMESTAMP_5_00,
  364. 1,
  365. true,
  366. { TIMESTAMP_5_00, 0 },
  367. true
  368. },
  369. { TIMESTAMP_5_00,
  370. TIMESTAMP_5_00,
  371. 1,
  372. false,
  373. { TIMESTAMP_5_00, 0 },
  374. false
  375. },
  376. { TIMESTAMP_5_01,
  377. TIMESTAMP_5_01,
  378. 0,
  379. true,
  380. { TIMESTAMP_5_00, TIMESTAMP_5_02, 0 },
  381. false
  382. },
  383. { TIMESTAMP_5_01,
  384. TIMESTAMP_5_01,
  385. 0,
  386. false,
  387. { NODATA, 0 },
  388. false
  389. },
  390. { TIMESTAMP_5_01,
  391. TIMESTAMP_5_01,
  392. 1,
  393. true,
  394. { TIMESTAMP_5_00, 0 },
  395. true
  396. },
  397. { TIMESTAMP_5_01,
  398. TIMESTAMP_5_01,
  399. 1,
  400. false,
  401. { NODATA },
  402. false
  403. },
  404. {0,0,0,false,{ NODATA }, false} // last element
  405. };
  406. #endif /*UA_HISTORICAL_READ_TEST_DATA_H_*/