Using more specific assert functions (e.g. assertEquals(a, b) rather than
assertTrue(a.equals(b)) helps a bit to make the test more readable. It can
also improve the display in the JUnit view, by showing expected and actual
values.
Also, there is no need to manually catch an exception and fail the test. If
an exception is thrown, the test will fail automatically.
Change-Id: I333cfd0d0ade41463dc773ab02e14df4b063a22f
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/38617
Reviewed-by: Alvaro Sanchez-Leon <alvsan09@gmail.com>
Tested-by: Alvaro Sanchez-Leon <alvsan09@gmail.com>
class
The problem was with template base classes as in the unit test.
Accessibility check did not find the proper AccessContext.namingClass
and always ended further up in the class tree.
Change-Id: I447567cabd20ad5c57c05a9ffa5f0f12c5321ccf
Signed-off-by: Michi <woskimi@yahoo.de>
Reviewed-on: https://git.eclipse.org/r/38944
Tested-by: Hudson CI
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
When the nodeSelector detects an IASTNode that has a TemplateId parent
we use that instead of the original. The benefit is that we also get the
template parameters so we can find template specialization matches.
Change-Id: I3751efdb15e868b4aa6688ad338227e0d0c5bcd8
Signed-off-by: Michi <woskimi@yahoo.de>
Reviewed-on: https://git.eclipse.org/r/38923
Tested-by: Hudson CI
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
class
This should work now for AliasTemplates from AST and PDOM.
SourceHover is also affected.
Are there any unit tests for this?
Change-Id: I54a9c2d6cd0851f901b917a57d79616298699299
Signed-off-by: Michi <woskimi@yahoo.de>
Reviewed-on: https://git.eclipse.org/r/38919
Tested-by: Hudson CI
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Change-Id: I1c291fa235fe77910b6bea7ad98f269d8949fc5c
Signed-off-by: Vladimir Prus <vladimir@codesourcery.com>
Reviewed-on: https://git.eclipse.org/r/37475
Tested-by: Hudson CI
a CPPASTQualifiedName that represents some template instance can never
refer to a template of the same type
Change-Id: Iaf9a452e4797fc0e797e5ed5ccaadfb00ff4fb8f
Signed-off-by: Michi <woskimi@yahoo.de>
Reviewed-on: https://git.eclipse.org/r/38730
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
When catching the exception and failing the test manually, we loose the
information about the root cause of the problem. We let the exception
propagate so that JUnit will show a useful trace.
Change-Id: I1df26283f42b58b4dda68ab9e8c11cca27ae81c8
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/38771
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
-gdwarf-2 was added specifically when the default debug format was
stabs, to force using the DWARF format. It is irrelevant nowadays, and
we want to let the compiler choose the DWARF version it prefers.
Change-Id: I300fab09b492704ca3d3a61446b8dd0ce36167c2
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/38766
Tested-by: Hudson CI
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
When executing the launch sequence in testSourceGdbInit, gdb 7.1 inserts
an extraneous \n in one of its replies, causing an assert to be hit.
Since we don't actively support that version, let's just disable the
test.
Change-Id: I9544835ead72e1701766d76fafa0e63f3b88911d
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/38768
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
When catching the exception and failing the test manually, the root cause
exception is hidden. If we let the exception propagate, JUnit will fail
the test automatically, and will provide a detailed stack trace.
Change-Id: Ife099d4598109dd0901b14d482b89545cfd01d68
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/38765
Tested-by: Hudson CI
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
For older GDBs, we don't support resuming the entire process. The tests
in GDBMultiNonStopRunControlTest were trying to resume the entire
process as a shortcut and it was failing for GDB 7.1 and probably older
ones too.
This change loops over all suspended threads of the process and resumes
them individually.
Change-Id: Ie1056aa9775114c3a0d795a49d87d6efe431785d
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/38742
Tested-by: Hudson CI
Over the years GDB is showing more registers than before. When the
GDBPatternMatching tests were first written, some random registers were
used. This update uses registers that are available for both old and
new gdb versions, as well as 32bit and 64bit architectures.
Change-Id: Ibbbd50d240f295e1a745fae217013f21aeabff8a
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/38736
Tested-by: Hudson CI
The following tests fail with gdb 7.0 and 7.1:
- testStopAtMainWithReverse(Restart)?
- testStopAtOtherWithReverse(Restart)?
The reason is that execution crosses getenv() while recording is
enabled. gdb has some trouble with that, and outputs an error such as:
warning: Process record ignores the memory change of instruction at address 0x7ffff7de951f because it can't get the value of the segment register.
warning: Process record ignores the memory change of instruction at address 0x7ffff7de9576 because it can't get the value of the segment register.
Process record doesn't support instruction 0xfef at address 0x7ffff7a9e5e2.
Process record: failed to record execution log.
[process 6993] #1 stopped.
0x00007ffff7a9e5e0 in strlen () from /lib/x86_64-linux-gnu/libc.so.6
We could either make the test "easier" to make it pass on those gdb
versions, or disable it for those gdb versions. By "easier", I mean just
execute some simple arithmetic instead of some calls to libc.
I think it is counter-productive to reduce the span of the tests just to
make some old gdb versions happy, so I chose to disable it for those.
Actually, the best would be to write a new test which covers less but
passes for all versions.
Change-Id: I98499fbb5c099232bc39dad3906d7348912b89af
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/38735
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Hudson CI
gdb only started reporting thread names at version 7.3. On Windows, they
are never reported.
If somebody wants to enhance the check for MAC OS X, feel free to do it!
Change-Id: I9d028b24930b632678941682da65cd51da9e88dd
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/38728
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
When a breakpoint is set directly at the start of a function, and you step
into that function, gdb <= 7.3 will generate a "stopped" event with two
reason fields. The first to indicate that the step range ended and the
other to indicate that a breakpoint was hit. While this is not really
correct from gdb to include the same field twice in a single event,
the implementation of MIRunControlEventProcessor_7_0 will generate two
distinct MIStoppedEvent events. This confuses the step-into-selection
mechanism, who will issue two finish/step-return instead of one.
For all gdbs, we will have a test where the breakpoint is a not at the
function entry.
Then, for gdb > 7.3, we will have the same test but with the breakpoint
at the function entry, to test that particular case. This case is known
to be broken with gdb <= 7.3 (rather old) and will stay that way unless
somebody feels like fixing it.
So, for both:
- atDoubleMethodStopAtBreakpoint
- atDoubleMethodSkipBreakpoint
I extracted the code in a common function which takes in parameter the
line to set the breakpoint at.
Change-Id: I2ae4bc527afe0ab195e9b066279ed92f74d652f3
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/38717
Tested-by: Hudson CI
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>