diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional_tests/make_test_signature.cc | 2 | ||||
-rwxr-xr-x | tests/functional_tests/rpc_payment.py | 4 | ||||
-rw-r--r-- | tests/fuzz/http-client.cpp | 5 | ||||
-rw-r--r-- | tests/unit_tests/epee_utils.cpp | 3 |
4 files changed, 13 insertions, 1 deletions
diff --git a/tests/functional_tests/make_test_signature.cc b/tests/functional_tests/make_test_signature.cc index 6ac1a6a86..f31816841 100644 --- a/tests/functional_tests/make_test_signature.cc +++ b/tests/functional_tests/make_test_signature.cc @@ -27,6 +27,7 @@ // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <stdio.h> +#include "misc_language.h" #include "string_tools.h" #include "rpc/rpc_payment_signature.h" @@ -69,6 +70,7 @@ int main(int argc, const char **argv) while (count--) { std::string signature = cryptonote::make_rpc_payment_signature(skey); + epee::misc_utils::sleep_no_w(1); printf("%s\n", signature.c_str()); } return 0; diff --git a/tests/functional_tests/rpc_payment.py b/tests/functional_tests/rpc_payment.py index 3bf995f0c..5f23c2022 100755 --- a/tests/functional_tests/rpc_payment.py +++ b/tests/functional_tests/rpc_payment.py @@ -59,12 +59,14 @@ class RPCPaymentTest(): return fields def refill_signatures(self): + self.signatures_time = time.time() + self.signatures = [] signatures = subprocess.check_output([self.make_test_signature, self.secret_key, '256']).decode('utf-8') for line in signatures.split(): self.signatures.append(line.rstrip()) def get_signature(self): - if len(self.signatures) == 0: + if len(self.signatures) == 0 or self.signatures_time + 10 < time.time(): self.refill_signatures() s = self.signatures[0] self.signatures = self.signatures[1:] diff --git a/tests/fuzz/http-client.cpp b/tests/fuzz/http-client.cpp index 1750838ae..ea6d5a2ad 100644 --- a/tests/fuzz/http-client.cpp +++ b/tests/fuzz/http-client.cpp @@ -29,6 +29,7 @@ #include "include_base_utils.h" #include "file_io_utils.h" #include "net/http_client.h" +#include "net/net_ssl.h" #include "fuzzer.h" class dummy_client @@ -46,6 +47,10 @@ public: data.clear(); return true; } + void set_ssl(epee::net_utils::ssl_options_t ssl_options) { } + bool is_connected(bool *ssl = NULL) { return true; } + uint64_t get_bytes_sent() const { return 1; } + uint64_t get_bytes_received() const { return 1; } void set_test_data(const std::string &s) { data = s; } diff --git a/tests/unit_tests/epee_utils.cpp b/tests/unit_tests/epee_utils.cpp index 42bbb26bb..4f42140b3 100644 --- a/tests/unit_tests/epee_utils.cpp +++ b/tests/unit_tests/epee_utils.cpp @@ -841,6 +841,9 @@ TEST(HexLocale, String) // decoding it this way also, ignoring spaces and colons between the numbers hex.assign("00:ff 0f:f0"); EXPECT_EQ(source, epee::from_hex_locale::to_vector(hex)); + + hex.append("f0"); + EXPECT_EQ(source, epee::from_hex_locale::to_vector(boost::string_ref{hex.data(), hex.size() - 2})); } TEST(ToHex, Array) |