Skip to content

Commit

Permalink
Add qrcode test case for no_implemented.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Mar 14, 2021
1 parent cd2ee42 commit d5e37df
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions test/utility/qr_code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,35 @@ using namespace bc::system;

BOOST_AUTO_TEST_SUITE(qr_code_tests)

// TODO: test all cases.

#ifdef WITH_QRENCODE

// This test may be sensitive to changes in qrencode conversion formatting.
BOOST_AUTO_TEST_CASE(qr_code__construct__always__expected)
BOOST_AUTO_TEST_CASE(qr_code__encode__always__expected)
{
////static const data_chunk expected
////{
//// // TODO: generate from qrencode.
////};

////const auto bitmap = qr_code::encode("bitcoin:1L4M4obtbpexxuKpLrDimMEYWB2Rx2yzus");
////BOOST_REQUIRE_EQUAL(bitmap.size(), expected.size());
////data_chunk out;
////data_sink sink(out);
////BOOST_REQUIRE(!qr_code::encode(sink, "bitcoin:1L4M4obtbpexxuKpLrDimMEYWB2Rx2yzus"));
////BOOST_REQUIRE_EQUAL(out.size(), expected.size());

////// Encode as base16 so that failure message is intelligible.
////BOOST_REQUIRE_EQUAL(encode_base16(bitmap), encode_base16(expected));
////BOOST_REQUIRE_EQUAL(encode_base16(out), encode_base16(expected));
BOOST_REQUIRE(true);
}

#else

BOOST_AUTO_TEST_CASE(qr_code__encode__not_implemented__false)
{
data_chunk out;
data_sink sink(out);
BOOST_REQUIRE(!qr_code::encode(sink, "bitcoin:1L4M4obtbpexxuKpLrDimMEYWB2Rx2yzus"));
}

#endif // WITH_QRENCODE

BOOST_AUTO_TEST_SUITE_END()

0 comments on commit d5e37df

Please sign in to comment.