1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-07 16:26:11 +02:00

Added allIncludedBy test from cdt_3_1.

This commit is contained in:
Doug Schaefer 2006-09-05 20:23:28 +00:00
parent 001c458e92
commit b4c6a27239
13 changed files with 161 additions and 0 deletions

View file

@ -0,0 +1,43 @@
/*******************************************************************************
* Copyright (c) 2006 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* QNX - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.pdom.tests;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.internal.core.pdom.PDOM;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMFile;
import org.eclipse.core.runtime.IPath;
/**
* @author Doug Schaefer
*
*/
public class IncludesTests extends PDOMTestBase {
protected ICProject project;
protected void setUp() throws Exception {
project = createProject("includesTests");
}
public void test1() throws Exception {
PDOM pdom = (PDOM) CCorePlugin.getPDOMManager().getPDOM(project);
IPath loc = project.getProject().getLocation().append("I2.h");
PDOMFile file = pdom.getFile(loc.toOSString());
assertNotNull(file);
PDOMFile[] allIncludedBy = file.getAllIncludedBy();
assertEquals(9, allIncludedBy.length); // i.e. all of them
}
}

View file

@ -74,6 +74,7 @@ public class PDOMTestBase extends TestCase {
return IOverwriteQuery.ALL; return IOverwriteQuery.ALL;
} }
}); });
importOp.setCreateContainerStructure(false);
try { try {
importOp.run(monitor); importOp.run(monitor);
} catch (Exception e) { } catch (Exception e) {

View file

@ -0,0 +1,21 @@
namespace pr147903 {
class testRef
{
};
class test3 {
public:
void foo(testRef[]);
void bar(testRef*);
};
void (* aFPtr)(testRef[]);
void (* aFPtr1)(testRef*);
namespace n {
extern void (* aFPtr1)(testRef[]);
};
}

View file

@ -0,0 +1,6 @@
#include "I1.h"
I1::I1()
{}
I1::~I1()
{}

View file

@ -0,0 +1,13 @@
#ifndef I1_H
#define I1_H
#include "I2.h"
class I1{
public:
I1();
~I1();
};
#endif // I1_H

View file

@ -0,0 +1,6 @@
#include "I2.h"
I2::I2()
{}
I2::~I2()
{}

View file

@ -0,0 +1,14 @@
#ifndef I2_H
#define I2_H
//#include "I3.h"
class I2{
public:
I2();
~I2();
};
#endif // I2_H

View file

@ -0,0 +1,6 @@
#include "I3.h"
I3::I3()
{}
I3::~I3()
{}

View file

@ -0,0 +1,13 @@
#ifndef I3_H
#define I3_H
#include "I4.h"
class I3{
public:
I3();
~I3();
};
#endif // I3_H

View file

@ -0,0 +1,6 @@
#include "I4.h"
I4::I4()
{}
I4::~I4()
{}

View file

@ -0,0 +1,13 @@
#ifndef I4_H
#define I4_H
#include "I5.h"
class I4{
public:
I4();
~I4();
};
#endif // I4_H

View file

@ -0,0 +1,6 @@
#include "I5.h"
I5::I5()
{}
I5::~I5()
{}

View file

@ -0,0 +1,13 @@
#ifndef I5_H
#define I5_H
#include "I1.h"
class I5{
public:
I5();
~I5();
};
#endif // I5_H