From c85fd50e2b3308e84345e5e0045507c20e6c5626 Mon Sep 17 00:00:00 2001 From: Kevin Clark Date: Wed, 14 Jan 2009 23:55:10 +0000 Subject: [PATCH] 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 --- test/rb/fixtures/structs.rb | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/test/rb/fixtures/structs.rb b/test/rb/fixtures/structs.rb index 82c291ecaa1..0f0cfa82e7d 100644 --- a/test/rb/fixtures/structs.rb +++ b/test/rb/fixtures/structs.rb @@ -8,6 +8,9 @@ class OneBool FIELDS = { 1 => {:type => Thrift::Types::BOOL, :name => 'bool'} } + + def validate + end end class OneByte @@ -16,6 +19,9 @@ class OneByte FIELDS = { 1 => {:type => Thrift::Types::BYTE, :name => 'byte'} } + + def validate + end end class OneI16 @@ -24,6 +30,9 @@ class OneI16 FIELDS = { 1 => {:type => Thrift::Types::I16, :name => 'i16'} } + + def validate + end end class OneI32 @@ -32,6 +41,9 @@ class OneI32 FIELDS = { 1 => {:type => Thrift::Types::I32, :name => 'i32'} } + + def validate + end end class OneI64 @@ -40,6 +52,9 @@ class OneI64 FIELDS = { 1 => {:type => Thrift::Types::I64, :name => 'i64'} } + + def validate + end end class OneDouble @@ -48,6 +63,9 @@ class OneDouble FIELDS = { 1 => {:type => Thrift::Types::DOUBLE, :name => 'double'} } + + def validate + end end class OneString @@ -56,6 +74,9 @@ class OneString FIELDS = { 1 => {:type => Thrift::Types::STRING, :name => 'string'} } + + def validate + end end class OneMap @@ -64,6 +85,9 @@ class OneMap 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 @@ class NestedMap 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 @@ class OneList FIELDS = { 1 => {:type => Thrift::Types::LIST, :name => 'list', :element => {:type => Thrift::Types::STRING}} } + + def validate + end end class NestedList @@ -88,6 +118,9 @@ class NestedList 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 @@ class OneSet FIELDS = { 1 => {:type => Thrift::Types::SET, :name => 'set', :element => {:type => Thrift::Types::STRING}} } + + def validate + end end class NestedSet @@ -104,6 +140,9 @@ class NestedSet 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 @@ def ==(other) end true end + + def validate + end end # struct Nested1 { @@ -163,6 +205,9 @@ class Nested1 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 @@ class Nested2 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 @@ class Nested3 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 @@ class Nested4 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