Skip to content

Commit

Permalink
t4018: test cases for the built-in cpp pattern
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Sixt authored and Junio C Hamano committed Mar 21, 2014
1 parent ad5070f commit 02907a0
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 0 deletions.
4 changes: 4 additions & 0 deletions t/t4018/cpp-c++-function
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Item RIGHT::DoSomething( Args with_spaces )
{
ChangeMe;
}
4 changes: 4 additions & 0 deletions t/t4018/cpp-class-definition
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class RIGHT
{
int ChangeMe;
};
5 changes: 5 additions & 0 deletions t/t4018/cpp-class-definition-derived
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RIGHT :
public Baseclass
{
int ChangeMe;
};
4 changes: 4 additions & 0 deletions t/t4018/cpp-function-returning-pointer
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const char *get_it_RIGHT(char *ptr)
{
ChangeMe;
}
8 changes: 8 additions & 0 deletions t/t4018/cpp-skip-access-specifiers
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class RIGHT : public Baseclass
{
public:
protected:
private:
void DoSomething();
int ChangeMe;
};
9 changes: 9 additions & 0 deletions t/t4018/cpp-skip-comment-block
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
struct item RIGHT(int i)
// Do not
// pick up
/* these
** comments.
*/
{
ChangeMe;
}
8 changes: 8 additions & 0 deletions t/t4018/cpp-skip-labels
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
void RIGHT (void)
{
repeat: // C++ comment
next: /* C comment */
do_something();

ChangeMe;
}
9 changes: 9 additions & 0 deletions t/t4018/cpp-struct-definition
Original file line number Diff line number Diff line change
@@ -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 changes: 4 additions & 0 deletions t/t4018/cpp-void-c-function
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
void RIGHT (void)
{
ChangeMe;
}

0 comments on commit 02907a0

Please sign in to comment.