Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
callstack.core: Add test for CallStackSeries contains methods
[Modified] Add tests for contains method in CallStackSegmentStoreTest Signed-off-by: Arnaud Fiorini <fiorini.arnaud@gmail.com> Change-Id: I60300d6add67700b0a2194c2cf7c81fed73d4ebd Reviewed-on: https://git.eclipse.org/r/c/tracecompass/org.eclipse.tracecompass/+/202561 Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org> Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
- Loading branch information
Showing
2 changed files
with
149 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
...tubs/org/eclipse/tracecompass/analysis/callstack/core/tests/stubs/CalledFunctionStub.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 École Polytechnique de Montréal | ||
* | ||
* All rights reserved. This program and the accompanying materials are | ||
* made available under the terms of the Eclipse Public License 2.0 which | ||
* accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*******************************************************************************/ | ||
|
||
package org.eclipse.tracecompass.analysis.callstack.core.tests.stubs; | ||
|
||
import org.eclipse.jdt.annotation.Nullable; | ||
import org.eclipse.tracecompass.internal.analysis.callstack.core.callgraph.ICalledFunction; | ||
|
||
/** | ||
* A Stub for the CalledFunction segment. | ||
* | ||
* @author Arnaud Fiorini | ||
*/ | ||
public class CalledFunctionStub implements ICalledFunction { | ||
|
||
private static final long serialVersionUID = 1L; | ||
private final long fStart; | ||
private final long fEnd; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param start | ||
* The start of the segment | ||
* @param end | ||
* The end of the segment | ||
*/ | ||
public CalledFunctionStub(long start, long end) { | ||
fStart = start; | ||
fEnd = end; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return ""; | ||
} | ||
|
||
@Override | ||
public long getStart() { | ||
return fStart; | ||
} | ||
|
||
@Override | ||
public long getEnd() { | ||
return fEnd; | ||
} | ||
|
||
@Override | ||
public Object getSymbol() { | ||
return ""; | ||
} | ||
|
||
@Override | ||
public @Nullable ICalledFunction getParent() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public long getSelfTime() { | ||
return fEnd - fStart; | ||
} | ||
|
||
@Override | ||
public long getCpuTime() { | ||
return fEnd - fStart; | ||
} | ||
|
||
@Override | ||
public int getProcessId() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public int getThreadId() { | ||
return 0; | ||
} | ||
} |