git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Brandon Casey <drafnel@gmail.com>
Cc: gitster@pobox.com, git@vger.kernel.org, peff@peff.net,
	jrnieder@gmail.com, trast@student.ethz.ch
Subject: Re: [PATCH v2] t4018: introduce test cases for the internal hunk header patterns
Date: Tue, 20 Dec 2011 20:52:33 +0100	[thread overview]
Message-ID: <4EF0E781.4060506@kdbg.org> (raw)
In-Reply-To: <1324348939-27115-1-git-send-email-drafnel@gmail.com>

Am 20.12.2011 03:42, schrieb Brandon Casey:
> +int WRONG_global_variable;

Personally, I'm not a fan of this one. IMHO, global variable
definitions need not be ignored. (But I can live with it.)

But here are some more tests that I care about and that you can squash in.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/t4018/broken_class_constructor.cpp               |    3 +-
 t/t4018/broken_return_type_in_global_namespace.cpp |   16 ++++++++++++++
 t/t4018/class_definition.cpp                       |   19 +++++++++++++++++
 t/t4018/derived_class_definition.cpp               |   20 ++++++++++++++++++
 t/t4018/ignore_access_specifier.cpp                |   22 ++++++++++++++++++++
 5 files changed, 79 insertions(+), 1 deletions(-)
 create mode 100644 t/t4018/broken_return_type_in_global_namespace.cpp
 create mode 100644 t/t4018/class_definition.cpp
 create mode 100644 t/t4018/derived_class_definition.cpp
 create mode 100644 t/t4018/ignore_access_specifier.cpp

diff --git a/t/t4018/broken_class_constructor.cpp b/t/t4018/broken_class_constructor.cpp
index 774c7f9..28c1bc8 100644
--- a/t/t4018/broken_class_constructor.cpp
+++ b/t/t4018/broken_class_constructor.cpp
@@ -3,7 +3,8 @@ int WRONG_function_hunk_header_preceding_the_right_one (void)
 	return 0;
 }
 
-RIGHT_function_hunk_header::RIGHT_function_hunk_header (void)
+RIGHT_function_hunk_header::RIGHT_function_hunk_header (int x) :
+	WRONG_member_initializer(x)
 {
 	const char *msg = "ChangeMe";
 	printf("Hello, world, %s\n", msg);
diff --git a/t/t4018/broken_return_type_in_global_namespace.cpp b/t/t4018/broken_return_type_in_global_namespace.cpp
new file mode 100644
index 0000000..da9931b
--- /dev/null
+++ b/t/t4018/broken_return_type_in_global_namespace.cpp
@@ -0,0 +1,16 @@
+int WRONG_function_hunk_header_preceding_the_right_one (void)
+{
+	return 0;
+}
+
+::TypeInGlobalNamespace RIGHT_function_hunk_header()
+{
+	const char *msg = "ChangeMe";
+	printf("Hello, world, %s\n", msg);
+	return 0;
+}
+
+int WRONG_function_hunk_header_following_the_right_one (void)
+{
+	return 0;
+}
diff --git a/t/t4018/class_definition.cpp b/t/t4018/class_definition.cpp
new file mode 100644
index 0000000..fc3df34
--- /dev/null
+++ b/t/t4018/class_definition.cpp
@@ -0,0 +1,19 @@
+int WRONG_function_hunk_header_preceding_the_right_one (void)
+{
+	return 0;
+}
+
+class RIGHT_class_name
+{
+	void WRONG_function_name_following_the_right_one()
+	{
+		const char *msg = "ChangeMe";
+		printf("Hello, world, %s\n", msg);
+		return 0;
+	}
+}
+
+int WRONG_function_hunk_header_following_the_right_one (void)
+{
+	return 0;
+}
diff --git a/t/t4018/derived_class_definition.cpp b/t/t4018/derived_class_definition.cpp
new file mode 100644
index 0000000..b8501a5
--- /dev/null
+++ b/t/t4018/derived_class_definition.cpp
@@ -0,0 +1,20 @@
+int WRONG_function_hunk_header_preceding_the_right_one (void)
+{
+	return 0;
+}
+
+class RIGHT_class_name :
+	public WRONG_class_name_following_the_right_one
+{
+	void WRONG_function_name_following_the_right_one()
+	{
+		const char *msg = "ChangeMe";
+		printf("Hello, world, %s\n", msg);
+		return 0;
+	}
+}
+
+int WRONG_function_hunk_header_following_the_right_one (void)
+{
+	return 0;
+}
diff --git a/t/t4018/ignore_access_specifier.cpp b/t/t4018/ignore_access_specifier.cpp
new file mode 100644
index 0000000..d865040
--- /dev/null
+++ b/t/t4018/ignore_access_specifier.cpp
@@ -0,0 +1,22 @@
+int WRONG_function_hunk_header_preceding_the_right_one (void)
+{
+	return 0;
+}
+
+class RIGHT_class_name
+{
+public:
+protected:
+private:
+	void WRONG_function_name_following_the_right_one()
+	{
+		const char *msg = "ChangeMe";
+		printf("Hello, world, %s\n", msg);
+		return 0;
+	}
+}
+
+int WRONG_function_hunk_header_following_the_right_one (void)
+{
+	return 0;
+}
-- 
1.7.8.216.g2e426

  parent reply	other threads:[~2011-12-20 19:52 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-16 11:00 [PATCH] attr: map builtin userdiff drivers to well-known extensions Jeff King
2011-12-16 14:00 ` Johannes Sixt
2011-12-16 17:01   ` Junio C Hamano
2011-12-16 19:21   ` Jeff King
2011-12-16 19:30     ` Jeff King
2011-12-16 19:33     ` Junio C Hamano
2011-12-17  1:17       ` Jeff King
2011-12-16 22:05     ` Johannes Sixt
2011-12-17  1:21       ` Jeff King
2011-12-17  3:38         ` Jonathan Nieder
2011-12-19 15:49           ` [PATCHv2 1/2] " Jeff King
2011-12-19 18:07             ` Jonathan Nieder
2011-12-19 18:55               ` Jeff King
2011-12-22  1:47             ` Ævar Arnfjörð Bjarmason
2011-12-19 15:57           ` [PATCHv2 2/2] attr: drop C/C++ default extension mapping Jeff King
2011-12-19 18:10             ` Jonathan Nieder
2011-12-19 20:51               ` Thomas Rast
2011-12-19 20:52         ` [PATCH] t4018: introduce test cases for the internal hunk header patterns Brandon Casey
2011-12-19 21:53           ` [PATCH] t4018: add a few more test cases for cpp hunk header matching Brandon Casey
2011-12-19 22:37           ` [PATCH] t4018: introduce test cases for the internal hunk header patterns Junio C Hamano
2011-12-19 22:57             ` Brandon Casey
2011-12-19 23:17               ` Junio C Hamano
2011-12-20  2:42                 ` [PATCH v2] " Brandon Casey
2011-12-20  8:25                   ` Jakub Narebski
2011-12-20 15:58                     ` Brandon Casey
2011-12-20  9:13                   ` Thomas Rast
2011-12-20 19:52                   ` Johannes Sixt [this message]
2011-12-20 20:08             ` [PATCH] " Junio C Hamano
2011-12-16 17:51 ` [PATCH] attr: map builtin userdiff drivers to well-known extensions Mark Levedahl
2011-12-16 19:28   ` Jeff King
2011-12-16 19:26 ` Philip Oakley
2011-12-16 19:32   ` Jeff King
2011-12-22  0:05     ` Philip Oakley
2011-12-23  5:47       ` Jeff King
2011-12-16 19:38   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EF0E781.4060506@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=drafnel@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.net \
    --cc=trast@student.ethz.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).