1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Move failed tests to passing lot.

This commit is contained in:
John Camelon 2005-04-29 01:03:20 +00:00
parent 5e0e6d7eb2
commit 82d7ca2e7a
2 changed files with 73 additions and 74 deletions

View file

@ -558,81 +558,8 @@ public class AST2CPPSpecFailingTest extends AST2SpecBaseTest {
}
}
/**
[--Start Example(CPP 12-1):
struct A { }; // implicitlydeclared A::operator=
struct B : A {
B& operator=(const B &);
};
B& B::operator=(const B& s) {
this->A::operator=(s); // wellformed
return *this;
}
--End Example]
*/
public void test12s1() { // TODO raised bug 90653
StringBuffer buffer = new StringBuffer();
buffer.append("struct A { }; // implicitlydeclared A::operator=\n"); //$NON-NLS-1$
buffer.append("struct B : A {\n"); //$NON-NLS-1$
buffer.append("B& operator=(const B &);\n"); //$NON-NLS-1$
buffer.append("};\n"); //$NON-NLS-1$
buffer.append("B& B::operator=(const B& s) {\n"); //$NON-NLS-1$
buffer.append("this->A::operator=(s); // wellformed\n"); //$NON-NLS-1$
buffer.append("return *this;\n"); //$NON-NLS-1$
buffer.append("}\n"); //$NON-NLS-1$
try {
parse(buffer.toString(), ParserLanguage.CPP, true, 0);
assertTrue(false);
} catch (Exception e) {
}
}
/**
[--Start Example(CPP 12.7-2):
struct A { };
struct B : virtual A { };
struct C : B { };
struct D : virtual A { D(A*); };
struct X { X(A*); };
struct E : C, D, X {
E() : D(this), // undefined: upcast from E* to A*
// might use path E* ® D* ® A*
// but D is not constructed
// D((C*)this), // defined:
// E* -> C* defined because E() has started
// and C* -> A* defined because
// C fully constructed
X(this) //defined: upon construction of X,
// C/B/D/A sublattice is fully constructed
{ }
};
--End Example]
*/
public void test12_7s2() { // TODO raised bug 90664
StringBuffer buffer = new StringBuffer();
buffer.append("struct A { };\n"); //$NON-NLS-1$
buffer.append("struct B : virtual A { };\n"); //$NON-NLS-1$
buffer.append("struct C : B { };\n"); //$NON-NLS-1$
buffer.append("struct D : virtual A { D(A*); };\n"); //$NON-NLS-1$
buffer.append("struct X { X(A*); };\n"); //$NON-NLS-1$
buffer.append("struct E : C, D, X {\n"); //$NON-NLS-1$
buffer.append("E() : D(this), // undefined: upcast from E* to A*\n"); //$NON-NLS-1$
buffer.append("// might use path E* ® D* ® A*\n"); //$NON-NLS-1$
buffer.append("// but D is not constructed\n"); //$NON-NLS-1$
buffer.append("// D((C*)this), // defined:\n"); //$NON-NLS-1$
buffer.append("// E* ® C* defined because E() has started\n"); //$NON-NLS-1$
buffer.append("// and C* ® A* defined because\n"); //$NON-NLS-1$
buffer.append("// C fully constructed\n"); //$NON-NLS-1$
buffer.append("X(this) //defined: upon construction of X,\n"); //$NON-NLS-1$
buffer.append("// C/B/D/A sublattice is fully constructed\n"); //$NON-NLS-1$
buffer.append("{ }\n"); //$NON-NLS-1$
buffer.append("};\n"); //$NON-NLS-1$
try {
parse(buffer.toString(), ParserLanguage.CPP, true, 0);
assertTrue(false);
} catch (Exception e) {
}
}
/**
[--Start Example(CPP 13.4-5a):

View file

@ -11,6 +11,7 @@
package org.eclipse.cdt.core.parser.tests.ast2;
import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.internal.core.parser.ParserException;
/**
* @author dsteffle
@ -11852,4 +11853,75 @@ public class AST2CPPSpecTest extends AST2SpecBaseTest {
buffer.append("}\n"); //$NON-NLS-1$
parse(buffer.toString(), ParserLanguage.CPP, true, 0);
}
/**
[--Start Example(CPP 12-1):
struct A { }; // implicitlydeclared A::operator=
struct B : A {
B& operator=(const B &);
};
B& B::operator=(const B& s) {
this->A::operator=(s); // wellformed
return *this;
}
--End Example]
* @throws ParserException
*/
public void test12s1() throws ParserException {
StringBuffer buffer = new StringBuffer();
buffer.append("struct A { }; // implicitlydeclared A::operator=\n"); //$NON-NLS-1$
buffer.append("struct B : A {\n"); //$NON-NLS-1$
buffer.append("B& operator=(const B &);\n"); //$NON-NLS-1$
buffer.append("};\n"); //$NON-NLS-1$
buffer.append("B& B::operator=(const B& s) {\n"); //$NON-NLS-1$
buffer.append("this->A::operator=(s); // wellformed\n"); //$NON-NLS-1$
buffer.append("return *this;\n"); //$NON-NLS-1$
buffer.append("}\n"); //$NON-NLS-1$
parse(buffer.toString(), ParserLanguage.CPP, true, 0);
}
/**
[--Start Example(CPP 12.7-2):
struct A { };
struct B : virtual A { };
struct C : B { };
struct D : virtual A { D(A*); };
struct X { X(A*); };
struct E : C, D, X {
E() : D(this), // undefined: upcast from E* to A*
// might use path E* ® D* ® A*
// but D is not constructed
// D((C*)this), // defined:
// E* -> C* defined because E() has started
// and C* -> A* defined because
// C fully constructed
X(this) //defined: upon construction of X,
// C/B/D/A sublattice is fully constructed
{ }
};
--End Example]
* @throws ParserException
*/
public void test12_7s2() throws ParserException {
StringBuffer buffer = new StringBuffer();
buffer.append("struct A { };\n"); //$NON-NLS-1$
buffer.append("struct B : virtual A { };\n"); //$NON-NLS-1$
buffer.append("struct C : B { };\n"); //$NON-NLS-1$
buffer.append("struct D : virtual A { D(A*); };\n"); //$NON-NLS-1$
buffer.append("struct X { X(A*); };\n"); //$NON-NLS-1$
buffer.append("struct E : C, D, X {\n"); //$NON-NLS-1$
buffer.append("E() : D(this), // undefined: upcast from E* to A*\n"); //$NON-NLS-1$
buffer.append("// might use path E* ® D* ® A*\n"); //$NON-NLS-1$
buffer.append("// but D is not constructed\n"); //$NON-NLS-1$
buffer.append("// D((C*)this), // defined:\n"); //$NON-NLS-1$
buffer.append("// E* ® C* defined because E() has started\n"); //$NON-NLS-1$
buffer.append("// and C* ® A* defined because\n"); //$NON-NLS-1$
buffer.append("// C fully constructed\n"); //$NON-NLS-1$
buffer.append("X(this) //defined: upon construction of X,\n"); //$NON-NLS-1$
buffer.append("// C/B/D/A sublattice is fully constructed\n"); //$NON-NLS-1$
buffer.append("{ }\n"); //$NON-NLS-1$
buffer.append("};\n"); //$NON-NLS-1$
parse(buffer.toString(), ParserLanguage.CPP, true, 0);
}
}