dejagnu
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PATCH: remove redundant methods in dejagnu.h


From: Ben Elliston
Subject: PATCH: remove redundant methods in dejagnu.h
Date: Mon, 3 Dec 2018 21:49:15 +1100
User-agent: NeoMutt/20170609 (1.8.3)

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  <address@hidden>

        * 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;

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]