Skip to content

Commit

Permalink
Added exception tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
zsiciarz committed Aug 27, 2014
1 parent a2e0af7 commit b06c6ee
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/constants.h.in"
set(Aquila_Test_SOURCES
main.cpp
functions.cpp
Exceptions.cpp
filter/MelFilter.cpp
filter/MelFilterBank.cpp
ml/Dtw.cpp
Expand Down
42 changes: 42 additions & 0 deletions tests/Exceptions.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#include "aquila/Exceptions.h"
#include "UnitTest++/UnitTest++.h"


SUITE(Exceptions)
{
TEST(Exception)
{
try
{
throw Aquila::Exception("message");
}
catch (const Aquila::Exception& exc)
{
CHECK_EQUAL("message", exc.what());
}
}

TEST(FormatException)
{
try
{
throw Aquila::FormatException("message");
}
catch (const Aquila::FormatException& exc)
{
CHECK_EQUAL("message", exc.what());
}
}

TEST(ConfigurationException)
{
try
{
throw Aquila::ConfigurationException("message");
}
catch (const Aquila::ConfigurationException& exc)
{
CHECK_EQUAL("message", exc.what());
}
}
}

0 comments on commit b06c6ee

Please sign in to comment.