slow_blink 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/ext/slow_blink/ext_schema_parser/extconf.rb +1 -0
  3. data/ext/slow_blink/ext_schema_parser/lexer.c +6 -8
  4. data/ext/slow_blink/ext_schema_parser/lexer.h +1 -1
  5. data/ext/slow_blink/ext_schema_parser/parser.c +3 -1
  6. data/ext/slow_blink/message/ext_compact_encoder/ext_compact_encoder.c +46 -24
  7. data/ext/slow_blink/message/ext_compact_encoder/extconf.rb +9 -2
  8. data/lib/slow_blink/enum.rb +4 -1
  9. data/lib/slow_blink/field.rb +1 -1
  10. data/lib/slow_blink/generate_c/model.rb +119 -12
  11. data/lib/slow_blink/message/binary.rb +9 -1
  12. data/lib/slow_blink/message/boolean.rb +12 -3
  13. data/lib/slow_blink/message/date.rb +9 -1
  14. data/lib/slow_blink/message/decimal.rb +9 -1
  15. data/lib/slow_blink/message/dynamic_group.rb +132 -0
  16. data/lib/slow_blink/message/enum.rb +6 -2
  17. data/lib/slow_blink/message/field.rb +67 -43
  18. data/lib/slow_blink/message/fixed.rb +5 -1
  19. data/lib/slow_blink/message/floating_point.rb +9 -1
  20. data/lib/slow_blink/message/group.rb +54 -197
  21. data/lib/slow_blink/message/integer.rb +16 -8
  22. data/lib/slow_blink/message/model.rb +20 -18
  23. data/lib/slow_blink/message/static_group.rb +63 -0
  24. data/lib/slow_blink/message/string.rb +9 -1
  25. data/lib/slow_blink/message/test_data.rb +126 -0
  26. data/lib/slow_blink/message/time.rb +10 -2
  27. data/lib/slow_blink/message/time_of_day.rb +18 -2
  28. data/lib/slow_blink/schema.rb +2 -2
  29. data/lib/slow_blink/type.rb +3 -3
  30. data/lib/slow_blink/version.rb +1 -1
  31. data/test/tc_inputs.rb +34 -25
  32. data/test/tc_model_enum.rb +47 -0
  33. data/test/tc_model_inputs.rb +47 -0
  34. metadata +9 -7
  35. data/ext/slow_blink/message/ext_compact_encoder/blink_compact.c +0 -642
  36. data/ext/slow_blink/message/ext_compact_encoder/blink_compact.h +0 -411
  37. data/ext/slow_blink/message/ext_compact_encoder/blink_debug.h +0 -46
  38. data/ext/slow_blink/message/ext_compact_encoder/blink_stream.c +0 -314
  39. data/ext/slow_blink/message/ext_compact_encoder/blink_stream.h +0 -185
@@ -0,0 +1,47 @@
1
+ require_relative "capture_stderr"
2
+ require "test/unit"
3
+ require "slow_blink"
4
+
5
+ inputs = {}
6
+ root = "test/input"
7
+
8
+ testClass = Class.new(Test::Unit::TestCase) do
9
+
10
+ class << self
11
+ attr_accessor :inputs
12
+ end
13
+
14
+ Dir.foreach(root) do |filename|
15
+
16
+ next if filename == ".." or filename == "."
17
+
18
+ test_name = "test_#{filename.sub(".blink", "")}"
19
+ inputs[test_name.to_sym] = "#{root}/#{filename}"
20
+
21
+ define_method( test_name ) do
22
+
23
+ # run and intercept stderr output
24
+ err = capture_stderr do
25
+ SlowBlink::Schema.read(inputs[__method__])
26
+ end
27
+
28
+ # there should have been no messages to stderr
29
+ assert_equal("", err.string, "unexpected error messages")
30
+
31
+ # if there were messages, forward them to stderr
32
+ if err.string != ""
33
+ STDERR.puts err.string
34
+ end
35
+
36
+ end
37
+
38
+ end
39
+
40
+ end
41
+
42
+ # set inputs as a class variable
43
+ testClass.inputs = inputs
44
+
45
+ # name the dynamic test class
46
+ Object.const_set("TestModelInputs", testClass)
47
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slow_blink
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Harper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-19 00:00:00.000000000 Z
11
+ date: 2017-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler
@@ -66,11 +66,6 @@ files:
66
66
  - ext/slow_blink/ext_schema_parser/lexer.h
67
67
  - ext/slow_blink/ext_schema_parser/parser.c
68
68
  - ext/slow_blink/ext_schema_parser/parser.h
69
- - ext/slow_blink/message/ext_compact_encoder/blink_compact.c
70
- - ext/slow_blink/message/ext_compact_encoder/blink_compact.h
71
- - ext/slow_blink/message/ext_compact_encoder/blink_debug.h
72
- - ext/slow_blink/message/ext_compact_encoder/blink_stream.c
73
- - ext/slow_blink/message/ext_compact_encoder/blink_stream.h
74
69
  - ext/slow_blink/message/ext_compact_encoder/ext_compact_encoder.c
75
70
  - ext/slow_blink/message/ext_compact_encoder/extconf.rb
76
71
  - lib/slow_blink.rb
@@ -91,6 +86,7 @@ files:
91
86
  - lib/slow_blink/message/boolean.rb
92
87
  - lib/slow_blink/message/date.rb
93
88
  - lib/slow_blink/message/decimal.rb
89
+ - lib/slow_blink/message/dynamic_group.rb
94
90
  - lib/slow_blink/message/enum.rb
95
91
  - lib/slow_blink/message/field.rb
96
92
  - lib/slow_blink/message/fixed.rb
@@ -98,7 +94,9 @@ files:
98
94
  - lib/slow_blink/message/group.rb
99
95
  - lib/slow_blink/message/integer.rb
100
96
  - lib/slow_blink/message/model.rb
97
+ - lib/slow_blink/message/static_group.rb
101
98
  - lib/slow_blink/message/string.rb
99
+ - lib/slow_blink/message/test_data.rb
102
100
  - lib/slow_blink/message/time.rb
103
101
  - lib/slow_blink/message/time_of_day.rb
104
102
  - lib/slow_blink/object.rb
@@ -119,7 +117,9 @@ files:
119
117
  - test/tc_inputs.rb
120
118
  - test/tc_model_decimal.rb
121
119
  - test/tc_model_dynamic_group.rb
120
+ - test/tc_model_enum.rb
122
121
  - test/tc_model_extension.rb
122
+ - test/tc_model_inputs.rb
123
123
  - test/tc_model_sequence_of_string.rb
124
124
  - test/tc_model_static_group.rb
125
125
  - test/tc_model_string.rb
@@ -156,8 +156,10 @@ test_files:
156
156
  - test/tc_compact_encoder.rb
157
157
  - test/tc_inputs.rb
158
158
  - test/tc_model_string.rb
159
+ - test/tc_model_inputs.rb
159
160
  - test/tc_model_sequence_of_string.rb
160
161
  - test/capture_stderr.rb
161
162
  - test/tc_model_think_blink.rb
163
+ - test/tc_model_enum.rb
162
164
  - test/tc_schema_new.rb
163
165
  - test/tc_model_dynamic_group.rb