diff options
| author | aunsane <aunsane@gmail.com> | 2018-07-18 00:17:16 +0300 |
|---|---|---|
| committer | aunsane <aunsane@gmail.com> | 2018-07-18 00:17:42 +0300 |
| commit | adf1f2e587159bb99d820faa983ef3e357d41f40 (patch) | |
| tree | 988f428bfd45cb46576dae4b4decf82dcb0078f5 /protocols/Tox/libtox/src/toxcore/util_test.cpp | |
| parent | 5a8dadd96ca13797f67c39079ba5c4889ef8c421 (diff) | |
Tox: updated libtox to v0.2.3
Diffstat (limited to 'protocols/Tox/libtox/src/toxcore/util_test.cpp')
| -rw-r--r-- | protocols/Tox/libtox/src/toxcore/util_test.cpp | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/protocols/Tox/libtox/src/toxcore/util_test.cpp b/protocols/Tox/libtox/src/toxcore/util_test.cpp deleted file mode 100644 index 8de6384848..0000000000 --- a/protocols/Tox/libtox/src/toxcore/util_test.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "util.h" - -#include "crypto_core.h" - -#include <gtest/gtest.h> - -TEST(Util, UnixTimeIncreasesOverTime) -{ - unix_time_update(); - uint64_t const start = unix_time(); - - while (start == unix_time()) { - unix_time_update(); - } - - uint64_t const end = unix_time(); - EXPECT_GT(end, start); -} - -TEST(Util, IsTimeout) -{ - uint64_t const start = unix_time(); - EXPECT_FALSE(is_timeout(start, 1)); - - while (start == unix_time()) { - unix_time_update(); - } - - EXPECT_TRUE(is_timeout(start, 1)); -} - -TEST(Util, TwoRandomIdsAreNotEqual) -{ - uint8_t pk1[CRYPTO_PUBLIC_KEY_SIZE]; - uint8_t sk1[CRYPTO_SECRET_KEY_SIZE]; - uint8_t pk2[CRYPTO_PUBLIC_KEY_SIZE]; - uint8_t sk2[CRYPTO_SECRET_KEY_SIZE]; - - crypto_new_keypair(pk1, sk1); - crypto_new_keypair(pk2, sk2); - - EXPECT_FALSE(id_equal(pk1, pk2)); -} - -TEST(Util, IdCopyMakesKeysEqual) -{ - uint8_t pk1[CRYPTO_PUBLIC_KEY_SIZE]; - uint8_t sk1[CRYPTO_SECRET_KEY_SIZE]; - uint8_t pk2[CRYPTO_PUBLIC_KEY_SIZE] = {0}; - - crypto_new_keypair(pk1, sk1); - id_copy(pk2, pk1); - - EXPECT_TRUE(id_equal(pk1, pk2)); -} |
