Git fork

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>

authored by

Johannes Sixt and committed by
Junio C Hamano
02907a08 ad5070fb

+55
+4
t/t4018/cpp-c++-function
··· 1 + Item RIGHT::DoSomething( Args with_spaces ) 2 + { 3 + ChangeMe; 4 + }
+4
t/t4018/cpp-class-definition
··· 1 + class RIGHT 2 + { 3 + int ChangeMe; 4 + };
+5
t/t4018/cpp-class-definition-derived
··· 1 + class RIGHT : 2 + public Baseclass 3 + { 4 + int ChangeMe; 5 + };
+4
t/t4018/cpp-function-returning-pointer
··· 1 + const char *get_it_RIGHT(char *ptr) 2 + { 3 + ChangeMe; 4 + }
+8
t/t4018/cpp-skip-access-specifiers
··· 1 + class RIGHT : public Baseclass 2 + { 3 + public: 4 + protected: 5 + private: 6 + void DoSomething(); 7 + int ChangeMe; 8 + };
+9
t/t4018/cpp-skip-comment-block
··· 1 + struct item RIGHT(int i) 2 + // Do not 3 + // pick up 4 + /* these 5 + ** comments. 6 + */ 7 + { 8 + ChangeMe; 9 + }
+8
t/t4018/cpp-skip-labels
··· 1 + void RIGHT (void) 2 + { 3 + repeat: // C++ comment 4 + next: /* C comment */ 5 + do_something(); 6 + 7 + ChangeMe; 8 + }
+9
t/t4018/cpp-struct-definition
··· 1 + struct RIGHT { 2 + unsigned 3 + /* this bit field looks like a label and should not be picked up */ 4 + decoy_bitfield: 2, 5 + more : 1; 6 + int filler; 7 + 8 + int ChangeMe; 9 + };
+4
t/t4018/cpp-void-c-function
··· 1 + void RIGHT (void) 2 + { 3 + ChangeMe; 4 + }