diff options
author | David Reiss <dreiss@apache.org> | 2010-08-30 22:05:58 +0000 |
---|---|---|
committer | David Reiss <dreiss@apache.org> | 2010-08-30 22:05:58 +0000 |
commit | b4ab00847635ef74a8c03f6336e8378b5979c3e7 (patch) | |
tree | aa4859fd2f8a897676604eb8a13192a923ec92f1 /test/erl | |
parent | 5ed313d998c3a5dc43c4bc9a22d2db57162bd28e (diff) | |
download | thrift-b4ab00847635ef74a8c03f6336e8378b5979c3e7.tar.gz |
erlang: Verify elt/key/val when reading list/set/map
For now, exit on a badmatch if one is wrong.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991000 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/erl')
-rw-r--r-- | test/erl/src/test_membuffer.erl | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/erl/src/test_membuffer.erl b/test/erl/src/test_membuffer.erl index e576ccdbf..19ac5277e 100644 --- a/test/erl/src/test_membuffer.erl +++ b/test/erl/src/test_membuffer.erl @@ -74,8 +74,23 @@ t3() -> true = TestData#bools.im_false =:= Result#bools.im_false. +t4() -> + {ok, Transport} = thrift_memory_buffer:new(), + {ok, Protocol0} = thrift_binary_protocol:new(Transport), + TestData = #insanity{xtructs=[]}, + {Protocol1, ok} = thrift_protocol:write(Protocol0, + {{struct, element(2, thriftTest_types:struct_info('insanity'))}, + TestData}), + {_Protocol2, {ok, Result}} = thrift_protocol:read(Protocol1, + {struct, element(2, thriftTest_types:struct_info('insanity'))}, + 'insanity'), + + TestData = Result. + + t() -> t1(), t2(), - t3(). + t3(), + t4(). |