test: update to use fmtlib specifiers

This commit is contained in:
Danny Robson 2022-03-23 06:41:55 +10:00
parent 9428d5ee60
commit 220072fd6d
6 changed files with 13 additions and 13 deletions

View File

@ -53,8 +53,8 @@ main ()
std::array<uint32_t,2> dec; std::array<uint32_t,2> dec;
gen.decrypt (cruft::view (dec), cruft::view (t.enc)); gen.decrypt (cruft::view (dec), cruft::view (t.enc));
tap.expect (enc == t.enc, "TEA_enc %zu", i); tap.expect (enc == t.enc, "TEA_enc {}", i);
tap.expect (dec == t.dec, "TEA_dec %zu", i); tap.expect (dec == t.dec, "TEA_dec {}", i);
} }
return tap.status (); return tap.status ();

View File

@ -51,8 +51,8 @@ main ()
std::array<uint32_t,2> dec_result; std::array<uint32_t,2> dec_result;
gen.decrypt (cruft::view (dec_result), cruft::view (enc_result)); gen.decrypt (cruft::view (dec_result), cruft::view (enc_result));
tap.expect (enc_result == t.enc, "XTEA_enc %zu", i); tap.expect (enc_result == t.enc, "XTEA_enc {}", i);
tap.expect (dec_result == t.dec, "XTEA_dec %zu", i); tap.expect (dec_result == t.dec, "XTEA_dec {}", i);
} }
return tap.status (); return tap.status ();

View File

@ -109,8 +109,8 @@ main ()
std::vector<uint32_t> dec_result (t.enc.size ()); std::vector<uint32_t> dec_result (t.enc.size ());
gen.decrypt (cruft::view (dec_result), cruft::view (t.enc)); gen.decrypt (cruft::view (dec_result), cruft::view (t.enc));
tap.expect (enc_result == t.enc, "XXTEA_enc %zu", i); tap.expect (enc_result == t.enc, "XXTEA_enc {}", i);
tap.expect (dec_result == t.dec, "XXTEA_dec %zu", i); tap.expect (dec_result == t.dec, "XXTEA_dec {}", i);
} }
return tap.status (); return tap.status ();

View File

@ -278,7 +278,7 @@ main (int, char**)
cruft::TAP::logger tap; cruft::TAP::logger tap;
for (size_t i = 0; i < std::size (TESTS); ++i) for (size_t i = 0; i < std::size (TESTS); ++i)
tap.expect (TESTS[i].fun (TESTS[i].key, TESTS[i].dat, TESTS[i].res), "standard test vector %zu", i); tap.expect (TESTS[i].fun (TESTS[i].key, TESTS[i].dat, TESTS[i].res), "standard test vector {}", i);
return tap.status (); return tap.status ();
} }

View File

@ -390,7 +390,7 @@ main ()
success = success && std::equal (std::begin (data), std::end (data), std::begin (t.data[j])); success = success && std::equal (std::begin (data), std::end (data), std::begin (t.data[j]));
}; };
tap.expect (success, "ARC4 %zu", i); tap.expect (success, "ARC4 {}", i);
} }
return tap.status (); return tap.status ();

View File

@ -30,7 +30,7 @@ test_quarter (cruft::TAP::logger &tap)
tap.expect_eq ( tap.expect_eq (
cruft::crypto::stream::salsa::quarter (TESTS[i].a), cruft::crypto::stream::salsa::quarter (TESTS[i].a),
TESTS[i].b, TESTS[i].b,
"quarter %zu", i "quarter {}", i
); );
} }
@ -66,7 +66,7 @@ test_row (cruft::TAP::logger &tap)
tap.expect_eq ( tap.expect_eq (
cruft::crypto::stream::salsa::row (TESTS[i].a), cruft::crypto::stream::salsa::row (TESTS[i].a),
TESTS[i].b, TESTS[i].b,
"row %zu", "row {}",
i); i);
} }
@ -100,7 +100,7 @@ test_col (cruft::TAP::logger &tap)
tap.expect_eq ( tap.expect_eq (
cruft::crypto::stream::salsa::col (TESTS[i].a), cruft::crypto::stream::salsa::col (TESTS[i].a),
TESTS[i].b, TESTS[i].b,
"col %zu", "col {}",
i); i);
} }
@ -134,7 +134,7 @@ test_doubleround (cruft::TAP::logger &tap)
tap.expect_eq ( tap.expect_eq (
cruft::crypto::stream::salsa::doubleround (TESTS[i].a), cruft::crypto::stream::salsa::doubleround (TESTS[i].a),
TESTS[i].b, TESTS[i].b,
"doubleround %zu", "doubleround {}",
i); i);
} }
@ -202,7 +202,7 @@ test_salsa20 (cruft::TAP::logger &tap)
tap.expect_eq ( tap.expect_eq (
cruft::crypto::stream::salsa20 (TESTS[i].a), cruft::crypto::stream::salsa20 (TESTS[i].a),
TESTS[i].b, TESTS[i].b,
"salsa20 %zu", "salsa20 {}",
i); i);
struct { struct {