summaryrefslogtreecommitdiff
path: root/toxcore/util_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/util_test.cc')
-rw-r--r--toxcore/util_test.cc25
1 files changed, 3 insertions, 22 deletions
diff --git a/toxcore/util_test.cc b/toxcore/util_test.cc
index 541aa61f..ff57f3fb 100644
--- a/toxcore/util_test.cc
+++ b/toxcore/util_test.cc
@@ -4,28 +4,7 @@
4 4
5#include <gtest/gtest.h> 5#include <gtest/gtest.h>
6 6
7TEST(Util, UnixTimeIncreasesOverTime) { 7namespace {
8 unix_time_update();
9 uint64_t const start = unix_time();
10
11 while (start == unix_time()) {
12 unix_time_update();
13 }
14
15 uint64_t const end = unix_time();
16 EXPECT_GT(end, start);
17}
18
19TEST(Util, IsTimeout) {
20 uint64_t const start = unix_time();
21 EXPECT_FALSE(is_timeout(start, 1));
22
23 while (start == unix_time()) {
24 unix_time_update();
25 }
26
27 EXPECT_TRUE(is_timeout(start, 1));
28}
29 8
30TEST(Util, TwoRandomIdsAreNotEqual) { 9TEST(Util, TwoRandomIdsAreNotEqual) {
31 uint8_t pk1[CRYPTO_PUBLIC_KEY_SIZE]; 10 uint8_t pk1[CRYPTO_PUBLIC_KEY_SIZE];
@@ -49,3 +28,5 @@ TEST(Util, IdCopyMakesKeysEqual) {
49 28
50 EXPECT_TRUE(id_equal(pk1, pk2)); 29 EXPECT_TRUE(id_equal(pk1, pk2));
51} 30}
31
32} // namespace