THRIFT-216. Add validate method to fixtures so tests pass
Author: Esteve Fernandez
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@734565 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/rb/fixtures/structs.rb b/test/rb/fixtures/structs.rb
index 82c291e..0f0cfa8 100644
--- a/test/rb/fixtures/structs.rb
+++ b/test/rb/fixtures/structs.rb
@@ -8,6 +8,9 @@
FIELDS = {
1 => {:type => Thrift::Types::BOOL, :name => 'bool'}
}
+
+ def validate
+ end
end
class OneByte
@@ -16,6 +19,9 @@
FIELDS = {
1 => {:type => Thrift::Types::BYTE, :name => 'byte'}
}
+
+ def validate
+ end
end
class OneI16
@@ -24,6 +30,9 @@
FIELDS = {
1 => {:type => Thrift::Types::I16, :name => 'i16'}
}
+
+ def validate
+ end
end
class OneI32
@@ -32,6 +41,9 @@
FIELDS = {
1 => {:type => Thrift::Types::I32, :name => 'i32'}
}
+
+ def validate
+ end
end
class OneI64
@@ -40,6 +52,9 @@
FIELDS = {
1 => {:type => Thrift::Types::I64, :name => 'i64'}
}
+
+ def validate
+ end
end
class OneDouble
@@ -48,6 +63,9 @@
FIELDS = {
1 => {:type => Thrift::Types::DOUBLE, :name => 'double'}
}
+
+ def validate
+ end
end
class OneString
@@ -56,6 +74,9 @@
FIELDS = {
1 => {:type => Thrift::Types::STRING, :name => 'string'}
}
+
+ def validate
+ end
end
class OneMap
@@ -64,6 +85,9 @@
FIELDS = {
1 => {:type => Thrift::Types::MAP, :name => 'map', :key => {:type => Thrift::Types::STRING}, :value => {:type => Thrift::Types::STRING}}
}
+
+ def validate
+ end
end
class NestedMap
@@ -72,6 +96,9 @@
FIELDS = {
0 => {:type => Thrift::Types::MAP, :name => 'map', :key => {:type => Thrift::Types::I32}, :value => {:type => Thrift::Types::MAP, :key => {:type => Thrift::Types::I32}, :value => {:type => Thrift::Types::I32}}}
}
+
+ def validate
+ end
end
class OneList
@@ -80,6 +107,9 @@
FIELDS = {
1 => {:type => Thrift::Types::LIST, :name => 'list', :element => {:type => Thrift::Types::STRING}}
}
+
+ def validate
+ end
end
class NestedList
@@ -88,6 +118,9 @@
FIELDS = {
0 => {:type => Thrift::Types::LIST, :name => 'list', :element => {:type => Thrift::Types::LIST, :element => { :type => Thrift::Types::I32 } } }
}
+
+ def validate
+ end
end
class OneSet
@@ -96,6 +129,9 @@
FIELDS = {
1 => {:type => Thrift::Types::SET, :name => 'set', :element => {:type => Thrift::Types::STRING}}
}
+
+ def validate
+ end
end
class NestedSet
@@ -104,6 +140,9 @@
FIELDS = {
1 => {:type => Thrift::Types::SET, :name => 'set', :element => {:type => Thrift::Types::SET, :element => { :type => Thrift::Types::STRING } }}
}
+
+ def validate
+ end
end
# struct OneOfEach {
@@ -144,6 +183,9 @@
end
true
end
+
+ def validate
+ end
end
# struct Nested1 {
@@ -163,6 +205,9 @@
4 => {:type => Thrift::Types::MAP, :name => 'dbl_map', :key => {:type => Thrift::Types::DOUBLE}, :value => {:type => Thrift::Types::STRUCT, :class => OneOfEach}},
5 => {:type => Thrift::Types::MAP, :name => 'str_map', :key => {:type => Thrift::Types::STRING}, :value => {:type => Thrift::Types::STRUCT, :class => OneOfEach}}
}
+
+ def validate
+ end
end
# struct Nested2 {
@@ -182,6 +227,9 @@
4 => {:type => Thrift::Types::MAP, :name => 'dbl_map', :key => {:type => Thrift::Types::DOUBLE}, :value => {:type => Thrift::Types::STRUCT, :class => Nested1}},
5 => {:type => Thrift::Types::MAP, :name => 'str_map', :key => {:type => Thrift::Types::STRING}, :value => {:type => Thrift::Types::STRUCT, :class => Nested1}}
}
+
+ def validate
+ end
end
# struct Nested3 {
@@ -201,6 +249,9 @@
4 => {:type => Thrift::Types::MAP, :name => 'dbl_map', :key => {:type => Thrift::Types::DOUBLE}, :value => {:type => Thrift::Types::STRUCT, :class => Nested2}},
5 => {:type => Thrift::Types::MAP, :name => 'str_map', :key => {:type => Thrift::Types::STRING}, :value => {:type => Thrift::Types::STRUCT, :class => Nested2}}
}
+
+ def validate
+ end
end
# struct Nested4 {
@@ -220,6 +271,9 @@
4 => {:type => Thrift::Types::MAP, :name => 'dbl_map', :key => {:type => Thrift::Types::DOUBLE}, :value => {:type => Thrift::Types::STRUCT, :class => Nested3}},
5 => {:type => Thrift::Types::MAP, :name => 'str_map', :key => {:type => Thrift::Types::STRING}, :value => {:type => Thrift::Types::STRUCT, :class => Nested3}}
}
+
+ def validate
+ end
end
end
end