@@ -27,13 +27,13 @@ TEST_CASE ("Testing String::compareTo(const String &)", "[String-compareTo-01]")
2727WHEN (" str2 is empty" )
2828 {
2929 arduino::Stringstr1 (" Hello" ), str2;
30- REQUIRE (str1.compareTo (str2)== strcmp (str1. c_str (), str2. c_str ()) );
30+ REQUIRE (str1.compareTo (str2)> 0 );
3131 }
3232
3333WHEN (" str1 is empty" )
3434 {
3535 arduino::String str1,str2 (" Hello" );
36- REQUIRE (str1.compareTo (str2)== strcmp (str1. c_str (), str2. c_str ()) );
36+ REQUIRE (str1.compareTo (str2)< 0 );
3737 }
3838}
3939
@@ -47,14 +47,14 @@ TEST_CASE ("Testing String::compareTo(const char *)", "[String-compareTo-02]")
4747
4848WHEN (" Passed string is empty" )
4949 {
50- arduino::Stringstr1 (" Hello" ), str2 ( " " );
51- REQUIRE (str1 .compareTo (" " )== strcmp (str1. c_str (), str2. c_str ()) );
50+ arduino::Stringstr (" Hello" );
51+ REQUIRE (str .compareTo (" " )> 0 );
5252 }
5353
5454WHEN (" Passed string is compared with empty string" )
5555 {
56- arduino::Stringstr1, str2 ( " Hello " ) ;
57- REQUIRE (str1 .compareTo (" Hello " ) ==strcmp (str1. c_str (), str2. c_str ()) );
56+ arduino::Stringstr ;
57+ REQUIRE (str .compareTo (" " ) ==0 );
5858 }
5959}
6060
@@ -64,17 +64,17 @@ TEST_CASE ("Testing String::compareTo(const char *) with empty buffer", "[String
6464 {
6565char *buffer =NULL ;
6666
67- arduino::Stringstr1 (" Hello" );
68- REQUIRE (str1 .compareTo (buffer) !=0 );
67+ arduino::Stringstr (" Hello" );
68+ REQUIRE (str .compareTo (buffer) !=0 );
6969 }
7070
7171WHEN (" First string does NOT have a valid buffer" )
7272 {
7373char *buffer1 =NULL ;
7474char *buffer2 =NULL ;
7575
76- arduino::Stringstr1 (buffer1);
77- REQUIRE (str1 .compareTo (buffer2) ==0 );
76+ arduino::Stringstr (buffer1);
77+ REQUIRE (str .compareTo (buffer2) ==0 );
7878 }
7979}
8080