summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-02-08 21:47:34 -0800
committerSage Weil <sage@inktank.com>2013-02-08 21:47:34 -0800
commit0d68f3a8f7bcba2d4b1a055a23c8b07054ac628c (patch)
tree035846b5eeba9a458be0eea2d78d8eea22b7db71
parent20255d9846063012bb6188fc2fa7468ef8cfefe4 (diff)
downloadceph-0d68f3a8f7bcba2d4b1a055a23c8b07054ac628c.tar.gz
test/crypto: fix narrowing conversion warning
warning: test/crypto.cc:49:3: narrowing conversion of ‘136’ from ‘int’ to ‘char’ inside { } is ill-formed in C++11 [-Wnarrowing] Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/test/crypto.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/test/crypto.cc b/src/test/crypto.cc
index 80a5495001d..24d5c5a475d 100644
--- a/src/test/crypto.cc
+++ b/src/test/crypto.cc
@@ -43,19 +43,19 @@ TEST(AES, Encrypt) {
};
bufferptr secret(secret_s, sizeof(secret_s));
- char plaintext_s[] = {
+ unsigned char plaintext_s[] = {
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff,
};
bufferlist plaintext;
- plaintext.append(plaintext_s, sizeof(plaintext_s));
+ plaintext.append((char *)plaintext_s, sizeof(plaintext_s));
bufferlist cipher;
std::string error;
h->encrypt(secret, plaintext, cipher, error);
ASSERT_EQ(error, "");
- char want_cipher[] = {
+ unsigned char want_cipher[] = {
0xb3, 0x8f, 0x5b, 0xc9, 0x35, 0x4c, 0xf8, 0xc6,
0x13, 0x15, 0x66, 0x6f, 0x37, 0xd7, 0x79, 0x3a,
0x11, 0x90, 0x7b, 0xe9, 0xd8, 0x3c, 0x35, 0x70,
@@ -79,16 +79,16 @@ TEST(AES, Decrypt) {
};
bufferptr secret(secret_s, sizeof(secret_s));
- char cipher_s[] = {
+ unsigned char cipher_s[] = {
0xb3, 0x8f, 0x5b, 0xc9, 0x35, 0x4c, 0xf8, 0xc6,
0x13, 0x15, 0x66, 0x6f, 0x37, 0xd7, 0x79, 0x3a,
0x11, 0x90, 0x7b, 0xe9, 0xd8, 0x3c, 0x35, 0x70,
0x58, 0x7b, 0x97, 0x9b, 0x03, 0xd2, 0xa5, 0x01,
};
bufferlist cipher;
- cipher.append(cipher_s, sizeof(cipher_s));
+ cipher.append((char *)cipher_s, sizeof(cipher_s));
- char want_plaintext[] = {
+ unsigned char want_plaintext[] = {
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff,
};