-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Unit tests] Added more unit tests for all the filters
- Loading branch information
1 parent
8d18ae8
commit 3d5701d
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "../../../src/machine_learning/image/filters/average_filter.h" | ||
#include "../../../third_party/catch.hpp" | ||
|
||
using namespace avg_filter; | ||
|
||
TEST_CASE("Testing average filter application") { | ||
std::vector<std::vector<int32_t> > image(50, std::vector<int32_t>(50, 42)); | ||
|
||
auto resulted = apply_avg_filter(image); | ||
REQUIRE(resulted.size() != 0); | ||
} | ||
|
||
TEST_CASE("Testing average filter application with empty image") { | ||
std::vector<std::vector<int32_t> > image; | ||
CHECK_THROWS(apply_avg_filter(image)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "../../../src/machine_learning/image/filters/gaussian_filter.h" | ||
#include "../../../third_party/catch.hpp" | ||
|
||
using namespace gaussian_filter; | ||
|
||
TEST_CASE("Testing gaussian filter application") { | ||
std::vector<std::vector<int32_t> > image(50, std::vector<int32_t>(50, 42)); | ||
|
||
auto resulted = apply_gaussian_filter(image); | ||
REQUIRE(resulted.size() != 0); | ||
} | ||
|
||
TEST_CASE("Testing gaussian filter application with empty image") { | ||
std::vector<std::vector<int32_t> > image; | ||
CHECK_THROWS(apply_gaussian_filter(image)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "../../../src/machine_learning/image/filters/median_filter.h" | ||
#include "../../../third_party/catch.hpp" | ||
|
||
using namespace median_filter; | ||
|
||
TEST_CASE("Testing median filter application") { | ||
std::vector<std::vector<int32_t> > image(50, std::vector<int32_t>(50, 42)); | ||
|
||
auto resulted = apply_median_filter(image); | ||
REQUIRE(resulted.size() != 0); | ||
} | ||
|
||
TEST_CASE("Testing median filter application with empty image") { | ||
std::vector<std::vector<int32_t> > image; | ||
CHECK_THROWS(apply_median_filter(image)); | ||
} |