/tutorial/signal/b.e

http://github.com/tybor/Liberty · Specman e · 96 lines · 85 code · 11 blank · 0 comment · 0 complexity · 8ca72f713fb275d0174d54badfc69b45 MD5 · raw file

  1. class B
  2. creation {ANY}
  3. make
  4. feature {ANY}
  5. s, s1: SIGNAL_1[INTEGER] --declare variable of SIGNAL type, never inherit form SIGNAL.
  6. j: INTEGER
  7. feature {}
  8. make is
  9. do
  10. create s.make
  11. create s1.make
  12. end
  13. feature {ANY}
  14. test (counter: INTEGER) is
  15. local
  16. i: INTEGER
  17. do
  18. from
  19. i := 1
  20. until
  21. i > counter
  22. loop
  23. s.emit(i)
  24. i := i + 1
  25. end
  26. end
  27. test_direct_0 (counter: INTEGER) is
  28. local
  29. i: INTEGER
  30. do
  31. from
  32. i := 1
  33. until
  34. i > counter
  35. loop
  36. i := i + 1
  37. end
  38. end
  39. test_direct_1 (counter: INTEGER) is
  40. local
  41. i: INTEGER
  42. do
  43. from
  44. i := 1
  45. until
  46. i > counter
  47. loop
  48. foo(i)
  49. i := i + 1
  50. end
  51. end
  52. test_direct_2 (counter: INTEGER) is
  53. local
  54. i: INTEGER
  55. do
  56. from
  57. i := 1
  58. until
  59. i > counter
  60. loop
  61. foo(i)
  62. foo(i)
  63. i := i + 1
  64. end
  65. end
  66. test_direct_3 (counter: INTEGER) is
  67. local
  68. i: INTEGER
  69. do
  70. from
  71. i := 1
  72. until
  73. i > counter
  74. loop
  75. foo(i)
  76. foo(i)
  77. foo(i)
  78. i := i + 1
  79. end
  80. end
  81. foo (k: INTEGER) is
  82. do
  83. j := k + 1
  84. end
  85. end -- class B