Compare commits

..

2 Commits

Author SHA1 Message Date
hashlag
ccf1397595 Merge branch 'exception-tests'
All checks were successful
Chaos Ci / test-and-benchmark (push) Successful in 1m56s
Add missing ChaosException tests.
2026-02-06 18:18:45 +03:00
hashlag
6a09d81ae2 Add ChaosExceptionTests.
All checks were successful
Chaos Ci / test-and-benchmark (push) Successful in 2m2s
2026-02-06 18:05:57 +03:00
2 changed files with 34 additions and 1 deletions

View File

@@ -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)

View 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());
}
}