Skip to content

Commit

Permalink
THRIFT-216. Add validate method to fixtures so tests pass
Browse files Browse the repository at this point in the history
Author: Esteve Fernandez


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@734565 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Kevin Clark committed Jan 14, 2009
1 parent 46bb4ae commit c85fd50
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions test/rb/fixtures/structs.rb
Expand Up @@ -8,6 +8,9 @@ class OneBool
FIELDS = {
1 => {:type => Thrift::Types::BOOL, :name => 'bool'}
}

def validate
end
end

class OneByte
Expand All @@ -16,6 +19,9 @@ class OneByte
FIELDS = {
1 => {:type => Thrift::Types::BYTE, :name => 'byte'}
}

def validate
end
end

class OneI16
Expand All @@ -24,6 +30,9 @@ class OneI16
FIELDS = {
1 => {:type => Thrift::Types::I16, :name => 'i16'}
}

def validate
end
end

class OneI32
Expand All @@ -32,6 +41,9 @@ class OneI32
FIELDS = {
1 => {:type => Thrift::Types::I32, :name => 'i32'}
}

def validate
end
end

class OneI64
Expand All @@ -40,6 +52,9 @@ class OneI64
FIELDS = {
1 => {:type => Thrift::Types::I64, :name => 'i64'}
}

def validate
end
end

class OneDouble
Expand All @@ -48,6 +63,9 @@ class OneDouble
FIELDS = {
1 => {:type => Thrift::Types::DOUBLE, :name => 'double'}
}

def validate
end
end

class OneString
Expand All @@ -56,6 +74,9 @@ class OneString
FIELDS = {
1 => {:type => Thrift::Types::STRING, :name => 'string'}
}

def validate
end
end

class OneMap
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -144,6 +183,9 @@ def ==(other)
end
true
end

def validate
end
end

# struct Nested1 {
Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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

0 comments on commit c85fd50

Please sign in to comment.