Add ChaosExceptionTests.
All checks were successful
Chaos Ci / test-and-benchmark (push) Successful in 2m2s
All checks were successful
Chaos Ci / test-and-benchmark (push) Successful in 2m2s
This commit is contained in:
@@ -18,7 +18,8 @@ set(ChaosTests_SOURCE Hash/Md4HasherTests.cpp
|
||||
Cipher/Arc4GenTests.cpp
|
||||
Cipher/Arc4CryptTests.cpp
|
||||
Cipher/DesCryptTests.cpp
|
||||
Service/SeArrayTests.cpp)
|
||||
Service/SeArrayTests.cpp
|
||||
Service/ChaosExceptionTests.cpp)
|
||||
|
||||
add_executable(ChaosTests ${ChaosTests_SOURCE})
|
||||
target_link_libraries(ChaosTests gtest gtest_main)
|
||||
|
||||
32
ChaosTests/Service/ChaosExceptionTests.cpp
Normal file
32
ChaosTests/Service/ChaosExceptionTests.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <string>
|
||||
|
||||
#include "Service/ChaosException.hpp"
|
||||
|
||||
using namespace Chaos::Service;
|
||||
|
||||
TEST(ChaosExceptionTests, RvalueRefCtorTest)
|
||||
{
|
||||
try
|
||||
{
|
||||
throw ChaosException("everything's alright :D");
|
||||
}
|
||||
catch (const ChaosException & ex)
|
||||
{
|
||||
ASSERT_EQ("everything's alright :D", ex.GetMessage());
|
||||
}
|
||||
}
|
||||
|
||||
TEST(ChaosExceptionTests, ConstLvalueRefCtorTest)
|
||||
{
|
||||
const std::string message = "everything's alright :D";
|
||||
|
||||
try
|
||||
{
|
||||
throw ChaosException(message);
|
||||
}
|
||||
catch (const ChaosException & ex)
|
||||
{
|
||||
ASSERT_EQ("everything's alright :D", ex.GetMessage());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user