t4018: test cases for the built-in cpp pattern
A later patch changes the built-in cpp pattern. These test cases demonstrate aspects of the pattern that we do not want to change. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
ad5070fb36
commit
02907a08cc
4
t/t4018/cpp-c++-function
Normal file
4
t/t4018/cpp-c++-function
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Item RIGHT::DoSomething( Args with_spaces )
|
||||||
|
{
|
||||||
|
ChangeMe;
|
||||||
|
}
|
4
t/t4018/cpp-class-definition
Normal file
4
t/t4018/cpp-class-definition
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
class RIGHT
|
||||||
|
{
|
||||||
|
int ChangeMe;
|
||||||
|
};
|
5
t/t4018/cpp-class-definition-derived
Normal file
5
t/t4018/cpp-class-definition-derived
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class RIGHT :
|
||||||
|
public Baseclass
|
||||||
|
{
|
||||||
|
int ChangeMe;
|
||||||
|
};
|
4
t/t4018/cpp-function-returning-pointer
Normal file
4
t/t4018/cpp-function-returning-pointer
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
const char *get_it_RIGHT(char *ptr)
|
||||||
|
{
|
||||||
|
ChangeMe;
|
||||||
|
}
|
8
t/t4018/cpp-skip-access-specifiers
Normal file
8
t/t4018/cpp-skip-access-specifiers
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
class RIGHT : public Baseclass
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
void DoSomething();
|
||||||
|
int ChangeMe;
|
||||||
|
};
|
9
t/t4018/cpp-skip-comment-block
Normal file
9
t/t4018/cpp-skip-comment-block
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
struct item RIGHT(int i)
|
||||||
|
// Do not
|
||||||
|
// pick up
|
||||||
|
/* these
|
||||||
|
** comments.
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
ChangeMe;
|
||||||
|
}
|
8
t/t4018/cpp-skip-labels
Normal file
8
t/t4018/cpp-skip-labels
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
void RIGHT (void)
|
||||||
|
{
|
||||||
|
repeat: // C++ comment
|
||||||
|
next: /* C comment */
|
||||||
|
do_something();
|
||||||
|
|
||||||
|
ChangeMe;
|
||||||
|
}
|
9
t/t4018/cpp-struct-definition
Normal file
9
t/t4018/cpp-struct-definition
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
struct RIGHT {
|
||||||
|
unsigned
|
||||||
|
/* this bit field looks like a label and should not be picked up */
|
||||||
|
decoy_bitfield: 2,
|
||||||
|
more : 1;
|
||||||
|
int filler;
|
||||||
|
|
||||||
|
int ChangeMe;
|
||||||
|
};
|
4
t/t4018/cpp-void-c-function
Normal file
4
t/t4018/cpp-void-c-function
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
void RIGHT (void)
|
||||||
|
{
|
||||||
|
ChangeMe;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user