From 78f4e2b47d02cb8215f252e77c68a81dfe4afa30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SZ=20Lin=20=28=E6=9E=97=E4=B8=8A=E6=99=BA=29?= Date: Fri, 22 Jan 2021 14:38:03 +0800 Subject: [PATCH] Fix endian issue on s390x platform MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 7 tests from test_db.c used an int type for sqlite3_last_insert_rowid, which caused endian issue and test failed on s390 platform Signed-off-by: SZ Lin (林上智) Link: https://buildd.debian.org/status/fetch.php?pkg=tpm2-pkcs11&arch=s390x&ver=1.5.0-3&stamp=1611234144&raw=0 --- test/unit/test_db.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/unit/test_db.c b/test/unit/test_db.c index 7f11a487..d490d02f 100644 --- a/test/unit/test_db.c +++ b/test/unit/test_db.c @@ -2503,7 +2503,7 @@ static void test_db_add_token_sqlite3_finalize_fail(void **state) { { .rc = SQLITE_OK }, /* sqlite3_bind_text */ { .rc = SQLITE_OK }, /* sqlite3_bind_text */ { .rc = SQLITE_DONE }, /* sqlite3_step */ - { .rc = 42 }, /* sqlite3_last_insert_rowid*/ + { .u64 = 42 }, /* sqlite3_last_insert_rowid*/ { .rc = SQLITE_ERROR }, /* sqlite3_finalize */ { .rc = SQLITE_OK }, /* TRANSACTION_END */ { .rc = SQLITE_OK }, /* sqlite3_finalize */ @@ -2544,7 +2544,7 @@ static void test_db_add_token_sqlite3_prepare_v2_2_fail(void **state) { { .rc = SQLITE_OK }, /* sqlite3_bind_text */ { .rc = SQLITE_OK }, /* sqlite3_bind_text */ { .rc = SQLITE_DONE }, /* sqlite3_step */ - { .rc = 42 }, /* sqlite3_last_insert_rowid*/ + { .u64 = 42 }, /* sqlite3_last_insert_rowid*/ { .rc = SQLITE_OK }, /* sqlite3_finalize */ { .rc = SQLITE_ERROR }, /* sqlite3_prepare_v2 */ { .rc = SQLITE_OK }, /* TRANSACTION_END */ @@ -2586,7 +2586,7 @@ static void test_db_add_token_sqlite3_bind_int_2_fail(void **state) { { .rc = SQLITE_OK }, /* sqlite3_bind_text */ { .rc = SQLITE_OK }, /* sqlite3_bind_text */ { .rc = SQLITE_DONE }, /* sqlite3_step */ - { .rc = 42 }, /* sqlite3_last_insert_rowid*/ + { .u64 = 42 }, /* sqlite3_last_insert_rowid*/ { .rc = SQLITE_OK }, /* sqlite3_finalize */ { .rc = SQLITE_OK }, /* sqlite3_prepare_v2 */ { .rc = SQLITE_ERROR }, /* sqlite3_bind_int */ @@ -2631,7 +2631,7 @@ static void test_db_add_token_sqlite3_bind_text_3_fail(void **state) { { .rc = SQLITE_OK }, /* sqlite3_bind_text */ { .rc = SQLITE_OK }, /* sqlite3_bind_text */ { .rc = SQLITE_DONE }, /* sqlite3_step */ - { .rc = 42 }, /* sqlite3_last_insert_rowid*/ + { .u64 = 42 }, /* sqlite3_last_insert_rowid*/ { .rc = SQLITE_OK }, /* sqlite3_finalize */ { .rc = SQLITE_OK }, /* sqlite3_prepare_v2 */ { .rc = SQLITE_OK }, /* sqlite3_bind_int */ @@ -2687,7 +2687,7 @@ static void test_db_add_token_sqlite3_bind_blob_1_fail(void **state) { { .rc = SQLITE_OK }, /* sqlite3_bind_text */ { .rc = SQLITE_OK }, /* sqlite3_bind_text */ { .rc = SQLITE_DONE }, /* sqlite3_step */ - { .rc = 42 }, /* sqlite3_last_insert_rowid*/ + { .u64 = 42 }, /* sqlite3_last_insert_rowid*/ { .rc = SQLITE_OK }, /* sqlite3_finalize */ { .rc = SQLITE_OK }, /* sqlite3_prepare_v2 */ { .rc = SQLITE_OK }, /* sqlite3_bind_int */ @@ -2746,7 +2746,7 @@ static void test_db_add_token_sqlite3_bind_blob_2_fail(void **state) { { .rc = SQLITE_OK }, /* sqlite3_bind_text */ { .rc = SQLITE_OK }, /* sqlite3_bind_text */ { .rc = SQLITE_DONE }, /* sqlite3_step */ - { .rc = 42 }, /* sqlite3_last_insert_rowid*/ + { .u64 = 42 }, /* sqlite3_last_insert_rowid*/ { .rc = SQLITE_OK }, /* sqlite3_finalize */ { .rc = SQLITE_OK }, /* sqlite3_prepare_v2 */ { .rc = SQLITE_OK }, /* sqlite3_bind_int */ @@ -2807,7 +2807,7 @@ static void test_db_add_token_sqlite3_step_2_fail(void **state) { { .rc = SQLITE_OK }, /* sqlite3_bind_text */ { .rc = SQLITE_OK }, /* sqlite3_bind_text */ { .rc = SQLITE_DONE }, /* sqlite3_step */ - { .rc = 42 }, /* sqlite3_last_insert_rowid*/ + { .u64 = 42 }, /* sqlite3_last_insert_rowid*/ { .rc = SQLITE_OK }, /* sqlite3_finalize */ { .rc = SQLITE_OK }, /* sqlite3_prepare_v2 */ { .rc = SQLITE_OK }, /* sqlite3_bind_int */