Skip to content

Commit

Permalink
Fix tests after heavy tx PR (hyperledger-iroha#1219)
Browse files Browse the repository at this point in the history
* Fix tests after heavy tx PR
Also
* rework assert in acceptance test
* add docs for field_validator_test
  • Loading branch information
muratovv authored Apr 17, 2018
1 parent 803fe83 commit eb68ba7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
11 changes: 7 additions & 4 deletions test/integration/acceptance/tx_heavy_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,13 @@ TEST_F(HeavyTransactionTest, OneLargeTx) {
[](auto &block) { ASSERT_EQ(block->transactions().size(), 1); })
// "foo" transactions will not be passed because it has large size into
// one field - 5Mb per one set
.sendTx(complete(setAcountDetailTx("foo", generateData(5 * 1024 * 1024))))
.skipProposal()
.checkBlock(
[](auto &block) { ASSERT_EQ(block->transactions().size(), 0); })
.sendTx(complete(setAcountDetailTx("foo", generateData(5 * 1024 * 1024))),
[](const auto &status) {
ASSERT_TRUE(boost::apply_visitor(
shared_model::interface::SpecifiedVisitor<
shared_model::interface::StatelessFailedTxResponse>(),
status.get()));
})
.done();
}

Expand Down
10 changes: 6 additions & 4 deletions test/module/shared_model/validators/field_validator_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,12 @@ class FieldValidatorTest : public ValidatorsTest {
makeValidCase(&FieldValidatorTest::detail_value, "valid value"),
makeValidCase(&FieldValidatorTest::detail_value, std::string(4096, '0')),
makeValidCase(&FieldValidatorTest::detail_value, ""),
makeInvalidCase("long_value",
"value",
&FieldValidatorTest::detail_value,
std::string(4097, '0'))};
makeInvalidCase(
"long_value",
"value",
&FieldValidatorTest::detail_value,
// 5 Mb, value greater than can put into one setAccountDetail
std::string(5 * 1024 * 1024, '0'))};

std::vector<FieldTestCase> description_test_cases{
makeValidCase(&FieldValidatorTest::description, "valid description"),
Expand Down

0 comments on commit eb68ba7

Please sign in to comment.