Bug 431965: checking in tests forgotten before (r/a=bsmedberg from bug 420933)

This commit is contained in:
David Mandelin 2008-05-05 10:24:13 -07:00
parent dbe96cfe58
commit a326cd2356
21 changed files with 240 additions and 0 deletions

View File

@ -0,0 +1,9 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
nsresult foo(__attribute__((user("outparam"))) int *a) {
int k = 0;
return k;
}

View File

@ -0,0 +1,13 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
typedef short PRUnichar;
nsresult bar(nsACString &a);
nsresult baz();
nsresult foo(nsACString &a) {
bar(a);
return baz();
}

View File

@ -0,0 +1,11 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
typedef short PRUnichar;
nsresult bar(PRUnichar **a, int q);
nsresult foo(PRUnichar **a) {
return bar(a, 0);
}

View File

@ -0,0 +1,9 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
nsresult foo(__attribute__((user("outparam"))) int *a) {
*a = 9;
return 1;
}

View File

@ -0,0 +1,9 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
nsresult foo(__attribute__((user("outparam"))) int *a) {
*a = 0;
return 1;
}

View File

@ -0,0 +1,11 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
nsresult bar(int *a);
nsresult foo(__attribute__((user("outparam"))) int *a) {
bar(a);
return 0;
}

View File

@ -0,0 +1,9 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
nsresult foo(__attribute__((user("inoutparam"))) int *a) {
*a = 9;
return 1;
}

View File

@ -0,0 +1,14 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
class A {
};
nsresult bar(__attribute__((user("outparam"))) void **a);
nsresult foo(__attribute__((user("outparam"))) A **a) {
nsresult rv = bar((void **) a);
return 1;
}

View File

@ -0,0 +1,11 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
nsresult bar(char **a, int q);
nsresult foo(char **a) {
bar(a, 0);
return 0;
}

View File

@ -0,0 +1,8 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
nsresult foo(char **a) {
return 0;
}

View File

@ -0,0 +1,9 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
typedef short PRUnichar;
nsresult foo(PRUnichar **a) {
return 0;
}

View File

@ -0,0 +1,9 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
nsresult foo(__attribute__((user("outparam"))) int *a) {
*a = 1;
return 0;
}

View File

@ -0,0 +1,22 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
typedef short PRUnichar;
class nsAString {
public:
void Read() const;
void Mutate();
};
nsresult bar();
nsresult foo(nsAString &s) {
nsresult rv = bar();
s.Read();
if (rv == 0) {
s.Mutate();
}
return rv;
}

View File

@ -0,0 +1,15 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
int x;
nsresult foo(__attribute__((user("outparam"))) int *a) {
if (x) {
*a = 1;
return 0;
} else {
return 1;
}
}

View File

@ -0,0 +1,13 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
nsresult foo(__attribute__((user("outparam"))) int *a) {
int x;
if (x == 0) {
*a = 1;
}
return x;
}

View File

@ -0,0 +1,21 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
nsresult bar(__attribute__((user("outparam"))) int q);
inline int NS_FAILED(nsresult _nsresult) {
return _nsresult & 0x80000000;
}
inline int NS_SUCCEEDED(nsresult _nsresult) {
return !(_nsresult & 0x80000000);
}
nsresult foo(__attribute__((user("outparam"))) int *a) {
nsresult rv = bar(4);
if (NS_FAILED(rv)) return rv;
*a = 1;
return 0;
}

View File

@ -0,0 +1,11 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
nsresult bar(__attribute__((user("outparam"))) int *a);
nsresult foo(__attribute__((user("outparam"))) int *a) {
int rv = bar(a);
return rv;
}

View File

@ -0,0 +1,11 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
nsresult foo(__attribute__((user("outparam"))) int *a) {
if (a) {
*a = 1;
}
return 0;
}

View File

@ -0,0 +1,8 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
nsresult foo(__attribute__((user("inoutparam"))) int *a) {
return 0;
}

View File

@ -0,0 +1,8 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
nsresult foo(char *a) {
return 0;
}

View File

@ -0,0 +1,9 @@
typedef int PRUint32;
typedef int PRInt32;
typedef PRUint32 nsresult;
typedef short PRUnichar;
nsresult foo(PRUnichar *a) {
return 0;
}