PATCH: remove redundant methods in dejagnu.h

Ben Elliston <[email protected]>
Newsgroups gmane.comp.sysutils.dejagnu.general
Message-ID <[email protected]>
Hi Rob

I spotted this while reading dejagnu.h. There is no need to provide
additional methods that peform the same runtime type conversion that
C++ does for us.  OK to commit?

Cheers, Ben


2018-12-03  Ben Elliston  <[email protected]>

	* dejagnu.h (TestState): Remove const char * variants of
	pass(), xpass(), fail(), xfail(), untested(), unresolved() for
	C++. A const char * will be implicitly converted to
	std::string.


diff --git a/dejagnu.h b/dejagnu.h
index c8e2c8f..bd0dcc3 100644
--- a/dejagnu.h
+++ b/dejagnu.h
@@ -211,12 +211,6 @@ class TestState {
 	std::cout << "\t" << outstate[PASSED] << s << std::endl;
       }
 
-    void pass (const char *c)
-      {
-	std::string s = c;
-	pass (s);
-      }
-
     void xpass (std::string s)
       {
 	xpassed++;
@@ -225,12 +219,6 @@ class TestState {
 	std::cout << "\t" << outstate[XPASSED] << s << std::endl;
       }
 
-    void xpass (const char *c)
-      {
-	std::string s = c;
-	xpass (s);
-      }
-
     void fail (std::string s)
       {
 	failed++;
@@ -239,12 +227,6 @@ class TestState {
 	std::cout << "\t" << outstate[FAILED] << s << std::endl;
       }
 
-    void fail (const char *c)
-      {
-	std::string s = c;
-	fail (s);
-      }
-
     void xfail (std::string s)
       {
 	xfailed++;
@@ -253,12 +235,6 @@ class TestState {
 	std::cout << "\t" << outstate[XFAILED] << s << std::endl;
       }
 
-    void xfail (const char *c)
-      {
-	std::string s = c;
-	xfail (s);
-      }
-
     void untested (std::string s)
       {
 	untest++;
@@ -267,12 +243,6 @@ class TestState {
 	std::cout << "\t" << outstate[UNTESTED] << s << std::endl;
       }
 
-    void untested (const char *c)
-      {
-	std::string s = c;
-	untested (s);
-      }
-
     void unresolved (std::string s)
       {
 	unresolve++;
@@ -281,12 +251,6 @@ class TestState {
 	std::cout << "\t" << outstate[UNRESOLVED] << s << std::endl;
       }
 
-    void unresolved (const char *c)
-      {
-	std::string s = c;
-	unresolved (s);
-      }
-
     void totals (void)
       {
 	std::cout << "\t#passed:\t\t" << passed << std::endl;

_______________________________________________
DejaGnu mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/dejagnu
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEFS8+rdM1/2KWERKFZ9rcPj90NkkFAlwFCioACgkQZ9rcPj90
Nknoyg/8DkfK9B7krutc85T3ZpapTjwr1JwKt1sA6gfEoQoE7/9paLDlV09yDhr0
p5wnJFyy3NNY6j2wGkzEzim9WoVpVD4OgqqnVDIpGglha7Wb28bPm8yvcj2Ssjmf
QBnVn3zEsZHIZMv1MHpk+AvMu97Mu4RpxWvwca5ceiCPt2u/5iixRbcz6P3zD358
vh0H8En6VsTR28L2fK7p1xQ/jiBNqwf5QY4gMwjbdEX80p/gtS1e0mhGEBNIeAAw
cY4GDWWIlZuH1XytpqkV2lP6ks1xswHDuCAQdVFylCBpWvzi9BDiesSKs7hc76M8
5YvCpBZatdurwHzRcZwhd3h1DLHttx7EERy9vL0pA+xYbkwQ/ANZIrs/UTHPeeyk
YZsAhyiGhaPuxyqIBypSYMks/YO7uB7UG/NU2oZbjVp7CjqGi+KJ46IoO5FKk9Kx
xI2xPdozkSP4FLA8nt6Fq7HdgHz5ZLuglV5P5nMypvJzEJsdgAUzP1HcLmGZY1qw
bod2B5zniS6Wm8fUPkH9I9leFV5kpSNF+JIDJVGO93MqEMJimkNxk1KhO3dAn81v
Xm/J05uDVAWQJ4CdnOUlgagBPikA+cBvMhO0wZt6mrudWr16bbYJmCeoQAmP5xdg
iMoDx7E3qRn5Cc6a/G7mR9SDbv04bHSOEgDW7OtY786FuuhIzqo=
=vDig
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.