Browse Source

rfc822: Rename bad-header test

The run-bad-header.c test in the rfc822 module is actually testing handling
of one specific sort of bad header - a header field which contains no
colon character.  Rename the test and its internal variables to better
reflect this.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
David Gibson 13 years ago
parent
commit
cd90166506
1 changed files with 6 additions and 6 deletions
  1. 6 6
      ccan/rfc822/test/run-hdr-no-colon.c

+ 6 - 6
ccan/rfc822/test/run-bad-header.c → ccan/rfc822/test/run-hdr-no-colon.c

@@ -14,16 +14,16 @@
 #include "testdata.h"
 #include "helper.h"
 
-#define BAD_HEADER_STR "This is a bad header\n"
-const char bad_header[] = 
+#define NO_COLON_STR "This is a bad header\n"
+const char no_colon_msg[] = 
 	"Date: Tue, 22 Feb 2011 00:15:59 +1100\n"
-	BAD_HEADER_STR
+	NO_COLON_STR
 	"From: Mister From <from@example.com>\n"
 	"To: Mizz To <to@example.org>\n"
 	"Subject: Some subject\n"
 	"Message-ID: <20110221131559.GA28327@example>\n";
 
-static void test_bad_header(const char *buf, size_t len)
+static void test_no_colon(const char *buf, size_t len)
 {
 	struct rfc822_msg *msg;
 	struct rfc822_header *hdr;
@@ -50,7 +50,7 @@ static void test_bad_header(const char *buf, size_t len)
 	hfull = rfc822_header_raw_content(msg, hdr);
 	allocation_failure_check();
 
-	ok(bytestring_eq(hfull, BYTESTRING(BAD_HEADER_STR)),
+	ok(bytestring_eq(hfull, BYTESTRING(NO_COLON_STR)),
 		"Invalid header content");
 
 	rfc822_free(msg);
@@ -61,7 +61,7 @@ int main(int argc, char *argv[])
 {
 	failtest_setup(argc, argv);
 
-	test_bad_header(bad_header, sizeof(bad_header));
+	test_no_colon(no_colon_msg, sizeof(no_colon_msg));
 
 	/* This exits depending on whether all tests passed */
 	failtest_exit(exit_status());