Skip to content

Commit

Permalink
Added empty condition in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shoooe committed Feb 7, 2017
1 parent 19ab4c8 commit e1e1f88
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion test/sor/tensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ SCENARIO("tensor swap", "[tensor]") {

SCENARIO("tensor size") {

GIVEN("a tensor") {
GIVEN("a non empty tensor") {

sor::tensor<int, 3, 5, 2> tensor;

Expand Down Expand Up @@ -626,4 +626,46 @@ SCENARIO("tensor size") {

}

GIVEN("an empty tensor") {

sor::tensor<int, 0, 1> tensor;

WHEN("we query for its size") {

constexpr auto size = tensor.size();

THEN("we get 0") {

REQUIRE(size == 0);

}

}

WHEN("we query for its maximum size") {

constexpr auto max_size = tensor.max_size();

THEN("we get 0") {

REQUIRE(max_size == 0);

}

}

WHEN("we query whether it's empty or not") {

constexpr auto is_empty = tensor.empty();

THEN("we get true") {

REQUIRE(is_empty);

}

}

}

}

0 comments on commit e1e1f88

Please sign in to comment.