Electroneum
difficulty.cpp File Reference
#include "gtest/gtest.h"
#include "cryptonote_basic/difficulty.h"
Include dependency graph for difficulty.cpp:

Go to the source code of this file.

Functions

 TEST (difficulty, check_hash)
 

Function Documentation

◆ TEST()

TEST ( difficulty  ,
check_hash   
)

Definition at line 55 of file difficulty.cpp.

56 {
57  ASSERT_TRUE(cryptonote::check_hash(MKHASH(0, 1), MKDIFF(0, 1)));
58  ASSERT_FALSE(cryptonote::check_hash(MKHASH(0, 1), MKDIFF(0, 2)));
59 
60  ASSERT_TRUE(cryptonote::check_hash(MKHASH(0, 0xffffffffffffffff), MKDIFF(0, 0xffffffffffffffff)));
61  ASSERT_FALSE(cryptonote::check_hash(MKHASH(0, 0xffffffffffffffff), MKDIFF(1, 0)));
62 
63  ASSERT_TRUE(cryptonote::check_hash(MKHASH(1, 1), MKDIFF(1, 1)));
64  ASSERT_FALSE(cryptonote::check_hash(MKHASH(1, 1), MKDIFF(1, 2)));
65 
66  ASSERT_TRUE(cryptonote::check_hash(MKHASH(0xffffffffffffffff, 1), MKDIFF(0xffffffffffffffff, 1)));
67  ASSERT_FALSE(cryptonote::check_hash(MKHASH(0xffffffffffffffff, 1), MKDIFF(0xffffffffffffffff, 2)));
68 }
#define ASSERT_FALSE(condition)
Definition: gtest.h:1868
bool check_hash(const crypto::hash &hash, difficulty_type difficulty)
Definition: difficulty.cpp:203
#define ASSERT_TRUE(condition)
Definition: gtest.h:1865
Here is the call graph for this function: