From 067da16315f74bf88617e01658350789ea96c881 Mon Sep 17 00:00:00 2001 From: yanglifeng1217 Date: Fri, 30 Jun 2023 10:44:24 +0800 Subject: [PATCH] Signed-off-by: yanglifeng1217 --- ...elationalStoreAssetResultSetJsunit.test.js | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreAssetResultSetJsunit.test.js b/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreAssetResultSetJsunit.test.js index 2a433feee..2cc37c75e 100644 --- a/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreAssetResultSetJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreAssetResultSetJsunit.test.js @@ -138,6 +138,7 @@ export default function relationalStoreAssetResultSetTest() { await rdbStore.insert("test", valuesBucket); valuesBucket = { "data1": asset1, + "data3": new Array() } await rdbStore.insert("test", valuesBucket); console.log(TAG + "createTest data end"); @@ -241,17 +242,17 @@ export default function relationalStoreAssetResultSetTest() { expect(true).assertEqual(resultSet.goToNextRow()) const id = resultSet.getLong(resultSet.getColumnIndex("id")) const data2 = resultSet.getAsset(resultSet.getColumnIndex("data2")) - expect(null).assertFail(); - } catch (e) { - console.log(TAG + "testGetAsset0003 throw error: " + e.code); - expect(e.code == 14800000).assertTrue(); - } finally { + console.log(TAG + "id=" + id + ", data2=" + data2); + expect(data2).assertEqual(null); + resultSet.close(); expect(true).assertEqual(resultSet.isClosed) - resultSet = null - done(); - console.log(TAG + "************* testGetAsset0003 end *************"); + } catch (e) { + expect(null).assertFail(); } + resultSet = null + done(); + console.log(TAG + "************* testGetAsset0003 end *************"); }) /** @@ -636,19 +637,19 @@ export default function relationalStoreAssetResultSetTest() { expect(true).assertEqual(resultSet.goToNextRow()) const id = resultSet.getLong(resultSet.getColumnIndex("id")) const data3 = resultSet.getAssets(resultSet.getColumnIndex("data3")) - expect(null).assertFail(); - } catch (e) { - console.log(TAG + "testGetAssets0003 throw error" + e); - expect(e.code == 14800000).assertTrue(); - } finally { + console.log(TAG + "id=" + id + ", data3=" + data3); + expect(data3.length).assertEqual(0); + resultSet.close(); expect(true).assertEqual(resultSet.isClosed) - resultSet = null - done(); - console.log(TAG + "************* testGetAssets0003 end *************"); + } catch (e) { + expect(null).assertFail(); } + resultSet = null + done(); + console.log(TAG + "************* testGetAssets0003 end *************"); }) + console.info(TAG + "*************Unit Test End*************") }) -} - +} \ No newline at end of file -- GitLab