Electroneum
Loading...
Searching...
No Matches
canonical_amounts.cpp File Reference
#include "gtest/gtest.h"
#include "cryptonote_basic/cryptonote_format_utils.h"
Include dependency graph for canonical_amounts.cpp:

Go to the source code of this file.

Functions

 TEST (canonical_amounts, valid)
 TEST (canonical_amounts, invalid)

Function Documentation

◆ TEST() [1/2]

TEST ( canonical_amounts ,
invalid  )

Definition at line 66 of file canonical_amounts.cpp.

67{
68 for (size_t n = 0; n < sizeof(valid_decomposed_outputs) / sizeof(valid_decomposed_outputs[0]); ++n)
69 {
70 // 10 and below have adjacent valid decomposed amounts
71 if (valid_decomposed_outputs[n] > 10)
72 {
73 ASSERT_FALSE(cryptonote::is_valid_decomposed_amount(valid_decomposed_outputs[n]+1));
74 ASSERT_FALSE(cryptonote::is_valid_decomposed_amount(valid_decomposed_outputs[n]-1));
75 }
76 }
77
83}
#define ASSERT_FALSE(condition)
Definition gtest.h:1868
bool is_valid_decomposed_amount(uint64_t amount)
unsigned __int64 uint64_t
Definition stdint.h:136
Here is the call graph for this function:

◆ TEST() [2/2]

TEST ( canonical_amounts ,
valid  )

Definition at line 58 of file canonical_amounts.cpp.

59{
60 for (size_t n = 0; n < sizeof(valid_decomposed_outputs) / sizeof(valid_decomposed_outputs[0]); ++n)
61 {
62 ASSERT_TRUE(cryptonote::is_valid_decomposed_amount(valid_decomposed_outputs[n]));
63 }
64}
#define ASSERT_TRUE(condition)
Definition gtest.h:1865
Here is the call graph for this function: