Monero
Classes | Macros | Functions
long_term_block_weight.cpp File Reference
#include "gtest/gtest.h"
#include "cryptonote_core/blockchain.h"
#include "cryptonote_core/tx_pool.h"
#include "cryptonote_core/cryptonote_core.h"
#include "blockchain_db/testdb.h"
Include dependency graph for long_term_block_weight.cpp:

Classes

struct  BlockchainAndPool
 

Macros

#define IN_UNIT_TESTS
 
#define TEST_LONG_TERM_BLOCK_WEIGHT_WINDOW   5000
 
#define PREFIX_WINDOW(hf_version, window)
 
#define PREFIX(hf_version)   PREFIX_WINDOW(hf_version, TEST_LONG_TERM_BLOCK_WEIGHT_WINDOW)
 

Functions

 TEST (long_term_block_weight, empty_short)
 
 TEST (long_term_block_weight, identical_before_fork)
 
 TEST (long_term_block_weight, identical_after_fork_before_long_term_window)
 
 TEST (long_term_block_weight, ceiling_at_30000000)
 
 TEST (long_term_block_weight, multi_pop)
 
 TEST (long_term_block_weight, multiple_updates)
 
 TEST (long_term_block_weight, pop_invariant_max)
 
 TEST (long_term_block_weight, pop_invariant_random)
 
 TEST (long_term_block_weight, long_growth_spike_and_drop)
 
 TEST (long_term_block_weight, cache_matches_true_value)
 

Macro Definition Documentation

◆ IN_UNIT_TESTS

#define IN_UNIT_TESTS

◆ PREFIX

#define PREFIX (   hf_version)    PREFIX_WINDOW(hf_version, TEST_LONG_TERM_BLOCK_WEIGHT_WINDOW)

◆ PREFIX_WINDOW

#define PREFIX_WINDOW (   hf_version,
  window 
)
Value:
cryptonote::Blockchain *bc = &bap.bc; \
struct get_test_options { \
const std::pair<uint8_t, uint64_t> hard_forks[3]; \
const cryptonote::test_options test_options = { \
hard_forks, \
window, \
}; \
get_test_options(): hard_forks{std::make_pair(1, (uint64_t)0), std::make_pair((uint8_t)hf_version, (uint64_t)1), std::make_pair((uint8_t)0, (uint64_t)0)} {} \
} opts; \
bool r = bc->init(new TestDB(), cryptonote::FAKECHAIN, true, &opts.test_options, 0, NULL); \
ASSERT_TRUE(r)
Definition: cryptonote_config.h:306
unsigned char uint8_t
Definition: stdint.h:124
Definition: long_term_block_weight.cpp:109
unsigned __int64 uint64_t
Definition: stdint.h:136
Definition: cryptonote_core.h:61
r
Definition: testupnpigd.py:61
Definition: chaingen.h:725
cryptonote::Blockchain bc
Definition: long_term_block_weight.cpp:112

◆ TEST_LONG_TERM_BLOCK_WEIGHT_WINDOW

#define TEST_LONG_TERM_BLOCK_WEIGHT_WINDOW   5000

Function Documentation

◆ TEST() [1/10]

TEST ( long_term_block_weight  ,
empty_short   
)

◆ TEST() [2/10]

TEST ( long_term_block_weight  ,
identical_before_fork   
)

◆ TEST() [3/10]

TEST ( long_term_block_weight  ,
identical_after_fork_before_long_term_window   
)

◆ TEST() [4/10]

TEST ( long_term_block_weight  ,
ceiling_at_30000000   
)

◆ TEST() [5/10]

TEST ( long_term_block_weight  ,
multi_pop   
)

◆ TEST() [6/10]

TEST ( long_term_block_weight  ,
multiple_updates   
)

◆ TEST() [7/10]

TEST ( long_term_block_weight  ,
pop_invariant_max   
)

◆ TEST() [8/10]

TEST ( long_term_block_weight  ,
pop_invariant_random   
)

◆ TEST() [9/10]

TEST ( long_term_block_weight  ,
long_growth_spike_and_drop   
)

◆ TEST() [10/10]

TEST ( long_term_block_weight  ,
cache_matches_true_value   
)