mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 431965: checking in tests forgotten before (r/a=bsmedberg from bug 420933)
This commit is contained in:
parent
dbe96cfe58
commit
a326cd2356
9
xpcom/tests/static-checker/e1.cpp
Normal file
9
xpcom/tests/static-checker/e1.cpp
Normal 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;
|
||||
}
|
13
xpcom/tests/static-checker/e10.cpp
Normal file
13
xpcom/tests/static-checker/e10.cpp
Normal 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();
|
||||
}
|
11
xpcom/tests/static-checker/e11.cpp
Normal file
11
xpcom/tests/static-checker/e11.cpp
Normal 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);
|
||||
}
|
9
xpcom/tests/static-checker/e2.cpp
Normal file
9
xpcom/tests/static-checker/e2.cpp
Normal 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;
|
||||
}
|
9
xpcom/tests/static-checker/e3.cpp
Normal file
9
xpcom/tests/static-checker/e3.cpp
Normal 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;
|
||||
}
|
11
xpcom/tests/static-checker/e4.cpp
Normal file
11
xpcom/tests/static-checker/e4.cpp
Normal 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;
|
||||
}
|
9
xpcom/tests/static-checker/e5.cpp
Normal file
9
xpcom/tests/static-checker/e5.cpp
Normal 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;
|
||||
}
|
14
xpcom/tests/static-checker/e6.cpp
Normal file
14
xpcom/tests/static-checker/e6.cpp
Normal 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;
|
||||
}
|
11
xpcom/tests/static-checker/e7.cpp
Normal file
11
xpcom/tests/static-checker/e7.cpp
Normal 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;
|
||||
}
|
8
xpcom/tests/static-checker/e8.cpp
Normal file
8
xpcom/tests/static-checker/e8.cpp
Normal file
@ -0,0 +1,8 @@
|
||||
typedef int PRUint32;
|
||||
typedef int PRInt32;
|
||||
|
||||
typedef PRUint32 nsresult;
|
||||
|
||||
nsresult foo(char **a) {
|
||||
return 0;
|
||||
}
|
9
xpcom/tests/static-checker/e9.cpp
Normal file
9
xpcom/tests/static-checker/e9.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
typedef int PRUint32;
|
||||
typedef int PRInt32;
|
||||
|
||||
typedef PRUint32 nsresult;
|
||||
typedef short PRUnichar;
|
||||
|
||||
nsresult foo(PRUnichar **a) {
|
||||
return 0;
|
||||
}
|
9
xpcom/tests/static-checker/o1.cpp
Normal file
9
xpcom/tests/static-checker/o1.cpp
Normal 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;
|
||||
}
|
22
xpcom/tests/static-checker/o10.cpp
Normal file
22
xpcom/tests/static-checker/o10.cpp
Normal 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;
|
||||
}
|
15
xpcom/tests/static-checker/o2.cpp
Normal file
15
xpcom/tests/static-checker/o2.cpp
Normal 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;
|
||||
}
|
||||
}
|
13
xpcom/tests/static-checker/o3.cpp
Normal file
13
xpcom/tests/static-checker/o3.cpp
Normal 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;
|
||||
}
|
21
xpcom/tests/static-checker/o4.cpp
Normal file
21
xpcom/tests/static-checker/o4.cpp
Normal 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;
|
||||
}
|
11
xpcom/tests/static-checker/o5.cpp
Normal file
11
xpcom/tests/static-checker/o5.cpp
Normal 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;
|
||||
}
|
11
xpcom/tests/static-checker/o6.cpp
Normal file
11
xpcom/tests/static-checker/o6.cpp
Normal 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;
|
||||
}
|
8
xpcom/tests/static-checker/o7.cpp
Normal file
8
xpcom/tests/static-checker/o7.cpp
Normal file
@ -0,0 +1,8 @@
|
||||
typedef int PRUint32;
|
||||
typedef int PRInt32;
|
||||
|
||||
typedef PRUint32 nsresult;
|
||||
|
||||
nsresult foo(__attribute__((user("inoutparam"))) int *a) {
|
||||
return 0;
|
||||
}
|
8
xpcom/tests/static-checker/o8.cpp
Normal file
8
xpcom/tests/static-checker/o8.cpp
Normal file
@ -0,0 +1,8 @@
|
||||
typedef int PRUint32;
|
||||
typedef int PRInt32;
|
||||
|
||||
typedef PRUint32 nsresult;
|
||||
|
||||
nsresult foo(char *a) {
|
||||
return 0;
|
||||
}
|
9
xpcom/tests/static-checker/o9.cpp
Normal file
9
xpcom/tests/static-checker/o9.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
typedef int PRUint32;
|
||||
typedef int PRInt32;
|
||||
|
||||
typedef PRUint32 nsresult;
|
||||
typedef short PRUnichar;
|
||||
|
||||
nsresult foo(PRUnichar *a) {
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user