-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Aeternity]: Catch all exceptions on
TWAnyAddressIsValid
for Aetern…
…ity coin (#3832)
- Loading branch information
1 parent
b002af3
commit 2c4eb4a
Showing
3 changed files
with
43 additions
and
15 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
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
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,18 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Copyright © 2017 Trust Wallet. | ||
|
||
#include <TrustWalletCore/TWAnyAddress.h> | ||
#include <gtest/gtest.h> | ||
#include <TestUtilities.h> | ||
|
||
namespace TW::Aeternity::tests { | ||
|
||
// `TWAnyAddressIsValid` must catch exceptions and return false. | ||
TEST(AeternityAddress, IsValid) { | ||
ASSERT_FALSE(TWAnyAddressIsValid(STRING("invalid").get(), TWCoinTypeAeternity)); | ||
ASSERT_FALSE(TWAnyAddressIsValid(STRING("behave@wallet").get(), TWCoinTypeAeternity)); | ||
ASSERT_FALSE(TWAnyAddressIsValid(STRING("a").get(), TWCoinTypeAeternity)); | ||
} | ||
|
||
} // namespace TW::Aeternity::tests |