~jbicha/ubuntu/oneiric/gjs/1.29.18

« back to all changes in this revision

Viewing changes to test/js/testGIMarshalling.js

  • Committer: Bazaar Package Importer
  • Author(s): Micah Gersten
  • Date: 2010-08-12 00:22:06 UTC
  • mfrom: (1.3.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100812002206-zc5bfuqte3of6j2t
Tags: 0.7.1-1ubuntu1
* Merge from debian unstable. (LP: #616598)  Remaining changes:
  + debian/control: 
    - Add Ubuntu VCS info
    - Drop libmozjs Build-Depends; Ubuntu does not have this library.
    - Drop chrpath Build-Depends; we need to keep the RPATH because libmozjs
      is not a system library in Ubuntu.
    - Add xulrunner{,-dev}:Depends to binary packages
    - Bump xulrunner-dev build depends to 1.9.2
    - Build-depend on unversioned automake
  + debian/rules:
    - Generate strict dependencies on xulrunner.
    - Apply patch to fix libtool's handling of --as-needed
    - Add -Wl,--as-needed to LDFLAGS
  + debian/libgjs0a.lintian-overrides:
    - Override the entire rpath tag, not just for the specific libraries.
      The full lintian warning will change with each xulrunner version.
  + debian/ltmain-add-as-needed.patch
    - Fix libtool's ordering of --as-needed argument.
  + add debian/patches/01_disable_memcheck.patch
    - Don't make leaks fatal, see b.g.o #616193
  + add debian/patches/02_gobject_introspection.patch:
    - Use gobject-introspection 0.9
* Add debian/patches/03_libmozjs_private.patch (originally in 0.5-1ubuntu1)
  - Move @JS_PACKAGE@ libmozjs to Requires.private to prevent applications
    unnecessarily linking with libmozjs

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
const GIMarshallingTests = imports.gi.GIMarshallingTests;
 
2
 
 
3
// We use Gio to have some objects that we know exist
 
4
const Gio = imports.gi.Gio;
 
5
const Lang = imports.lang;
 
6
 
 
7
function testGArray() {
 
8
    var array;
 
9
    // Tests disabled due to do g-i typelib compilation bug
 
10
    // https://bugzilla.gnome.org/show_bug.cgi?id=622335
 
11
    //array = GIMarshallingTests.garray_int_none_return();
 
12
    //assertEquals(-1, array[0]);
 
13
    //assertEquals(0, array[1]);
 
14
    //assertEquals(1, array[2]);
 
15
    //assertEquals(2, array[3]);
 
16
    array = GIMarshallingTests.garray_utf8_none_return()
 
17
    assertEquals("0", array[0]);
 
18
    assertEquals("1", array[1]);
 
19
    assertEquals("2", array[2]);
 
20
    array = GIMarshallingTests.garray_utf8_container_return()
 
21
    assertEquals("0", array[0]);
 
22
    assertEquals("1", array[1]);
 
23
    assertEquals("2", array[2]);
 
24
    array = GIMarshallingTests.garray_utf8_full_return()
 
25
    assertEquals("0", array[0]);
 
26
    assertEquals("1", array[1]);
 
27
    assertEquals("2", array[2]);
 
28
 
 
29
    // GIMarshallingTests.garray_int_none_in([-1, 0, 1, 2])
 
30
    // GIMarshallingTests.garray_utf8_none_in(["0", "1", "2"])
 
31
 
 
32
    array = GIMarshallingTests.garray_utf8_none_out()
 
33
    assertEquals("0", array[0]);
 
34
    assertEquals("1", array[1]);
 
35
    assertEquals("2", array[2]);
 
36
    array = GIMarshallingTests.garray_utf8_container_out()
 
37
    assertEquals("0", array[0]);
 
38
    assertEquals("1", array[1]);
 
39
    assertEquals("2", array[2]);
 
40
    array = GIMarshallingTests.garray_utf8_full_out()
 
41
    assertEquals("0", array[0]);
 
42
    assertEquals("1", array[1]);
 
43
    assertEquals("2", array[2]);
 
44
}
 
45
 
 
46
function testByteArray() {
 
47
    var byteArray = GIMarshallingTests.bytearray_full_return();
 
48
    assertEquals("arrayLength", 4, byteArray.length);
 
49
    assertEquals("a[0]", '0'.charCodeAt(0), byteArray[0]);
 
50
    assertEquals("a[1]", '1'.charCodeAt(0), byteArray[1])
 
51
    assertEquals("a[2]", '2'.charCodeAt(0), byteArray[2]);
 
52
    assertEquals("a[3]", '3'.charCodeAt(0), byteArray[3]);
 
53
    let ba = imports.byteArray.fromString("0123");
 
54
    GIMarshallingTests.bytearray_none_in(ba);
 
55
}
 
56
 
 
57
gjstestRun();