1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841
|
#
# Copyright (c) ZeroC, Inc. All rights reserved.
#
require 'Ice'
Ice::loadSlice('-I. --all ClientPrivate.ice')
def allTests(helper, communicator)
obj = communicator.stringToProxy("Test:#{helper.getTestEndpoint()}")
t = Test::TestIntfPrx::checkedCast(obj)
print "base as Object... "
STDOUT.flush
o = nil
begin
o = t.SBaseAsObject()
test(o)
test(o.ice_id() == "::Test::SBase")
rescue Ice::Exception
puts $!.inspect
test(false)
end
sb = o
test(sb.is_a?(Test::SBase))
test(sb)
test(sb.sb == "SBase.sb")
puts "ok"
print "base as base... "
STDOUT.flush
begin
sb = t.SBaseAsSBase()
test(sb.sb == "SBase.sb")
rescue Ice::Exception
test(false)
end
puts "ok"
print "base with known derived as base... "
STDOUT.flush
begin
sb = t.SBSKnownDerivedAsSBase()
test(sb.sb == "SBSKnownDerived.sb")
rescue Ice::Exception
test(false)
end
sbskd = sb
test(sbskd.is_a?(Test::SBSKnownDerived))
test(sbskd)
test(sbskd.sbskd == "SBSKnownDerived.sbskd")
puts "ok"
print "base with known derived as known derived... "
STDOUT.flush
begin
sbskd = t.SBSKnownDerivedAsSBSKnownDerived()
test(sbskd.sbskd == "SBSKnownDerived.sbskd")
rescue Ice::Exception
test(false)
end
puts "ok"
print "base with unknown derived as base... "
STDOUT.flush
begin
sb = t.SBSUnknownDerivedAsSBase()
test(sb.sb == "SBSUnknownDerived.sb")
rescue Ice::Exception
test(false)
end
if t.ice_getEncodingVersion() == Ice::Encoding_1_0
begin
#
# This test succeeds for the 1.0 encoding.
#
sb = t.SBSUnknownDerivedAsSBaseCompact()
test(sb.sb == "SBSUnknownDerived.sb")
rescue
test(false)
end
else
begin
#
# This test fails when using the compact format because the instance cannot
# be sliced to a known type.
#
sb = t.SBSUnknownDerivedAsSBaseCompact()
test(false)
rescue Ice::NoValueFactoryException
# Expected.
rescue
test(false)
end
end
puts "ok"
print "unknown with Object as Object... "
STDOUT.flush
begin
o = t.SUnknownAsObject()
test(t.ice_getEncodingVersion() != Ice::Encoding_1_0)
test(o.is_a?(Ice::UnknownSlicedValue))
test(o.ice_id() == "::Test::SUnknown")
test(o.ice_getSlicedData() != nil)
t.checkSUnknown(o)
rescue Ice::NoValueFactoryException
test(t.ice_getEncodingVersion() == Ice::Encoding_1_0)
rescue Ice::Exception
test(false)
end
puts "ok"
print "one-element cycle... "
STDOUT.flush
begin
b = t.oneElementCycle()
test(b)
test(b.ice_id() == "::Test::B")
test(b.sb == "B1.sb")
test(b.pb == b)
rescue Ice::Exception
test(false)
end
puts "ok"
print "two-element cycle... "
STDOUT.flush
begin
b1 = t.twoElementCycle()
test(b1)
test(b1.ice_id() == "::Test::B")
test(b1.sb == "B1.sb")
b2 = b1.pb
test(b2)
test(b2.ice_id() == "::Test::B")
test(b2.sb == "B2.sb")
test(b2.pb == b1)
rescue Ice::Exception
test(false)
end
puts "ok"
print "known derived pointer slicing as base... "
STDOUT.flush
begin
b1 = t.D1AsB()
test(b1)
test(b1.ice_id() == "::Test::D1")
test(b1.sb == "D1.sb")
test(b1.pb)
test(b1.pb != b1)
d1 = b1
test(d1.is_a?(Test::D1))
test(d1.sd1 == "D1.sd1")
test(d1.pd1)
test(d1.pd1 != b1)
test(b1.pb == d1.pd1)
b2 = b1.pb
test(b2)
test(b2.pb == b1)
test(b2.sb == "D2.sb")
test(b2.ice_id() == "::Test::B")
rescue Ice::Exception
test(false)
end
puts "ok"
print "known derived pointer slicing as derived... "
STDOUT.flush
begin
d1 = t.D1AsD1()
test(d1)
test(d1.ice_id() == "::Test::D1")
test(d1.sb == "D1.sb")
test(d1.pb)
test(d1.pb != d1)
b2 = d1.pb
test(b2)
test(b2.ice_id() == "::Test::B")
test(b2.sb == "D2.sb")
test(b2.pb == d1)
rescue Ice::Exception
test(false)
end
puts "ok"
print "unknown derived pointer slicing as base... "
STDOUT.flush
begin
b2 = t.D2AsB()
test(b2)
test(b2.ice_id() == "::Test::B")
test(b2.sb == "D2.sb")
test(b2.pb)
test(b2.pb != b2)
b1 = b2.pb
test(b1)
test(b1.ice_id() == "::Test::D1")
test(b1.sb == "D1.sb")
test(b1.pb == b2)
d1 = b1
test(d1.is_a?(Test::D1))
test(d1.sd1 == "D1.sd1")
test(d1.pd1 == b2)
rescue Ice::Exception
test(false)
end
puts "ok"
print "param ptr slicing with known first... "
STDOUT.flush
begin
b1, b2 = t.paramTest1()
test(b1)
test(b1.ice_id() == "::Test::D1")
test(b1.sb == "D1.sb")
test(b1.pb == b2)
d1 = b1
test(d1.is_a?(Test::D1))
test(d1.sd1 == "D1.sd1")
test(d1.pd1 == b2)
test(b2)
test(b2.ice_id() == "::Test::B") # No factory, must be sliced
test(b2.sb == "D2.sb")
test(b2.pb == b1)
rescue Ice::Exception
test(false)
end
puts "ok"
print "param ptr slicing with unknown first... "
STDOUT.flush
begin
b2, b1 = t.paramTest2()
test(b1)
test(b1.ice_id() == "::Test::D1")
test(b1.sb == "D1.sb")
test(b1.pb == b2)
d1 = b1
test(d1.is_a?(Test::D1))
test(d1.sd1 == "D1.sd1")
test(d1.pd1 == b2)
test(b2)
test(b2.ice_id() == "::Test::B") # No factory, must be sliced
test(b2.sb == "D2.sb")
test(b2.pb == b1)
rescue Ice::Exception
test(false)
end
puts "ok"
print "return value identity with known first... "
STDOUT.flush
begin
r, p1, p2 = t.returnTest1()
test(r == p1)
rescue Ice::Exception
test(false)
end
puts "ok"
print "return value identity with unknown first... "
STDOUT.flush
begin
r, p1, p2 = t.returnTest2()
test(r == p1)
rescue Ice::Exception
test(false)
end
puts "ok"
print "return value identity for input params known first... "
STDOUT.flush
begin
d1 = Test::D1.new
d1.sb = "D1.sb"
d1.sd1 = "D1.sd1"
d3 = Test::D3.new
d3.pb = d1
d3.sb = "D3.sb"
d3.sd3 = "D3.sd3"
d3.pd3 = d1
d1.pb = d3
d1.pd1 = d3
b1 = t.returnTest3(d1, d3)
test(b1)
test(b1.sb == "D1.sb")
test(b1.ice_id() == "::Test::D1")
p1 = b1
test(p1.is_a?(Test::D1))
test(p1.sd1 == "D1.sd1")
test(p1.pd1 == b1.pb)
b2 = b1.pb
test(b2)
test(b2.sb == "D3.sb")
test(b2.ice_id() == "::Test::B") # Sliced by server
test(b2.pb == b1)
p3 = b2
test(!p3.is_a?(Test::D3))
test(b1 != d1)
test(b1 != d3)
test(b2 != d1)
test(b2 != d3)
rescue Ice::Exception
test(false)
end
puts "ok"
print "return value identity for input params unknown first... "
STDOUT.flush
begin
d1 = Test::D1.new
d1.sb = "D1.sb"
d1.sd1 = "D1.sd1"
d3 = Test::D3.new
d3.pb = d1
d3.sb = "D3.sb"
d3.sd3 = "D3.sd3"
d3.pd3 = d1
d1.pb = d3
d1.pd1 = d3
b1 = t.returnTest3(d3, d1)
test(b1)
test(b1.sb == "D3.sb")
test(b1.ice_id() == "::Test::B") # Sliced by server
p1 = b1
test(!p1.is_a?(Test::D3))
b2 = b1.pb
test(b2)
test(b2.sb == "D1.sb")
test(b2.ice_id() == "::Test::D1")
test(b2.pb == b1)
p3 = b2
test(p3.is_a?(Test::D1))
test(p3.sd1 == "D1.sd1")
test(p3.pd1 == b1)
test(b1 != d1)
test(b1 != d3)
test(b2 != d1)
test(b2 != d3)
rescue Ice::Exception
test(false)
end
puts "ok"
print "remainder unmarshaling (3 instances)... "
STDOUT.flush
begin
ret, p1, p2 = t.paramTest3()
test(p1)
test(p1.sb == "D2.sb (p1 1)")
test(p1.pb == nil)
test(p1.ice_id() == "::Test::B")
test(p2)
test(p2.sb == "D2.sb (p2 1)")
test(p2.pb == nil)
test(p2.ice_id() == "::Test::B")
test(ret)
test(ret.sb == "D1.sb (p2 2)")
test(ret.pb == nil)
test(ret.ice_id() == "::Test::D1")
rescue Ice::Exception
test(false)
end
puts "ok"
print "remainder unmarshaling (4 instances)... "
STDOUT.flush
begin
ret, b = t.paramTest4()
test(b)
test(b.sb == "D4.sb (1)")
test(b.pb == nil)
test(b.ice_id() == "::Test::B")
test(ret)
test(ret.sb == "B.sb (2)")
test(ret.pb == nil)
test(ret.ice_id() == "::Test::B")
rescue Ice::Exception
test(false)
end
puts "ok"
print "param ptr slicing, instance marshaled in unknown derived as base... "
STDOUT.flush
begin
b1 = Test::B.new
b1.sb = "B.sb(1)"
b1.pb = b1
d3 = Test::D3.new
d3.sb = "D3.sb"
d3.pb = d3
d3.sd3 = "D3.sd3"
d3.pd3 = b1
b2 = Test::B.new
b2.sb = "B.sb(2)"
b2.pb = b1
r = t.returnTest3(d3, b2)
test(r)
test(r.ice_id() == "::Test::B")
test(r.sb == "D3.sb")
test(r.pb == r)
rescue Ice::Exception
test(false)
end
puts "ok"
print "param ptr slicing, instance marshaled in unknown derived as derived... "
STDOUT.flush
begin
d11 = Test::D1.new
d11.sb = "D1.sb(1)"
d11.pb = d11
d11.sd1 = "D1.sd1(1)"
d11.pd1 = nil
d3 = Test::D3.new
d3.sb = "D3.sb"
d3.pb = d3
d3.sd3 = "D3.sd3"
d3.pd3 = d11
d12 = Test::D1.new
d12.sb = "D1.sb(2)"
d12.pb = d12
d12.sd1 = "D1.sd1(2)"
d12.pd1 = d11
r = t.returnTest3(d3, d12)
test(r)
test(r.ice_id() == "::Test::B")
test(r.sb == "D3.sb")
test(r.pb == r)
rescue Ice::Exception
test(false)
end
puts "ok"
print "sequence slicing... "
STDOUT.flush
begin
ss = Test::SS3.new
ss1b = Test::B.new
ss1b.sb = "B.sb"
ss1b.pb = ss1b
ss1d1 = Test::D1.new
ss1d1.sb = "D1.sb"
ss1d1.sd1 = "D1.sd1"
ss1d1.pb = ss1b
ss1d3 = Test::D3.new
ss1d3.sb = "D3.sb"
ss1d3.sd3 = "D3.sd3"
ss1d3.pb = ss1b
ss2b = Test::B.new
ss2b.sb = "B.sb"
ss2b.pb = ss1b
ss2d1 = Test::D1.new
ss2d1.sb = "D1.sb"
ss2d1.sd1 = "D1.sd1"
ss2d1.pb = ss2b
ss2d3 = Test::D3.new
ss2d3.sb = "D3.sb"
ss2d3.sd3 = "D3.sd3"
ss2d3.pb = ss2b
ss1d1.pd1 = ss2b
ss1d3.pd3 = ss2d1
ss2d1.pd1 = ss1d3
ss2d3.pd3 = ss1d1
ss1 = Test::SS1.new
ss1.s = [ss1b, ss1d1, ss1d3]
ss2 = Test::SS2.new
ss2.s = [ss2b, ss2d1, ss2d3]
ss = t.sequenceTest(ss1, ss2)
test(ss.c1)
ss1b = ss.c1.s[0]
ss1d1 = ss.c1.s[1]
test(ss.c2)
ss1d3 = ss.c1.s[2]
test(ss.c2)
ss2b = ss.c2.s[0]
ss2d1 = ss.c2.s[1]
ss2d3 = ss.c2.s[2]
test(ss1b.pb == ss1b)
test(ss1d1.pb == ss1b)
test(ss1d3.pb == ss1b)
test(ss2b.pb == ss1b)
test(ss2d1.pb == ss2b)
test(ss2d3.pb == ss2b)
test(ss1b.ice_id() == "::Test::B")
test(ss1d1.ice_id() == "::Test::D1")
test(ss1d3.ice_id() == "::Test::B")
test(ss2b.ice_id() == "::Test::B")
test(ss2d1.ice_id() == "::Test::D1")
test(ss2d3.ice_id() == "::Test::B")
rescue Ice::Exception
test(false)
end
puts "ok"
print "dictionary slicing... "
STDOUT.flush
begin
bin = {}
for i in (0...10)
d1 = Test::D1.new
s = "D1." + i.to_s
d1.sb = s
d1.pb = d1
d1.sd1 = s
d1.pd1 = nil
bin[i] = d1
end
r, bout = t.dictionaryTest(bin)
test(bout.length == 10)
for i in (0...10)
b = bout[i * 10]
test(b)
s = "D1." + i.to_s
test(b.sb == s)
test(b.pb)
test(b.pb != b)
test(b.pb.sb == s)
test(b.pb.pb == b.pb)
end
test(r.length == 10)
for i in (0...10)
b = r[i * 20]
test(b)
s = "D1." + (i * 20).to_s
test(b.sb == s)
if i == 0
test(b.pb == nil)
else
test(b.pb == r[(i - 1) * 20])
end
d1 = b
test(d1.is_a?(Test::D1))
test(d1.sd1 == s)
test(d1.pd1 == d1)
end
rescue Ice::Exception
test(false)
end
puts "ok"
print "base exception thrown as base exception... "
STDOUT.flush
begin
t.throwBaseAsBase()
test(false)
rescue Test::BaseException => e
test(e.ice_id() == "::Test::BaseException")
test(e.sbe == "sbe")
test(e.pb)
test(e.pb.sb == "sb")
test(e.pb.pb == e.pb)
rescue Ice::Exception
test(false)
end
puts "ok"
print "derived exception thrown as base exception... "
STDOUT.flush
begin
t.throwDerivedAsBase()
test(false)
rescue Test::DerivedException => e
test(e.ice_id() == "::Test::DerivedException")
test(e.sbe == "sbe")
test(e.pb)
test(e.pb.sb == "sb1")
test(e.pb.pb == e.pb)
test(e.sde == "sde1")
test(e.pd1)
test(e.pd1.sb == "sb2")
test(e.pd1.pb == e.pd1)
test(e.pd1.sd1 == "sd2")
test(e.pd1.pd1 == e.pd1)
rescue Ice::Exception
test(false)
end
puts "ok"
print "derived exception thrown as derived exception... "
STDOUT.flush
begin
t.throwDerivedAsDerived()
test(false)
rescue Test::DerivedException => e
test(e.ice_id() == "::Test::DerivedException")
test(e.sbe == "sbe")
test(e.pb)
test(e.pb.sb == "sb1")
test(e.pb.pb == e.pb)
test(e.sde == "sde1")
test(e.pd1)
test(e.pd1.sb == "sb2")
test(e.pd1.pb == e.pd1)
test(e.pd1.sd1 == "sd2")
test(e.pd1.pd1 == e.pd1)
rescue Ice::Exception
test(false)
end
puts "ok"
print "unknown derived exception thrown as base exception... "
STDOUT.flush
begin
t.throwUnknownDerivedAsBase()
test(false)
rescue Test::BaseException => e
test(e.ice_id() == "::Test::BaseException")
test(e.sbe == "sbe")
test(e.pb)
test(e.pb.sb == "sb d2")
test(e.pb.pb == e.pb)
rescue Ice::Exception
test(false)
end
puts "ok"
print "forward-declared class... "
STDOUT.flush
begin
f = t.useForward()
test(f)
rescue Ice::Exception
test(false)
end
puts "ok"
print "preserved classes... "
STDOUT.flush
#
# Server knows the most-derived class PDerived.
#
pd = Test::PDerived.new()
pd.pi = 3
pd.ps = "preserved"
pd.pb = pd
r = t.exchangePBase(pd)
test(r.is_a?(Test::PDerived))
test(r.pi == 3)
test(r.ps == "preserved")
test(r.pb == r)
#
# Server only knows the base (non-preserved) type, so the object is sliced.
#
pu = Test::PCUnknown.new()
pu.pi = 3
pu.pu = "preserved"
r = t.exchangePBase(pu)
test(!r.is_a?(Test::PCUnknown))
test(r.pi == 3)
#
# Server only knows the intermediate type Preserved. The object will be sliced to
# Preserved for the 1.0 encoding; otherwise it should be returned intact.
#
pcd = Test::PCDerived.new()
pcd.pi = 3
pcd.pbs = [ pcd ]
r = t.exchangePBase(pcd)
if t.ice_getEncodingVersion() == Ice::Encoding_1_0
test(!r.is_a?(Test::PCDerived))
test(r.pi == 3)
else
test(r.is_a?(Test::PCDerived))
test(r.pi == 3)
test(r.pbs[0] == r)
end
#
# Server only knows the intermediate type CompactPDerived. The object will be sliced to
# CompactPDerived for the 1.0 encoding; otherwise it should be returned intact.
#
pcd = Test::CompactPCDerived.new()
pcd.pi = 3
pcd.pbs = [ pcd ]
r = t.exchangePBase(pcd)
if t.ice_getEncodingVersion() == Ice::Encoding_1_0
test(!r.is_a?(Test::CompactPCDerived))
test(r.pi == 3)
else
test(r.is_a?(Test::CompactPCDerived))
test(r.pi == 3)
test(r.pbs[0] == r)
end
#
# Send an object that will have multiple preserved slices in the server.
# The object will be sliced to PDerived for the 1.0 encoding.
#
pcd = Test::PCDerived3.new()
pcd.pi = 3
#
# Sending more than 254 objects exercises the encoding for object ids.
#
pcd.pbs = []
for i in (0...300)
p2 = Test::PCDerived2.new()
p2.pi = i
p2.pbs = [ nil ] # Nil reference. This slice should not have an indirection table.
p2.pcd2 = i
pcd.pbs.push(p2)
end
pcd.pcd2 = pcd.pi
pcd.pcd3 = pcd.pbs[10]
r = t.exchangePBase(pcd)
if t.ice_getEncodingVersion() == Ice::Encoding_1_0
test(!r.is_a?(Test::PCDerived3))
test(r.is_a?(Test::PDerived))
test(r.pi == 3)
else
test(r.is_a?(Test::PCDerived3))
test(r.pi == 3)
for i in (0...300)
p2 = r.pbs[i]
test(p2.is_a?(Test::PCDerived2))
test(p2.pi == i)
test(p2.pbs.length == 1)
test(!p2.pbs[0])
test(p2.pcd2 == i)
end
test(r.pcd2 == r.pi)
test(r.pcd3 == r.pbs[10])
end
#
# Obtain an object with preserved slices and send it back to the server.
# The preserved slices should be excluded for the 1.0 encoding, otherwise
# they should be included.
#
p = t.PBSUnknownAsPreserved()
t.checkPBSUnknown(p)
if t.ice_getEncodingVersion() != Ice::Encoding_1_0
slicedData = p.ice_getSlicedData()
test(slicedData.slices.length == 1)
test(slicedData.slices[0].typeId == "::Test::PSUnknown")
t.ice_encodingVersion(Ice::Encoding_1_0).checkPBSUnknown(p)
else
test(!p.ice_getSlicedData())
end
#
# Relay a graph through the server. This test uses a preserved class
# with a class member.
#
c = Test::PNode.new()
c._next = Test::PNode.new()
c._next._next = Test::PNode.new()
c._next._next._next = c # Create a cyclic graph.
n = t.exchangePNode(c)
test(n._next != nil)
test(n._next != n._next._next)
test(n._next._next != n._next._next._next)
test(n._next._next._next == n)
n = nil # Release reference.
#
# Obtain a preserved object from the server where the most-derived
# type is unknown. The preserved slice refers to a graph of PNode
# objects.
#
p = t.PBSUnknownAsPreservedWithGraph()
test(p)
t.checkPBSUnknownWithGraph(p)
p = nil # Release reference.
#
# Obtain a preserved object from the server where the most-derived
# type is unknown. A data member in the preserved slice refers to the
# outer object, so the chain of references looks like this:
#
# outer->slicedData->outer
#
p = t.PBSUnknown2AsPreservedWithGraph()
test(p != nil)
if t.ice_getEncodingVersion() != Ice::Encoding_1_0
test(p._ice_slicedData != nil)
end
t.checkPBSUnknown2WithGraph(p)
p._ice_slicedData = nil # Break the cycle.
p = nil # Release reference.
puts "ok"
return t
end
|