unit-test.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* tests/unit-test.h. Generated from unit-test.h.in by configure. */
  2. /*
  3. * Copyright © 2008-2014 Stéphane Raimbault <stephane.raimbault@gmail.com>
  4. *
  5. * SPDX-License-Identifier: BSD-3-Clause
  6. */
  7. #ifndef _UNIT_TEST_H_
  8. #define _UNIT_TEST_H_
  9. /* Constants defined by configure.ac */
  10. #define HAVE_INTTYPES_H 1
  11. #define HAVE_STDINT_H 1
  12. #ifdef HAVE_INTTYPES_H
  13. #include <inttypes.h>
  14. #endif
  15. #ifdef HAVE_STDINT_H
  16. # ifndef _MSC_VER
  17. # include <stdint.h>
  18. # else
  19. # include "stdint.h"
  20. # endif
  21. #endif
  22. #define SERVER_ID 17
  23. #define INVALID_SERVER_ID 18
  24. const uint16_t UT_BITS_ADDRESS = 0x130;
  25. const uint16_t UT_BITS_NB = 0x25;
  26. const uint8_t UT_BITS_TAB[] = { 0xCD, 0x6B, 0xB2, 0x0E, 0x1B };
  27. const uint16_t UT_INPUT_BITS_ADDRESS = 0x1C4;
  28. const uint16_t UT_INPUT_BITS_NB = 0x16;
  29. const uint8_t UT_INPUT_BITS_TAB[] = { 0xAC, 0xDB, 0x35 };
  30. const uint16_t UT_REGISTERS_ADDRESS = 0x160;
  31. const uint16_t UT_REGISTERS_NB = 0x3;
  32. const uint16_t UT_REGISTERS_NB_MAX = 0x20;
  33. const uint16_t UT_REGISTERS_TAB[] = { 0x022B, 0x0001, 0x0064 };
  34. /* Raise a manual exception when this address is used for the first byte */
  35. const uint16_t UT_REGISTERS_ADDRESS_SPECIAL = 0x170;
  36. /* The response of the server will contains an invalid TID or slave */
  37. const uint16_t UT_REGISTERS_ADDRESS_INVALID_TID_OR_SLAVE = 0x171;
  38. /* The server will wait for 1 second before replying to test timeout */
  39. const uint16_t UT_REGISTERS_ADDRESS_SLEEP_500_MS = 0x172;
  40. /* The server will wait for 5 ms before sending each byte */
  41. const uint16_t UT_REGISTERS_ADDRESS_BYTE_SLEEP_5_MS = 0x173;
  42. /* If the following value is used, a bad response is sent.
  43. It's better to test with a lower value than
  44. UT_REGISTERS_NB_POINTS to try to raise a segfault. */
  45. const uint16_t UT_REGISTERS_NB_SPECIAL = 0x2;
  46. const uint16_t UT_INPUT_REGISTERS_ADDRESS = 0x108;
  47. const uint16_t UT_INPUT_REGISTERS_NB = 0x1;
  48. const uint16_t UT_INPUT_REGISTERS_TAB[] = { 0x000A };
  49. const float UT_REAL = 123456.00;
  50. const uint32_t UT_IREAL_ABCD = 0x0020F147;
  51. const uint32_t UT_IREAL_DCBA = 0x47F12000;
  52. const uint32_t UT_IREAL_BADC = 0x200047F1;
  53. const uint32_t UT_IREAL_CDAB = 0xF1470020;
  54. /* const uint32_t UT_IREAL_ABCD = 0x47F12000);
  55. const uint32_t UT_IREAL_DCBA = 0x0020F147;
  56. const uint32_t UT_IREAL_BADC = 0xF1470020;
  57. const uint32_t UT_IREAL_CDAB = 0x200047F1;*/
  58. #endif /* _UNIT_TEST_H_ */