~ubuntu-branches/ubuntu/oneiric/swig1.3/oneiric

« back to all changes in this revision

Viewing changes to Examples/test-suite/ruby/anonymous_bitfield_runme.rb

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-12-06 10:27:08 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20071206102708-t37t62i45n595w0e
Tags: 1.3.33-2ubuntu1
* Merge with Debian; remaining changes:
  - Drop support for pike.
  - Use python2.5 instead of python2.4.
  - Clean Runtime/ as well.
  - Force a few environment variables.
* debian/Rules (clean): Remove Lib/ocaml/swigp4.ml.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env ruby
 
2
#
 
3
# Put script description here.
 
4
#
 
5
 
6
 
7
 
8
#
 
9
 
 
10
require 'swig_assert'
 
11
require 'anonymous_bitfield'
 
12
 
 
13
include Anonymous_bitfield
 
14
 
 
15
foo = Foo.new
 
16
 
 
17
{'x' => 4,
 
18
  'y' => 3,
 
19
  'f' => 1,
 
20
  'z' => 8,
 
21
  'seq' => 3 }.each do |m, v|
 
22
  foo.send("#{m}=", v)
 
23
  val = foo.send(m)
 
24
  swig_assert("val == v", binding)
 
25
end
 
26
 
 
27
{'x' => (1 << 4),
 
28
  'y' => (1 << 4),
 
29
  'f' => (1 << 1),
 
30
  'z' => (1 << 16),
 
31
  'seq' => (1 << (4*8-6)) }.each do |m, v|
 
32
  foo.send("#{m}=", v)
 
33
  val = foo.send(m)
 
34
  swig_assert("val != v", binding)
 
35
end