Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Package Functions | Private Member Functions
TestParams Class Reference

#include <TestParams.h>

Inheritance diagram for TestParams:
Inheritance graph
[legend]
Collaboration diagram for TestParams:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_ITESTPARAMS 
TestParams ()
void testSimpleTypeArrayIn (in unsigned long count,[array, size_is(count)] in octet array)
 Pass in an array of simple type (byte, short, int, float, etc).
void testCharStrTypeArrayIn (in unsigned long count,[array, size_is(count)] in string array)
 Pass in an array of ASCII strings.
void testWCharStrTypeArrayIn (in unsigned long count,[array, size_is(count)] in wstring array)
 Pass in an array of Unicode strings.
void testIIDTypeArrayIn (in unsigned long count,[array, size_is(count)] in nsIIDPtr array)
 Pass in an array of IIDs.
void testIfaceTypeArrayIn (in unsigned long count,[array, size_is(count)] in nsILocalFile array)
 Pass in an array of interface pointers (nsILocalFile in this case).
void testSimpleTypeArrayInOut (in unsigned long count,[array, size_is(count)] inout short array)
 Pass in an array of simple type (byte, short, int, float, etc).
void testCharStrTypeArrayInOut (in unsigned long count,[array, size_is(count)] inout string array)
 Pass in an array of ASCII strings.
void testWCharStrTypeArrayInOut (in unsigned long count,[array, size_is(count)] inout wstring array)
 Pass in an array of Unicode strings.
void testIIDTypeArrayInOut (in unsigned long count,[array, size_is(count)] inout nsIIDPtr array)
 Pass in an array of IIDs.
void testIfaceTypeArrayInOut (in unsigned long count,[array, size_is(count)] inout nsILocalFile array)
 Pass in an array of interface pointers (nsILocalFile in this case).
void testSimpleTypeArrayOut (out unsigned long count,[array, size_is(count)] out char array)
 Pass in an array of simple type (byte, short, int, float, etc).
void testCharStrTypeArrayOut (out unsigned long count,[array, size_is(count)] out string array)
 Pass in an array of ASCII strings.
void testWCharStrTypeArrayOut (out unsigned long count,[array, size_is(count)] out wstring array)
 Pass in an array of Unicode strings.
void testIIDTypeArrayOut (out unsigned long count,[array, size_is(count)] out nsIIDPtr array)
 Pass in an array of IIDs.
void testIfaceTypeArrayOut (out unsigned long count,[array, size_is(count)] out nsILocalFile array)
 Pass in an array of interface pointers (nsILocalFile in this case).
void returnSimpleTypeArray (out unsigned long count,[array, size_is(count), retval] out unsigned long result)
 Returns an array of simple type (byte, short, int, float, etc).
void returnCharStrTypeArray (out unsigned long count,[array, size_is(count), retval] out string result)
 Returns an array of ASCII strings.
void returnWCharStrTypeArray (out unsigned long count,[array, size_is(count), retval] out wstring result)
 Returns an array of Unicode strings.
void returnIIDTypeArray (out unsigned long count,[array, size_is(count), retval] out nsIIDPtr result)
 Returns an array of IIDs.
void returnIfaceTypeArray (out unsigned long count,[array, size_is(count), retval] out nsILocalFile result)
 Returns an array of interface pointers (nsILocalFile in this case).

Static Public Member Functions

static void main (String[] args)

Static Public Attributes

static final String TESTPARAMS_CID = "{3f64f1ad-bbbc-4c2f-88c8-e5b6b67bb0cc}"

Static Package Functions

static void testArrayParams (ITestParams p)
static void testArrayParamsIn (ITestParams p)
static void testArrayParamsOut (ITestParams p)
static void testArrayParamsInOut (ITestParams p)
static void testArrayParamsRetval (ITestParams p)

Private Member Functions

 ~TestParams ()

Detailed Description

Definition at line 46 of file TestParams.h.


Constructor & Destructor Documentation

Definition at line 52 of file TestParams.cpp.

{
  /* member initializers and constructor code */
}
TestParams::~TestParams ( ) [private]

Definition at line 57 of file TestParams.cpp.

{
  /* destructor code */
}

Member Function Documentation

static void TestParams.main ( String[]  args) [inline, static]

Definition at line 47 of file TestParams.java.

  {
    System.loadLibrary("javaxpcom");

    String mozillaPath = System.getProperty("MOZILLA_FIVE_HOME");
    if (mozillaPath == null) {
      throw new RuntimeException("MOZILLA_FIVE_HOME system property not set.");
    }

    File localFile = new File(mozillaPath);
    XPCOM.initXPCOM(localFile, null);

    nsIComponentManager componentManager = XPCOM.getComponentManager();
    ITestParams p = (ITestParams)
      componentManager.createInstance(TESTPARAMS_CID, null,
                                      ITestParams.ITESTPARAMS_IID);
    if (p == null) {
      throw new RuntimeException("Failed to create ITestParams.");
    }

    testArrayParams(p);

    XPCOM.shutdownXPCOM(null);
  }

Here is the call graph for this function:

void ITestParams::returnCharStrTypeArray ( out unsigned long  count,
[array, size_is(count), retval] out string  result 
) [inherited]

Returns an array of ASCII strings.

Here is the caller graph for this function:

void ITestParams::returnIfaceTypeArray ( out unsigned long  count,
[array, size_is(count), retval] out nsILocalFile  result 
) [inherited]

Returns an array of interface pointers (nsILocalFile in this case).

Here is the caller graph for this function:

void ITestParams::returnIIDTypeArray ( out unsigned long  count,
[array, size_is(count), retval] out nsIIDPtr  result 
) [inherited]

Returns an array of IIDs.

Here is the caller graph for this function:

void ITestParams::returnSimpleTypeArray ( out unsigned long  count,
[array, size_is(count), retval] out unsigned long  result 
) [inherited]

Returns an array of simple type (byte, short, int, float, etc).

Here is the caller graph for this function:

void ITestParams::returnWCharStrTypeArray ( out unsigned long  count,
[array, size_is(count), retval] out wstring  result 
) [inherited]

Returns an array of Unicode strings.

Here is the caller graph for this function:

static void TestParams.testArrayParams ( ITestParams  p) [inline, static, package]

Definition at line 72 of file TestParams.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static void TestParams.testArrayParamsIn ( ITestParams  p) [inline, static, package]

Definition at line 80 of file TestParams.java.

  {
    int count = 4;
    short[] byte_array = new short[count];
    for (short i = 0; i < count; i++) {
      byte_array[i] = i;
    }
    p.testSimpleTypeArrayIn(count, byte_array);

    count = 3;
    String[] str_array = new String[count];
    str_array[0] = "three";
    str_array[1] = "two";
    str_array[2] = "one";
    p.testCharStrTypeArrayIn(count, str_array);

    count = 4;
    str_array = new String[count];
    str_array[0] = "foúr";
    str_array[1] = "threë";
    str_array[2] = "twò";
    str_array[3] = "ône";
    p.testWCharStrTypeArrayIn(count, str_array);

    count = 2;
    String[] iid_array = new String[count];
    iid_array[0] = nsISupports.NS_ISUPPORTS_IID;
    iid_array[1] = nsISupportsWeakReference.NS_ISUPPORTSWEAKREFERENCE_IID;
    p.testIIDTypeArrayIn(count, iid_array);

    count = 3;
    nsILocalFile[] iface_array = new nsILocalFile[count];
    iface_array[0] = XPCOM.newLocalFile("/usr/bin", false);
    iface_array[1] = XPCOM.newLocalFile("/var/log", false);
    iface_array[2] = XPCOM.newLocalFile("/home", false);
    p.testIfaceTypeArrayIn(count, iface_array);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static void TestParams.testArrayParamsInOut ( ITestParams  p) [inline, static, package]

Definition at line 152 of file TestParams.java.

  {
    int count = 5;
    short[][] short_array = new short[1][count];
    for (short i = 0; i < count; i++) {
      short_array[0][i] = i;
    }
    p.testSimpleTypeArrayInOut(count, short_array);
    System.out.println("out:");
    for (int i = 0; i < count; i++) {
      System.out.println("[" + i + "]  " + short_array[0][i]);
    }

    count = 3;
    String[][] str_array = new String[1][count];
    str_array[0][0] = "three";
    str_array[0][1] = "two";
    str_array[0][2] = "one";
    p.testCharStrTypeArrayInOut(count, str_array);
    System.out.println("out:");
    for (int i = 0; i < count; i++) {
      System.out.println("[" + i + "]  " + str_array[0][i]);
    }

    count = 4;
    str_array = new String[1][count];
    str_array[0][0] = "foúr";
    str_array[0][1] = "threë";
    str_array[0][2] = "twò";
    str_array[0][3] = "ône";
    p.testWCharStrTypeArrayInOut(count, str_array);
    System.out.println("out:");
    for (int i = 0; i < count; i++) {
      System.out.println("[" + i + "]  " + str_array[0][i]);
    }

    count = 2;
    String[][] iid_array = new String[1][count];
    iid_array[0][0] = nsISupports.NS_ISUPPORTS_IID;
    iid_array[0][1] = nsISupportsWeakReference.NS_ISUPPORTSWEAKREFERENCE_IID;
    p.testIIDTypeArrayInOut(count, iid_array);
    System.out.println("out:");
    for (int i = 0; i < count; i++) {
      System.out.println("[" + i + "]  " + iid_array[0][i]);
    }

    count = 3;
    nsILocalFile[][] iface_array = new nsILocalFile[1][count];
    iface_array[0][0] = XPCOM.newLocalFile("/usr/bin", false);
    iface_array[0][1] = XPCOM.newLocalFile("/var/log", false);
    iface_array[0][2] = XPCOM.newLocalFile("/home", false);
    p.testIfaceTypeArrayInOut(count, iface_array);
    System.out.println("out:");
    for (int i = 0; i < count; i++) {
      System.out.println("[" + i + "]  " + iface_array[0][i].getPath());
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static void TestParams.testArrayParamsOut ( ITestParams  p) [inline, static, package]

Definition at line 118 of file TestParams.java.

  {
    long[] count = new long[1];
    char[][] char_array = new char[1][];
    p.testSimpleTypeArrayOut(count, char_array);
    for (int i = 0; i < count[0]; i++) {
      System.out.println("[" + i + "]  " + char_array[0][i]);
    }

    String[][] str_array = new String[1][];
    p.testCharStrTypeArrayOut(count, str_array);
    for (int i = 0; i < count[0]; i++) {
      System.out.println("[" + i + "]  " + str_array[0][i]);
    }

    str_array = new String[1][];
    p.testWCharStrTypeArrayOut(count, str_array);
    for (int i = 0; i < count[0]; i++) {
      System.out.println("[" + i + "]  " + str_array[0][i]);
    }

    str_array = new String[1][];
    p.testIIDTypeArrayOut(count, str_array);
    for (int i = 0; i < count[0]; i++) {
      System.out.println("[" + i + "]  " + str_array[0][i]);
    }

    nsILocalFile[][] file_array = new nsILocalFile[1][];
    p.testIfaceTypeArrayOut(count, file_array);
    for (int i = 0; i < count[0]; i++) {
      System.out.println("[" + i + "]  " + file_array[0][i].getPath());
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static void TestParams.testArrayParamsRetval ( ITestParams  p) [inline, static, package]

Definition at line 210 of file TestParams.java.

  {
    long[] count = new long[1];
    long[] int_array = p.returnSimpleTypeArray(count);
    for (int i = 0; i < count[0]; i++) {
      System.out.println("[" + i + "]  " + int_array[i]);
    }

    String[] str_array = p.returnCharStrTypeArray(count);
    for (int i = 0; i < count[0]; i++) {
      System.out.println("[" + i + "]  " + str_array[i]);
    }

    str_array = p.returnWCharStrTypeArray(count);
    for (int i = 0; i < count[0]; i++) {
      System.out.println("[" + i + "]  " + str_array[i]);
    }

    str_array = p.returnIIDTypeArray(count);
    for (int i = 0; i < count[0]; i++) {
      System.out.println("[" + i + "]  " + str_array[i]);
    }

    nsILocalFile[] file_array = (nsILocalFile[]) p.returnIfaceTypeArray(count);
    for (int i = 0; i < count[0]; i++) {
      System.out.println("[" + i + "]  " + file_array[i].getPath());
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void ITestParams::testCharStrTypeArrayIn ( in unsigned long  count,
[array, size_is(count)] in string  array 
) [inherited]

Pass in an array of ASCII strings.

Here is the caller graph for this function:

void ITestParams::testCharStrTypeArrayInOut ( in unsigned long  count,
[array, size_is(count)] inout string  array 
) [inherited]

Pass in an array of ASCII strings.

Here is the caller graph for this function:

void ITestParams::testCharStrTypeArrayOut ( out unsigned long  count,
[array, size_is(count)] out string  array 
) [inherited]

Pass in an array of ASCII strings.

Here is the caller graph for this function:

void ITestParams::testIfaceTypeArrayIn ( in unsigned long  count,
[array, size_is(count)] in nsILocalFile  array 
) [inherited]

Pass in an array of interface pointers (nsILocalFile in this case).

Here is the caller graph for this function:

void ITestParams::testIfaceTypeArrayInOut ( in unsigned long  count,
[array, size_is(count)] inout nsILocalFile  array 
) [inherited]

Pass in an array of interface pointers (nsILocalFile in this case).

Here is the caller graph for this function:

void ITestParams::testIfaceTypeArrayOut ( out unsigned long  count,
[array, size_is(count)] out nsILocalFile  array 
) [inherited]

Pass in an array of interface pointers (nsILocalFile in this case).

Here is the caller graph for this function:

void ITestParams::testIIDTypeArrayIn ( in unsigned long  count,
[array, size_is(count)] in nsIIDPtr  array 
) [inherited]

Pass in an array of IIDs.

Here is the caller graph for this function:

void ITestParams::testIIDTypeArrayInOut ( in unsigned long  count,
[array, size_is(count)] inout nsIIDPtr  array 
) [inherited]

Pass in an array of IIDs.

Here is the caller graph for this function:

void ITestParams::testIIDTypeArrayOut ( out unsigned long  count,
[array, size_is(count)] out nsIIDPtr  array 
) [inherited]

Pass in an array of IIDs.

Here is the caller graph for this function:

void ITestParams::testSimpleTypeArrayIn ( in unsigned long  count,
[array, size_is(count)] in octet  array 
) [inherited]

Pass in an array of simple type (byte, short, int, float, etc).

Here is the caller graph for this function:

void ITestParams::testSimpleTypeArrayInOut ( in unsigned long  count,
[array, size_is(count)] inout short  array 
) [inherited]

Pass in an array of simple type (byte, short, int, float, etc).

Here is the caller graph for this function:

void ITestParams::testSimpleTypeArrayOut ( out unsigned long  count,
[array, size_is(count)] out char  array 
) [inherited]

Pass in an array of simple type (byte, short, int, float, etc).

Here is the caller graph for this function:

void ITestParams::testWCharStrTypeArrayIn ( in unsigned long  count,
[array, size_is(count)] in wstring  array 
) [inherited]

Pass in an array of Unicode strings.

Here is the caller graph for this function:

void ITestParams::testWCharStrTypeArrayInOut ( in unsigned long  count,
[array, size_is(count)] inout wstring  array 
) [inherited]

Pass in an array of Unicode strings.

Here is the caller graph for this function:

void ITestParams::testWCharStrTypeArrayOut ( out unsigned long  count,
[array, size_is(count)] out wstring  array 
) [inherited]

Pass in an array of Unicode strings.

Here is the caller graph for this function:


Member Data Documentation

final String TestParams.TESTPARAMS_CID = "{3f64f1ad-bbbc-4c2f-88c8-e5b6b67bb0cc}" [static]

Definition at line 44 of file TestParams.java.


The documentation for this class was generated from the following files: