adlint 1.10.0 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/ChangeLog +197 -4
  2. data/MANIFEST +17 -0
  3. data/NEWS +23 -4
  4. data/etc/mesg.d/en_US/messages.yml +14 -1
  5. data/etc/mesg.d/ja_JP/messages.yml +14 -1
  6. data/features/message_detection/W0093.feature +87 -0
  7. data/features/message_detection/W0687.feature +25 -0
  8. data/features/message_detection/W0688.feature +63 -0
  9. data/features/message_detection/W0689.feature +46 -0
  10. data/features/message_detection/W0690.feature +35 -0
  11. data/features/message_detection/W0698.feature +3 -2
  12. data/features/message_detection/W0703.feature +1 -0
  13. data/features/message_detection/W0723.feature +34 -0
  14. data/features/message_detection/W0732.feature +158 -0
  15. data/features/message_detection/W0733.feature +158 -0
  16. data/features/message_detection/W0734.feature +322 -0
  17. data/features/message_detection/W0735.feature +322 -0
  18. data/features/message_detection/W1052.feature +66 -0
  19. data/features/message_detection/W9001.feature +33 -0
  20. data/features/message_detection/W9003.feature +131 -0
  21. data/lib/adlint/c/ctrlexpr.rb +51 -50
  22. data/lib/adlint/c/domain.rb +237 -223
  23. data/lib/adlint/c/expr.rb +6 -8
  24. data/lib/adlint/c/interp.rb +8 -11
  25. data/lib/adlint/c/message.rb +20 -0
  26. data/lib/adlint/c/message_shima.rb +63 -0
  27. data/lib/adlint/c/object.rb +5 -4
  28. data/lib/adlint/c/operator.rb +99 -0
  29. data/lib/adlint/c/parser.rb +2 -2
  30. data/lib/adlint/c/parser.y +2 -2
  31. data/lib/adlint/c/phase.rb +6 -1
  32. data/lib/adlint/c/syntax.rb +442 -30
  33. data/lib/adlint/c/type.rb +449 -363
  34. data/lib/adlint/c/value.rb +96 -25
  35. data/lib/adlint/c.rb +1 -0
  36. data/lib/adlint/prelude.rb +16 -18
  37. data/lib/adlint/version.rb +2 -2
  38. data/share/doc/developers_guide_ja.html +11 -5
  39. data/share/doc/developers_guide_ja.texi +9 -3
  40. data/share/doc/users_guide_en.html +697 -131
  41. data/share/doc/users_guide_en.texi +491 -41
  42. data/share/doc/users_guide_ja.html +709 -139
  43. data/share/doc/users_guide_ja.texi +499 -45
  44. data/spec/adlint/c/ctrlexpr_spec.rb +168 -0
  45. data/spec/adlint/c/domain_spec.rb +835 -0
  46. data/spec/adlint/c/operator_spec.rb +406 -0
  47. data/spec/adlint/c/syntax_spec.rb +717 -0
  48. data/spec/adlint/c/type_spec.rb +55 -30
  49. metadata +19 -2
@@ -45,61 +45,86 @@ module C
45
45
  let(:const_volatile_int) { qualified_type(int_type, :const, :volatile) }
46
46
 
47
47
  describe ArrayType do
48
- context "detecting W0583" do
48
+ context "`int[3]'" do
49
49
  subject { array_type(int_type, 3) }
50
- it { should be_convertible(const_int_ptr) }
51
- end
52
50
 
53
- context "detecting W0583" do
54
- subject { array_type(int_type, 3) }
55
- it { should be_convertible(int_ptr) }
56
- end
51
+ it "should be convertible to `const int *'" do
52
+ should be_convertible(const_int_ptr)
53
+ end
57
54
 
58
- context "detecting W0583" do
59
- subject { array_type(int_type) }
60
- it { should be_convertible(const_int_ptr) }
55
+ it "should be convertible to `int *'" do
56
+ should be_convertible(int_ptr)
57
+ end
61
58
  end
62
59
 
63
- context "detecting W0583" do
60
+ context "`int[]'" do
64
61
  subject { array_type(int_type) }
65
- it { should be_convertible(int_ptr) }
62
+
63
+ it "should be convertible to `const int *'" do
64
+ should be_convertible(const_int_ptr)
65
+ end
66
+
67
+ it "should be convertible to `int *'" do
68
+ should be_convertible(int_ptr)
69
+ end
66
70
  end
67
71
  end
68
72
 
69
73
  describe PointerType do
70
- context "detecting W0583" do
74
+ context "`const int *'" do
71
75
  subject { const_int_ptr }
72
- it { should_not be_convertible(array_type(int_type)) }
76
+
77
+ it "should not be convertible to `int[]'" do
78
+ should_not be_convertible(array_type(int_type))
79
+ end
73
80
  end
74
81
 
75
- context "detecting W0583" do
82
+ context "`int *'" do
76
83
  subject { int_ptr }
77
- it { should be_convertible(array_type(int_type)) }
84
+
85
+ it "should be convertible to `int[]'" do
86
+ should be_convertible(array_type(int_type))
87
+ end
78
88
  end
79
89
 
80
- context "more cv-qualified check of `const > none'" do
90
+ context "`const int'" do
81
91
  subject { const_int }
82
- it { should be_more_cv_qualified(int_type) }
92
+
93
+ it "should be more cv-qualified than `int'" do
94
+ should be_more_cv_qualified(int_type)
95
+ end
96
+
97
+ it "should not be more cv-qualified than `const int'" do
98
+ should_not be_more_cv_qualified(const_int)
99
+ end
100
+
101
+ it "should not be more cv-qualified than `volatile int'" do
102
+ should_not be_more_cv_qualified(volatile_int)
103
+ end
83
104
  end
84
105
 
85
- context "more cv-qualified check of `volatile > none'" do
106
+ context "`volatile int'" do
86
107
  subject { volatile_int }
87
- it { should be_more_cv_qualified(int_type) }
88
- end
89
108
 
90
- context "more cv-qualified check of `const volatile > none'" do
91
- subject { const_volatile_int }
92
- it { should be_more_cv_qualified(int_type) }
109
+ it "should be more cv-qualified than `int'" do
110
+ should be_more_cv_qualified(int_type)
111
+ end
93
112
  end
94
113
 
95
- context "more cv-qualified check of `const volatile > const'" do
114
+ context "`const volatile int'" do
96
115
  subject { const_volatile_int }
97
- it { should be_more_cv_qualified(const_int) }
98
- end
99
116
 
100
- context "more cv-qualified check of `const volatile > volatile'" do
101
- subject { const_volatile_int }
102
- it { should be_more_cv_qualified(volatile_int) }
117
+ it "should be more cv-qualified than `int'" do
118
+ should be_more_cv_qualified(int_type)
119
+ end
120
+
121
+ it "should be more cv-qualified than `const int'" do
122
+ should be_more_cv_qualified(const_int)
123
+ end
124
+
125
+ it "should be more cv-qualified than `volatile int'" do
126
+ should be_more_cv_qualified(volatile_int)
127
+ end
103
128
  end
104
129
  end
105
130
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adlint
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.12.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-06 00:00:00.000000000 Z
12
+ date: 2012-06-20 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! 'AdLint is a source code static analyzer.
15
15
 
@@ -67,9 +67,14 @@ files:
67
67
  - features/message_detection/W0007.feature
68
68
  - features/message_detection/W0010.feature
69
69
  - features/message_detection/W0013.feature
70
+ - features/message_detection/W0093.feature
70
71
  - features/message_detection/W0109.feature
71
72
  - features/message_detection/W0583.feature
72
73
  - features/message_detection/W0606.feature
74
+ - features/message_detection/W0687.feature
75
+ - features/message_detection/W0688.feature
76
+ - features/message_detection/W0689.feature
77
+ - features/message_detection/W0690.feature
73
78
  - features/message_detection/W0698.feature
74
79
  - features/message_detection/W0699.feature
75
80
  - features/message_detection/W0703.feature
@@ -77,7 +82,14 @@ files:
77
82
  - features/message_detection/W0717.feature
78
83
  - features/message_detection/W0718.feature
79
84
  - features/message_detection/W0723.feature
85
+ - features/message_detection/W0732.feature
86
+ - features/message_detection/W0733.feature
87
+ - features/message_detection/W0734.feature
88
+ - features/message_detection/W0735.feature
80
89
  - features/message_detection/W1031.feature
90
+ - features/message_detection/W1052.feature
91
+ - features/message_detection/W9001.feature
92
+ - features/message_detection/W9003.feature
81
93
  - features/step_definitions/message_detection_steps.rb
82
94
  - features/support/env.rb
83
95
  - lib/adlint.rb
@@ -101,6 +113,7 @@ files:
101
113
  - lib/adlint/c/message_shima.rb
102
114
  - lib/adlint/c/metric.rb
103
115
  - lib/adlint/c/object.rb
116
+ - lib/adlint/c/operator.rb
104
117
  - lib/adlint/c/option.rb
105
118
  - lib/adlint/c/parser.y
106
119
  - lib/adlint/c/parser.rb
@@ -537,6 +550,10 @@ files:
537
550
  - share/sample/zsh-4.3.15/adlint/zle/adlint_pinit.h
538
551
  - share/sample/zsh-4.3.15/adlint/zle/adlint_traits.yml
539
552
  - spec/spec_helper.rb
553
+ - spec/adlint/c/ctrlexpr_spec.rb
554
+ - spec/adlint/c/domain_spec.rb
555
+ - spec/adlint/c/operator_spec.rb
556
+ - spec/adlint/c/syntax_spec.rb
540
557
  - spec/adlint/c/type_spec.rb
541
558
  - spec/conf.d/empty_cinit.h
542
559
  - spec/conf.d/empty_pinit.h