Skip to content

Commit

Permalink
unit_tests: do not ASSERT_TRUE(decodeRct(...))
Browse files Browse the repository at this point in the history
decodeRct returns the amount, which may be zero
  • Loading branch information
moneromooo-monero committed Jan 18, 2018
1 parent 35d5aa3 commit ab2e995
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/unit_tests/ringct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ TEST(ringct, range_proofs)
ASSERT_TRUE(verRct(s));

//decode received amount
ASSERT_TRUE(decodeRct(s, amount_keys[1], 1, mask));
decodeRct(s, amount_keys[1], 1, mask);

// Ring CT with failing MG sig part should not verify!
// Since sum of inputs != outputs
Expand All @@ -194,7 +194,7 @@ TEST(ringct, range_proofs)
ASSERT_FALSE(verRct(s));

//decode received amount
ASSERT_TRUE(decodeRct(s, amount_keys[1], 1, mask));
decodeRct(s, amount_keys[1], 1, mask);
}

TEST(ringct, range_proofs_with_fee)
Expand Down Expand Up @@ -241,7 +241,7 @@ TEST(ringct, range_proofs_with_fee)
ASSERT_TRUE(verRct(s));

//decode received amount
ASSERT_TRUE(decodeRct(s, amount_keys[1], 1, mask));
decodeRct(s, amount_keys[1], 1, mask);

// Ring CT with failing MG sig part should not verify!
// Since sum of inputs != outputs
Expand All @@ -258,7 +258,7 @@ TEST(ringct, range_proofs_with_fee)
ASSERT_FALSE(verRct(s));

//decode received amount
ASSERT_TRUE(decodeRct(s, amount_keys[1], 1, mask));
decodeRct(s, amount_keys[1], 1, mask);
}

TEST(ringct, simple)
Expand Down Expand Up @@ -316,7 +316,7 @@ TEST(ringct, simple)
ASSERT_TRUE(verRctSimple(s));

//decode received amount corresponding to output pubkey index 1
ASSERT_TRUE(decodeRctSimple(s, amount_keys[1], 1, mask));
decodeRctSimple(s, amount_keys[1], 1, mask);
}

static rct::rctSig make_sample_rct_sig(int n_inputs, const uint64_t input_amounts[], int n_outputs, const uint64_t output_amounts[], bool last_is_fee)
Expand Down

0 comments on commit ab2e995

Please sign in to comment.