|
@@ -3,7 +3,7 @@
|
|
* Company: Lynar Studios
|
|
* Company: Lynar Studios
|
|
* E-Mail: webmaster@lynarstudios.com
|
|
* E-Mail: webmaster@lynarstudios.com
|
|
* Created: 2023-02-07
|
|
* Created: 2023-02-07
|
|
-* Changed: 2023-03-25
|
|
|
|
|
|
+* Changed: 2023-05-22
|
|
*
|
|
*
|
|
* */
|
|
* */
|
|
|
|
|
|
@@ -12,6 +12,7 @@
|
|
|
|
|
|
using ls::std::core::ExceptionMessage;
|
|
using ls::std::core::ExceptionMessage;
|
|
using std::string;
|
|
using std::string;
|
|
|
|
+using std::string_view;
|
|
using testing::Test;
|
|
using testing::Test;
|
|
|
|
|
|
namespace
|
|
namespace
|
|
@@ -27,12 +28,10 @@ namespace
|
|
TEST_F(ExceptionMessageTest, toCharacterPointer)
|
|
TEST_F(ExceptionMessageTest, toCharacterPointer)
|
|
{
|
|
{
|
|
string text = "hello!";
|
|
string text = "hello!";
|
|
-
|
|
|
|
ExceptionMessage message{text};
|
|
ExceptionMessage message{text};
|
|
- char *characterPointer = message.toCharacterPointer();
|
|
|
|
- ASSERT_STREQ(text.c_str(), characterPointer);
|
|
|
|
|
|
+ string_view characterField = message.toCharacterPointer();
|
|
|
|
|
|
- delete characterPointer;
|
|
|
|
|
|
+ ASSERT_STREQ(text.c_str(), characterField.data());
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(ExceptionMessageTest, toCharacterPointer_empty)
|
|
TEST_F(ExceptionMessageTest, toCharacterPointer_empty)
|