From c0e972470e690751302332735c6d93e8b05bf216 Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Mon, 3 Jan 2011 14:05:42 -0500 Subject: [PATCH] Fixed BSON_CODER.update_max_bson_size return value --- ext/cbson/cbson.c | 3 ++- ext/java/jar/jbson.jar | Bin 13831 -> 13829 bytes ext/java/src/org/jbson/RubyBSONEncoder.java | 3 ++- lib/bson.rb | 8 +++++++- test/bson/bson_test.rb | 9 +++++++++ 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ext/cbson/cbson.c b/ext/cbson/cbson.c index 065f23c..4c0c9ce 100644 --- a/ext/cbson/cbson.c +++ b/ext/cbson/cbson.c @@ -904,8 +904,9 @@ static VALUE objectid_generate(VALUE self) return oid; } -static void method_update_max_bson_size(VALUE self, VALUE connection) { +static VALUE method_update_max_bson_size(VALUE self, VALUE connection) { max_bson_size = FIX2INT(rb_funcall(connection, rb_intern("max_bson_size"), 0)); + return INT2FIX(max_bson_size); } static VALUE method_max_bson_size(VALUE self) { diff --git a/ext/java/jar/jbson.jar b/ext/java/jar/jbson.jar index 672589aefceae2fd08e861ded1bb53444323e459..720fc27d84cb7e4894e41b2e7ece1b62a5b958fb 100644 GIT binary patch delta 9012 zcmV-4Bg@=}Y=vwNP)h>@6aWYS2mo$yBR-K1IRtKSBR-K!g#>PJBR;XzDi8#2a3emG z^${YImo*KOF%iH7Zg3+$ll2iWe_IKB(^c}HnP1Xhn*M+^w1t)y!d=pqswiL)gmP%H zEy^JRYE9cfBWY5Tltce2-uJ33t`_gJ>n`hsq$n!5y5fDT=dP~z?drPfdaxk>nfLpp zNz)YB{VbpL{eJKL=FQBTH#6@$FWskqe((_hI7lmXqK4Nw@p`-=8wqc8f8tGev%KBn zz+0Vo8{RI>9Wv4>&2Oc-Q<~p7@b^xBZj#O)9C(*J?{?rl^1Ro9_sMg!1MipT76-+pLD`F zQJL^5X`Ytm85w)l33Kr|e_`;vjxRXyMJF7HFUjXW>-e$*Uva`A(tj0S)A4l~e?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{cJ`Oj zchc%|mhR!H=i>#|)CwLG#3LEySUl~rj&ggD35Z1w4Wz`?LVD-fG0D`f25~)^7a&_ zJJs4nuXPs9PC*r3@>A-hDz6v-P|Ty^S?2Z}$L#Y^N-r=#`8j{S7{8vv4Ce0>t}15r z>(y1v>o*Db?I4|A21yhfA272`2#GbcNwj` z48^f%Z+AHkjUG3=y&K!W}W&(bIGB7F+4(7)kz4vshJa}_D2 zpnncdMEnf=oIx(lFDfef6sEHIFT=~NEu3U+VZP;6CuNg5|mBKJ>6clM5@MvW)Q7c#GZ~(*li8@}xlCH(; zEJ-0NGU|ML;9t$vRhF<%T51kJxpY4z*dh0*2{_nNT~%X>f6U123hrp**x|;5OPdH| zv`H*-GSq05N^AkJ{cBjPj@Pr~8}P;>OK!>``QJy7T*H!US@JO~`B;{G97{evTksj(iEO|Cdp2L#oW=rk{2ll3Zi(902l`Af58+XA+?nAp^ zTrqsM2M+IoJZp;))XVi*)gtE_C(MIFSOBA7A%EGSl)3r;0Z>Z^2#Bc{cUU3-0I@~@ z08mQ-0u%rg00;mG04= BSON::DEFAULT_MAX_BSON_SIZE end + def test_update_max_bson_size + require 'ostruct' + mock_conn = OpenStruct.new + size = 7 * 1024 * 1024 + mock_conn.max_bson_size = size + assert_equal size, BSON_CODER.update_max_bson_size(mock_conn) + assert_equal size, BSON_CODER.max_bson_size + end + def test_round_trip doc = {'doc' => 123} @encoder.deserialize(@encoder.serialize(doc))