diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Column/spaceChanged/Column_Space.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Column/spaceChanged/Column_Space.ets index 2e39d488fe96a223253aba887b0d52a24ccb56ab..afb1d9fe430a747ab8b85f49d31b648db36b1697 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Column/spaceChanged/Column_Space.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Column/spaceChanged/Column_Space.ets @@ -16,11 +16,11 @@ import {MessageManager,Callback} from './../../../common/MessageManager'; @Entry @Component -struct AlignStart_AddAlign { +struct Column_Space { @State addSpace: number = 10 messageManager:MessageManager = new MessageManager() onPageShow() { - console.info('AlignSpaceEvenly_NoSpace onPageShow'); + console.info('Column_Space onPageShow'); globalThis.value = { name:'messageManager',message:this.messageManager } diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Row/spaceChanged/Row_Space.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Row/spaceChanged/Row_Space.ets index e9674b11efd5571fb01dd2fe0922324413ead74f..1f2172a290d044f90b9d98b2aa3e145ab701e4e7 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Row/spaceChanged/Row_Space.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Row/spaceChanged/Row_Space.ets @@ -15,11 +15,11 @@ import {MessageManager,Callback} from '../../../common/MessageManager'; @Entry @Component -struct Row_FlexPad_TextMarPad{ +struct Row_Space{ @State addSpace: number = 5 messageManager:MessageManager = new MessageManager() onPageShow() { - console.info('AlignSpaceEvenly_NoSpace onPageShow'); + console.info('Row_Space onPageShow'); globalThis.value = { name:'messageManager',message:this.messageManager } diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Column/spaceChanged/Column_Space.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Column/spaceChanged/Column_Space.test.ets index 26b8baaff4d73b80858d2e9a3b95d47362eede0f..601965f52e0743dfe49dc7f3cf2af22702300d5c 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Column/spaceChanged/Column_Space.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Column/spaceChanged/Column_Space.test.ets @@ -57,19 +57,23 @@ export default function Column_Space() { let Column_Space_012 = CommonFunc.getComponentRect('Column_Space_012'); let Column_Space_013 = CommonFunc.getComponentRect('Column_Space_013'); let Column_Space_01 = CommonFunc.getComponentRect('Column_Space_01'); - expect(Column_Space_011.left - Column_Space_01.left).assertEqual(Column_Space_01.right - Column_Space_011.right); - expect(Column_Space_012.left - Column_Space_01.left).assertEqual(Column_Space_01.right - Column_Space_012.right); - expect(Column_Space_013.left - Column_Space_01.left).assertEqual(Column_Space_01.right - Column_Space_013.right); - expect(Column_Space_012.top - Column_Space_011.bottom).assertEqual(Column_Space_013.top - Column_Space_012.bottom) - expect(Column_Space_012.top - Column_Space_011.bottom).assertEqual(vp2px(30)); + expect(Math.round(Column_Space_011.left - Column_Space_01.left)) + .assertEqual(Math.round(Column_Space_01.right - Column_Space_011.right)); + expect(Math.round(Column_Space_012.left - Column_Space_01.left)) + .assertEqual(Math.round(Column_Space_01.right - Column_Space_012.right)); + expect(Math.round(Column_Space_013.left - Column_Space_01.left)) + .assertEqual(Math.round(Column_Space_01.right - Column_Space_013.right)); + expect(Math.round(Column_Space_012.top - Column_Space_011.bottom)) + .assertEqual(Math.round(Column_Space_013.top - Column_Space_012.bottom)); + expect(Math.round(Column_Space_012.top - Column_Space_011.bottom)).assertEqual(vp2px(30)); expect(Column_Space_01.top).assertEqual(Column_Space_011.top); expect(Column_Space_013.bottom).assertLess(Column_Space_01.bottom); - expect(Column_Space_011.bottom - Column_Space_011.top).assertEqual(vp2px(50)); - expect(Column_Space_012.bottom - Column_Space_012.top).assertEqual(vp2px(100)); - expect(Column_Space_013.bottom - Column_Space_013.top).assertEqual(vp2px(150)); - expect(Column_Space_011.right - Column_Space_011.left).assertEqual(vp2px(300)); - expect(Column_Space_012.right - Column_Space_012.left).assertEqual(vp2px(300)); - expect(Column_Space_013.right - Column_Space_013.left).assertEqual(vp2px(300)); + expect(Math.round(Column_Space_011.bottom - Column_Space_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Column_Space_012.bottom - Column_Space_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Column_Space_013.bottom - Column_Space_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Column_Space_011.right - Column_Space_011.left)).assertEqual(vp2px(300)); + expect(Math.round(Column_Space_012.right - Column_Space_012.left)).assertEqual(vp2px(300)); + expect(Math.round(Column_Space_013.right - Column_Space_013.left)).assertEqual(vp2px(300)); console.info('[SUB_ACE_COLUMN_SPACE_TEST_0100] END'); done(); }); @@ -86,19 +90,23 @@ export default function Column_Space() { let Column_Space_012 = CommonFunc.getComponentRect('Column_Space_012'); let Column_Space_013 = CommonFunc.getComponentRect('Column_Space_013'); let Column_Space_01 = CommonFunc.getComponentRect('Column_Space_01'); - expect(Column_Space_011.left - Column_Space_01.left).assertEqual(Column_Space_01.right - Column_Space_011.right); - expect(Column_Space_012.left - Column_Space_01.left).assertEqual(Column_Space_01.right - Column_Space_012.right); - expect(Column_Space_013.left - Column_Space_01.left).assertEqual(Column_Space_01.right - Column_Space_013.right); - expect(Column_Space_012.top - Column_Space_011.bottom).assertEqual(Column_Space_013.top - Column_Space_012.bottom); - expect(Column_Space_012.top - Column_Space_011.bottom).assertEqual(vp2px(50)); + expect(Math.round(Column_Space_011.left - Column_Space_01.left)) + .assertEqual(Math.round(Column_Space_01.right - Column_Space_011.right)); + expect(Math.round(Column_Space_012.left - Column_Space_01.left)) + .assertEqual(Math.round(Column_Space_01.right - Column_Space_012.right)); + expect(Math.round(Column_Space_013.left - Column_Space_01.left)) + .assertEqual(Math.round(Column_Space_01.right - Column_Space_013.right)); + expect(Math.round(Column_Space_012.top - Column_Space_011.bottom)) + .assertEqual(Math.round(Column_Space_013.top - Column_Space_012.bottom)); + expect(Math.round(Column_Space_012.top - Column_Space_011.bottom)).assertEqual(vp2px(50)); expect(Column_Space_01.top).assertEqual(Column_Space_011.top); expect(Column_Space_013.bottom).assertEqual(Column_Space_01.bottom); - expect(Column_Space_011.bottom - Column_Space_011.top).assertEqual(vp2px(50)); - expect(Column_Space_012.bottom - Column_Space_012.top).assertEqual(vp2px(100)); - expect(Column_Space_013.bottom - Column_Space_013.top).assertEqual(vp2px(150)); - expect(Column_Space_011.right - Column_Space_011.left).assertEqual(vp2px(300)); - expect(Column_Space_012.right - Column_Space_012.left).assertEqual(vp2px(300)); - expect(Column_Space_013.right - Column_Space_013.left).assertEqual(vp2px(300)); + expect(Math.round(Column_Space_011.bottom - Column_Space_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Column_Space_012.bottom - Column_Space_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Column_Space_013.bottom - Column_Space_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Column_Space_011.right - Column_Space_011.left)).assertEqual(vp2px(300)); + expect(Math.round(Column_Space_012.right - Column_Space_012.left)).assertEqual(vp2px(300)); + expect(Math.round(Column_Space_013.right - Column_Space_013.left)).assertEqual(vp2px(300)); console.info('[SUB_ACE_COLUMN_SPACE_TEST_0200] END'); done(); }); @@ -115,19 +123,23 @@ export default function Column_Space() { let Column_Space_012 = CommonFunc.getComponentRect('Column_Space_012'); let Column_Space_013 = CommonFunc.getComponentRect('Column_Space_013'); let Column_Space_01 = CommonFunc.getComponentRect('Column_Space_01'); - expect(Column_Space_011.left - Column_Space_01.left).assertEqual(Column_Space_01.right - Column_Space_011.right); - expect(Column_Space_012.left - Column_Space_01.left).assertEqual(Column_Space_01.right - Column_Space_012.right); - expect(Column_Space_013.left - Column_Space_01.left).assertEqual(Column_Space_01.right - Column_Space_013.right); - expect(Column_Space_012.top - Column_Space_011.bottom).assertEqual(Column_Space_013.top - Column_Space_012.bottom); - expect(Column_Space_012.top - Column_Space_011.bottom).assertEqual(vp2px(70)); + expect(Math.round(Column_Space_011.left - Column_Space_01.left)) + .assertEqual(Math.round(Column_Space_01.right - Column_Space_011.right)); + expect(Math.round(Column_Space_012.left - Column_Space_01.left)) + .assertEqual(Math.round(Column_Space_01.right - Column_Space_012.right)); + expect(Math.round(Column_Space_013.left - Column_Space_01.left)) + .assertEqual(Math.round(Column_Space_01.right - Column_Space_013.right)); + expect(Math.round(Column_Space_012.top - Column_Space_011.bottom)) + .assertEqual(Math.round(Column_Space_013.top - Column_Space_012.bottom)); + expect(Math.round(Column_Space_012.top - Column_Space_011.bottom)).assertEqual(vp2px(70)); expect(Column_Space_01.top).assertEqual(Column_Space_011.top); expect(Column_Space_013.bottom).assertLarger(Column_Space_01.bottom); - expect(Column_Space_011.bottom - Column_Space_011.top).assertEqual(vp2px(50)); - expect(Column_Space_012.bottom - Column_Space_012.top).assertEqual(vp2px(100)); - expect(Column_Space_013.bottom - Column_Space_013.top).assertEqual(vp2px(150)); - expect(Column_Space_011.right - Column_Space_011.left).assertEqual(vp2px(300)); - expect(Column_Space_012.right - Column_Space_012.left).assertEqual(vp2px(300)); - expect(Column_Space_013.right - Column_Space_013.left).assertEqual(vp2px(300)); + expect(Math.round(Column_Space_011.bottom - Column_Space_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Column_Space_012.bottom - Column_Space_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Column_Space_013.bottom - Column_Space_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Column_Space_011.right - Column_Space_011.left)).assertEqual(vp2px(300)); + expect(Math.round(Column_Space_012.right - Column_Space_012.left)).assertEqual(vp2px(300)); + expect(Math.round(Column_Space_013.right - Column_Space_013.left)).assertEqual(vp2px(300)); console.info('[SUB_ACE_COLUMN_SPACE_TEST_0300] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMar.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMar.test.ets index edcaa39a17cbf061d06d5199c1610d8a2ff4bfb2..832af75cbd73b9a698c986c2ef8b8e7fd423883d 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMar.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMar.test.ets @@ -65,22 +65,22 @@ export default function flex_AlignContent_SpaceAround_FlexMarTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 - expect(flexContainer.top - columnContainer.top).assertEqual(vp2px(10)); //margin =10 + expect(Math.round(flexContainer.top - columnContainer.top)).assertEqual(vp2px(10)); //margin =10 expect(firstText.left).assertEqual(secondText.left); expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); expect(fourthText.left).assertEqual(flexContainer.left); - expect(secondText.top - firstText.bottom).assertEqual(thirdText.top - secondText.bottom); - expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //行间距相等 + expect(Math.round(secondText.top - firstText.bottom)).assertEqual(Math.round(thirdText.top - secondText.bottom)); + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //行间距相等 - expect(firstText.top - flexContainer.top).assertEqual(flexContainer.bottom - fourthText.bottom); - expect(firstText.top - flexContainer.top).assertEqual((secondText.top - firstText.bottom) / 2); //上下间距是组件间距的一半 + expect(Math.round(firstText.top - flexContainer.top)).assertEqual(Math.round(flexContainer.bottom - fourthText.bottom)); + expect(Math.round(firstText.top - flexContainer.top)).assertEqual(Math.round((secondText.top - firstText.bottom) / 2)); //上下间距是组件间距的一半 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0100] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMarPad.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMarPad.test.ets index e01cb1c0da1e5e0eb27a05838999ebd11bdb312d..f1cab3394d2d59f3d0c13b3156072644133ad305 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMarPad.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMarPad.test.ets @@ -66,13 +66,13 @@ export default function flex_AlignContent_SpaceAround_FlexMarPadTest() { expect(flexContainerObj.$type).assertEqual('Flex'); expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(150)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200 - expect(flexContainer.top - columnContainer.top).assertEqual(vp2px(20)); //margin =20 - expect(firstText.top - flexContainer.top).assertEqual(vp2px(50)); - expect(firstText.left - flexContainer.left).assertEqual(vp2px(50)); //padding =50 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(150)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200 + expect(Math.round(flexContainer.top - columnContainer.top)).assertEqual(vp2px(20)); //margin =20 + expect(Math.round(firstText.top - flexContainer.top)).assertEqual(vp2px(50)); + expect(Math.round(firstText.left - flexContainer.left)).assertEqual(vp2px(50)); //padding =50 expect(firstText.left).assertEqual(secondText.left); expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); @@ -80,7 +80,7 @@ export default function flex_AlignContent_SpaceAround_FlexMarPadTest() { expect(firstText.bottom).assertEqual(secondText.top); expect(secondText.bottom).assertEqual(thirdText.top); expect(thirdText.bottom).assertEqual(fourthText.top); //无行间距 - expect(fourthText.bottom - flexContainer.bottom).assertEqual(vp2px(10)); //行首贴边行尾溢出 + expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(10)); //行首贴边行尾溢出 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0200] END'); done(); }); @@ -107,21 +107,22 @@ export default function flex_AlignContent_SpaceAround_FlexMarPadTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(150)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(150)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200 - expect(firstText.left - flexContainer.left).assertEqual(vp2px(10)); //padding =10 - expect(flexContainer.top - columnContainer.top).assertEqual(vp2px(30)); //margin =30 + expect(Math.round(firstText.left - flexContainer.left)).assertEqual(vp2px(10)); //padding =10 + expect(Math.round(flexContainer.top - columnContainer.top)).assertEqual(vp2px(30)); //margin =30 expect(firstText.left).assertEqual(secondText.left); expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); - expect(flexContainer.bottom - fourthText.bottom).assertEqual(firstText.top - flexContainer.top); //行首行尾间距相等 + expect(Math.round(flexContainer.bottom - fourthText.bottom)) + .assertEqual(Math.round(firstText.top - flexContainer.top)); //行首行尾间距相等 - expect(secondText.top - firstText.bottom).assertEqual(thirdText.top - secondText.bottom); - expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //行间距相等 - expect((thirdText.top - secondText.bottom) / 2).assertEqual(firstText.top - flexContainer.top - vp2px(10)) + expect(Math.round(secondText.top - firstText.bottom)).assertEqual(Math.round(thirdText.top - secondText.bottom)); + expect(Math.round((thirdText.top - secondText.bottom) / 2)) + .assertEqual(Math.round(firstText.top - flexContainer.top - vp2px(10))) console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0300] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexPad.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexPad.test.ets index 3bd8b28b55c8c63727dab1e34ae3bd5b2041b8f4..51d192385e1bc8e9f0d14e5d50c87807bb3249ca 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexPad.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexPad.test.ets @@ -63,12 +63,12 @@ export default function flex_AlignContent_SpaceAround_FlexPadTest() { expect(flexContainerObj.$type).assertEqual('Flex'); expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(150)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(150)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200 - expect(firstText.left - flexContainer.left).assertEqual(vp2px(50)); //padding =50 + expect(Math.round(firstText.left - flexContainer.left)).assertEqual(vp2px(50)); //padding =50 expect(firstText.left).assertEqual(secondText.left); expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); @@ -76,7 +76,7 @@ export default function flex_AlignContent_SpaceAround_FlexPadTest() { expect(firstText.bottom).assertEqual(secondText.top); expect(secondText.bottom).assertEqual(thirdText.top); expect(thirdText.bottom).assertEqual(fourthText.top); //无行间距 - expect(fourthText.bottom - flexContainer.bottom).assertEqual(vp2px(10)); //行首贴边行尾溢出 + expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(10)); //行首贴边行尾溢出 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0400] END'); done(); }); @@ -101,20 +101,21 @@ export default function flex_AlignContent_SpaceAround_FlexPadTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(150)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(150)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200 - expect(firstText.left - flexContainer.left).assertEqual(vp2px(10)); //padding =10 + expect(Math.round(firstText.left - flexContainer.left)).assertEqual(vp2px(10)); //padding =10 expect(firstText.left).assertEqual(secondText.left); expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); - expect(flexContainer.bottom - fourthText.bottom).assertEqual(firstText.top - flexContainer.top); //行首行尾间距相等 + expect(Math.round(flexContainer.bottom - fourthText.bottom)).assertEqual(Math.round(firstText.top - flexContainer.top)); //行首行尾间距相等 - expect(secondText.top - firstText.bottom).assertEqual(thirdText.top - secondText.bottom); - expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //行间距相等 - expect((thirdText.top - secondText.bottom) / 2).assertEqual(firstText.top - flexContainer.top - vp2px(10)); + expect(Math.round(secondText.top - firstText.bottom)).assertEqual(Math.round(thirdText.top - secondText.bottom)); + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //行间距相等 + expect(Math.round((thirdText.top - secondText.bottom) / 2)) + .assertEqual(Math.round(firstText.top - flexContainer.top - vp2px(10))); console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0500] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexSize.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexSize.test.ets index fdb9eb76b834598257bd4cf32937084bd6f4a14a..88404bfee24056b6e7fd6e21e3e45d23c964418d 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexSize.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexSize.test.ets @@ -65,20 +65,22 @@ export default function flex_AlignContent_SpaceAround_FlexSizeTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 expect(firstText.left).assertEqual(secondText.left); expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); expect(fourthText.left).assertEqual(flexContainer.left); - expect(secondText.top - firstText.bottom).assertEqual(thirdText.top - secondText.bottom); - expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //行间距相等 - expect(firstText.top - flexContainer.top).assertEqual(flexContainer.bottom - fourthText.bottom); - expect(firstText.top - flexContainer.top).assertEqual((secondText.top - firstText.bottom) / 2); //上下间距是组件间距的一半 + expect(Math.round(secondText.top - firstText.bottom)).assertEqual(Math.round(thirdText.top - secondText.bottom)); + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //行间距相等 + expect(Math.round(firstText.top - flexContainer.top)) + .assertEqual(Math.round(flexContainer.bottom - fourthText.bottom)); + expect(Math.round(firstText.top - flexContainer.top)) + .assertEqual(Math.round((secondText.top - firstText.bottom) / 2)); //上下间距是组件间距的一半 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0600] END'); done(); }); @@ -104,10 +106,10 @@ export default function flex_AlignContent_SpaceAround_FlexSizeTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 expect(firstText.bottom).assertEqual(secondText.top); expect(secondText.bottom).assertEqual(thirdText.top); @@ -118,7 +120,7 @@ export default function flex_AlignContent_SpaceAround_FlexSizeTest() { expect(thirdText.left).assertEqual(fourthText.left); expect(fourthText.left).assertEqual(flexContainer.left); expect(firstText.top).assertEqual(flexContainer.top); - expect(fourthText.bottom - flexContainer.bottom).assertEqual(vp2px(50)); //行首贴边行尾溢出 + expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(50)); //行首贴边行尾溢出 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0700] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextMar.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextMar.test.ets index ac76f16758b181522de85fe1e23efedee2819177..4fef91ed43c52e2324ed9c27befadcdb605f44e7 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextMar.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextMar.test.ets @@ -63,20 +63,20 @@ export default function flex_AlignContent_SpaceAround_TextMarTest() { expect(flexContainerObj.$type).assertEqual('Flex'); expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 - expect(firstText.left - flexContainer.left).assertEqual(vp2px(65)); //margin =65 + expect(Math.round((firstText.left - flexContainer.left)*10)/10).assertEqual(Math.round(vp2px(65)*10)/10); //margin =65 expect(flexContainer.left).assertEqual(secondText.left); expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); - expect(secondText.top - firstText.bottom).assertEqual(vp2px(65)); + expect(Math.round((secondText.top - firstText.bottom)*10)/10).assertEqual(Math.round(vp2px(65)*10)/10); expect(secondText.bottom).assertEqual(thirdText.top); expect(thirdText.bottom).assertEqual(fourthText.top); //无行间距 - expect(fourthText.bottom - flexContainer.bottom).assertEqual(vp2px(30)); //行首贴边行尾溢出 + expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(30)); //行首贴边行尾溢出 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0800] END'); done(); }); @@ -101,19 +101,22 @@ export default function flex_AlignContent_SpaceAround_TextMarTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 - expect(firstText.left - flexContainer.left).assertEqual(vp2px(10)); //margin =10 + expect(Math.round(firstText.left - flexContainer.left)).assertEqual(vp2px(10)); //margin =10 expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); - expect(firstText.top - flexContainer.top - vp2px(10)).assertEqual(flexContainer.bottom - fourthText.bottom); + expect(Math.round(firstText.top - flexContainer.top - vp2px(10))) + .assertEqual(Math.round(flexContainer.bottom - fourthText.bottom)); - expect(secondText.top - firstText.bottom - vp2px(10)).assertEqual(thirdText.top - secondText.bottom); - expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //行间距相等 - expect(flexContainer.bottom - fourthText.bottom).assertEqual((fourthText.top - thirdText.bottom) / 2); //行首行尾距离是组件间距的一半 + expect(Math.round(secondText.top - firstText.bottom - vp2px(10))) + .assertEqual(Math.round(thirdText.top - secondText.bottom)); + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //行间距相等 + expect(Math.round(flexContainer.bottom - fourthText.bottom)) + .assertEqual(Math.round((fourthText.top - thirdText.bottom) / 2)); //行首行尾距离是组件间距的一半 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0900] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextOffset.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextOffset.test.ets index 75104f40b7713c086f122830001032ada561d5ad..d98c0e820ec22c762f9999816ffa4e211826358b 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextOffset.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextOffset.test.ets @@ -70,22 +70,22 @@ export default function flex_AlignContent_SpaceAround_TextOffsetTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 - expect(firstText.top - firstTextTop).assertEqual(vp2px(10)); - expect(firstText.left - firstTextLeft).assertEqual(vp2px(10)); //offset =10 + expect(Math.round(firstText.top - firstTextTop)).assertEqual(vp2px(10)); + expect(Math.round(firstText.left - firstTextLeft)).assertEqual(vp2px(10)); //offset =10 expect(secondText.top).assertEqual(secondTextTop); expect(flexContainer.left).assertEqual(secondText.left); expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); - expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); - expect(thirdText.top - secondText.bottom).assertEqual(distanceBefore); - expect(flexContainer.bottom - fourthText.bottom).assertEqual(distanceBefore / 2); //其余组件行间距相等,未改变 + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(distanceBefore)); + expect(Math.round(flexContainer.bottom - fourthText.bottom)).assertEqual(Math.round(distanceBefore / 2)); //其余组件行间距相等,未改变 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1000] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextSize.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextSize.test.ets index ce0369334744af5cdde63cfd0034a8185a74615c..d901ca4a691123a6006f300fb43833b941e708d0 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextSize.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextSize.test.ets @@ -64,21 +64,23 @@ export default function flex_AlignContent_SpaceAround_TextSizeTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(70)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为70、100、50、100 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(70)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为70、100、50、100 expect(firstText.left).assertEqual(secondText.left); expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); expect(fourthText.left).assertEqual(flexContainer.left); - expect(secondText.top - firstText.bottom).assertEqual(thirdText.top - secondText.bottom); - expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //行间距相等 + expect(Math.round(secondText.top - firstText.bottom)).assertEqual(Math.round(thirdText.top - secondText.bottom)); + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //行间距相等 - expect(firstText.top - flexContainer.top).assertEqual(flexContainer.bottom - fourthText.bottom); - expect(firstText.top - flexContainer.top).assertEqual((secondText.top - firstText.bottom) / 2); + expect(Math.round(firstText.top - flexContainer.top)) + .assertEqual(Math.round(flexContainer.bottom - fourthText.bottom)); + expect(Math.round(firstText.top - flexContainer.top)) + .assertEqual(Math.round((secondText.top - firstText.bottom) / 2)); console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1100] END'); done(); }); @@ -103,10 +105,10 @@ export default function flex_AlignContent_SpaceAround_TextSizeTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(200)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为200、100、50、100 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(200)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为200、100、50、100 expect(firstText.bottom).assertEqual(secondText.top); expect(secondText.bottom).assertEqual(thirdText.top); @@ -118,7 +120,7 @@ export default function flex_AlignContent_SpaceAround_TextSizeTest() { expect(fourthText.left).assertEqual(flexContainer.left); //子组件靠左 expect(firstText.top).assertEqual(flexContainer.top); - expect(fourthText.bottom - flexContainer.bottom).assertEqual(vp2px(50)); //行首贴边行尾溢出 + expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(50)); //行首贴边行尾溢出 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1200] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextVisibility.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextVisibility.test.ets index 0b87ea7884cf621f81f5081b4efd583b12d21cc1..d8ae6892d11e0136349cddecbd143a54655fb052 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextVisibility.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextVisibility.test.ets @@ -66,18 +66,20 @@ export default function flex_AlignContent_SpaceAround_TextVisibilityTest() { expect(flexContainerObj.$type).assertEqual('Flex'); expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround'); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //三个子组件的高度分别为100、50、100 + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //三个子组件的高度分别为100、50、100 expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); expect(fourthText.left).assertEqual(flexContainer.left); - expect(secondText.top - flexContainer.top).assertEqual(distanceBefore * 1.5 + vp2px(50)); //text1占位 + expect(Math.round((secondText.top - flexContainer.top)*100)/100) + .assertEqual(Math.round((distanceBefore * 1.5 + vp2px(50))*100)/100); //text1占位 - expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //剩余子组件行间距相等 - expect(thirdText.top - secondText.bottom).assertEqual(distanceBefore); //子组件距离不变 - expect(flexContainer.bottom -fourthText.bottom).assertEqual(distanceBefore / 2); //行首距离为子组件距离一半 + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //剩余子组件行间距相等 + expect(Math.round((thirdText.top - secondText.bottom)*10)/10).assertEqual(Math.round(distanceBefore*10)/10); //子组件距离不变 + expect(Math.round((flexContainer.bottom -fourthText.bottom)*100)/100) + .assertEqual(Math.round((distanceBefore / 2)*100)/100); //行首距离为子组件距离一半 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1300] END'); done(); }); @@ -91,7 +93,7 @@ export default function flex_AlignContent_SpaceAround_TextVisibilityTest() { console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1400] START'); let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility01'); let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility02'); - let distanceBefore = secondText.top - firstText.bottom; + let distanceBefore = Math.round(secondText.top - firstText.bottom); globalThis.value.message.notify({name:'visibility', value:Visibility.None}) await CommonFunc.sleep(3000); secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility02'); @@ -104,19 +106,21 @@ export default function flex_AlignContent_SpaceAround_TextVisibilityTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround'); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //三个子组件的高度分别为100、50、100 + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //三个子组件的高度分别为100、50、100 expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); expect(fourthText.left).assertEqual(flexContainer.left); - expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //剩余子组件行间距相等 - expect(thirdText.top - secondText.bottom).assertLarger(distanceBefore); //行距大于设置前 + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //剩余子组件行间距相等 + expect(Math.round(thirdText.top - secondText.bottom)).assertLarger(distanceBefore); //行距大于设置前 - expect(secondText.top - flexContainer.top).assertEqual(flexContainer.bottom - fourthText.bottom); //text1不参与占位 - expect(secondText.top - flexContainer.top).assertEqual((thirdText.top - secondText.bottom) / 2); //行首行尾间距为子组件间距一半 + expect(Math.round(secondText.top - flexContainer.top)) + .assertEqual(Math.round(flexContainer.bottom - fourthText.bottom)); //text1不参与占位 + expect(Math.round(secondText.top - flexContainer.top)) + .assertEqual(Math.round((thirdText.top - secondText.bottom) / 2)); //行首行尾间距为子组件间距一半 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1400] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexMar.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexMar.test.ets index 4bcf919e46b243e9a115eb5c611f2221fb000265..1b5e8d8bed08533bf2dd7adede2fd272acd029dc 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexMar.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexMar.test.ets @@ -65,11 +65,11 @@ export default function flex_AlignContent_SpaceBetween_FlexMarTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceBetween'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(150)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200 - expect(flexContainer.top - columnContainer.top).assertEqual(vp2px(10)); //margin =10 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(150)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200 + expect(Math.round(flexContainer.top - columnContainer.top)).assertEqual(vp2px(10)); //margin =10 expect(firstText.left).assertEqual(flexContainer.left); expect(firstText.left).assertEqual(secondText.left); @@ -79,8 +79,8 @@ export default function flex_AlignContent_SpaceBetween_FlexMarTest() { expect(firstText.top).assertEqual(flexContainer.top); expect(fourthText.bottom).assertEqual(flexContainer.bottom); //行首行尾贴边 - expect(secondText.top - firstText.bottom).assertEqual(thirdText.top - secondText.bottom); - expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //行间距相等 + expect(Math.round(secondText.top - firstText.bottom)).assertEqual(Math.round(thirdText.top - secondText.bottom)); + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //行间距相等 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_0100] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexMarPad.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexMarPad.test.ets index 386466875a2561711f20cc5fbe950994f057d5c0..43fdc3a3c58600458fc8c7339de53ca62ac3e8a3 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexMarPad.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexMarPad.test.ets @@ -67,14 +67,14 @@ export default function flex_AlignContent_SpaceBetween_FlexMarPadTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceBetween'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(150)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(150)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200 - expect(flexContainer.top - columnContainer.left).assertEqual(vp2px(20)); //margin =20 - expect(firstText.top - flexContainer.top).assertEqual(vp2px(50)); - expect(firstText.left - flexContainer.left).assertEqual(vp2px(50)); //padding =50 + expect(Math.round(flexContainer.top - columnContainer.left)).assertEqual(vp2px(20)); //margin =20 + expect(Math.round(firstText.top - flexContainer.top)).assertEqual(vp2px(50)); + expect(Math.round(firstText.left - flexContainer.left)).assertEqual(vp2px(50)); //padding =50 expect(firstText.left).assertEqual(secondText.left); expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); @@ -82,7 +82,7 @@ export default function flex_AlignContent_SpaceBetween_FlexMarPadTest() { expect(firstText.bottom).assertEqual(secondText.top); expect(secondText.bottom).assertEqual(thirdText.top); expect(thirdText.bottom).assertEqual(fourthText.top); //无行间距 - expect(fourthText.bottom - flexContainer.bottom).assertEqual(vp2px(10)); //行首贴边行尾溢出 + expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(10)); //行首贴边行尾溢出 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_0200] END'); done(); }); @@ -109,21 +109,21 @@ export default function flex_AlignContent_SpaceBetween_FlexMarPadTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceBetween'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(150)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(150)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200 - expect(firstText.top - flexContainer.top).assertEqual(vp2px(10)); - expect(firstText.left - flexContainer.left).assertEqual(vp2px(10)); //padding =10 - expect(flexContainer.top - columnContainer.left).assertEqual(vp2px(30)); //margin =30 + expect(Math.round(firstText.top - flexContainer.top)).assertEqual(vp2px(10)); + expect(Math.round(firstText.left - flexContainer.left)).assertEqual(vp2px(10)); //padding =10 + expect(Math.round(flexContainer.top - columnContainer.left)).assertEqual(vp2px(30)); //margin =30 expect(firstText.left).assertEqual(secondText.left); expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); - expect(flexContainer.bottom - fourthText.bottom).assertEqual(vp2px(10)); + expect(Math.round(flexContainer.bottom - fourthText.bottom)).assertEqual(vp2px(10)); - expect(secondText.top - firstText.bottom).assertEqual(thirdText.top - secondText.bottom); - expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //行间距相等 + expect(Math.round(secondText.top - firstText.bottom)).assertEqual(Math.round(thirdText.top - secondText.bottom)); + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //行间距相等 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_0300] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexPad.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexPad.test.ets index 4920f5fb734e7903e2b619a00247a55734e7b483..4c3a96a483f0595a46d93790bb75976e4af5a8fe 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexPad.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexPad.test.ets @@ -64,13 +64,13 @@ export default function flex_AlignContent_SpaceBetween_FlexPadTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceBetween'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(150)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(150)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200 - expect(firstText.top - flexContainer.top).assertEqual(vp2px(50)); //padding =50 - expect(firstText.left - flexContainer.left).assertEqual(vp2px(50)); //padding =50 + expect(Math.round(firstText.top - flexContainer.top)).assertEqual(vp2px(50)); //padding =50 + expect(Math.round(firstText.left - flexContainer.left)).assertEqual(vp2px(50)); //padding =50 expect(firstText.left).assertEqual(secondText.left); expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); @@ -78,7 +78,7 @@ export default function flex_AlignContent_SpaceBetween_FlexPadTest() { expect(firstText.bottom).assertEqual(secondText.top); expect(secondText.bottom).assertEqual(thirdText.top); expect(thirdText.bottom).assertEqual(fourthText.top); //无行间距 - expect(fourthText.bottom - flexContainer.bottom).assertEqual(vp2px(10)); //行首贴边行尾溢出 + expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(10)); //行首贴边行尾溢出 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_0400] END'); done(); }); @@ -102,20 +102,20 @@ export default function flex_AlignContent_SpaceBetween_FlexPadTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceBetween'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(150)); + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(150)); expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200 - expect(firstText.left - flexContainer.left).assertEqual(vp2px(10)); //padding =10 + expect(Math.round(firstText.left - flexContainer.left)).assertEqual(vp2px(10)); //padding =10 expect(firstText.left).assertEqual(secondText.left); expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); - expect(firstText.top - flexContainer.top).assertEqual(vp2px(10)); - expect(flexContainer.bottom - fourthText.bottom).assertEqual(vp2px(10)); //行首偏移行尾未溢出 + expect(Math.round(firstText.top - flexContainer.top)).assertEqual(vp2px(10)); + expect(Math.round(flexContainer.bottom - fourthText.bottom)).assertEqual(vp2px(10)); //行首偏移行尾未溢出 - expect(secondText.top - firstText.bottom).assertEqual(thirdText.top - secondText.bottom); - expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //行间距相等 + expect(Math.round(secondText.top - firstText.bottom)).assertEqual(Math.round(thirdText.top - secondText.bottom)); + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //行间距相等 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_0500] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexSize.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexSize.test.ets index 95b8d8d0d66b1d2f3284ab7d127539247c845d66..7829812c4a8223274b76d4faea1f1e4223e87a29 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexSize.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexSize.test.ets @@ -65,10 +65,10 @@ export default function flex_AlignContent_SpaceBetween_FlexSizeTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceBetween'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 expect(firstText.left).assertEqual(secondText.left); expect(secondText.left).assertEqual(thirdText.left); @@ -77,8 +77,8 @@ export default function flex_AlignContent_SpaceBetween_FlexSizeTest() { expect(firstText.top).assertEqual(flexContainer.top); expect(fourthText.bottom).assertEqual(flexContainer.bottom); //行首行尾贴边 - expect(secondText.top - firstText.bottom).assertEqual(thirdText.top - secondText.bottom); - expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //行间距相等 + expect(Math.round(secondText.top - firstText.bottom)).assertEqual(Math.round(thirdText.top - secondText.bottom)); + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //行间距相等 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_0600] END'); done(); }); @@ -104,10 +104,10 @@ export default function flex_AlignContent_SpaceBetween_FlexSizeTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceBetween'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 expect(firstText.top).assertEqual(flexContainer.top); expect(firstText.bottom).assertEqual(secondText.top); @@ -119,7 +119,7 @@ export default function flex_AlignContent_SpaceBetween_FlexSizeTest() { expect(thirdText.left).assertEqual(fourthText.left); expect(fourthText.left).assertEqual(flexContainer.left); - expect(fourthText.bottom - flexContainer.bottom).assertEqual(vp2px(50)); //行首贴边行尾溢出 + expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(50)); //行首贴边行尾溢出 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_0700] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextMar.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextMar.test.ets index 4ba85a68ccb65a726b6b30a8d18533819fd8e785..2047916b51a56f172a76388863130c67ae8d2d7d 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextMar.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextMar.test.ets @@ -64,21 +64,21 @@ export default function flex_AlignContent_SpaceBetween_TextMarTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceBetween'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 - expect(firstText.top - flexContainer.top).assertEqual(vp2px(65)); //margin =65 - expect(firstText.left - flexContainer.left).assertEqual(vp2px(65)); //margin =65 + expect(Math.round((firstText.top - flexContainer.top)*10)/10).assertEqual(Math.round(vp2px(65)*10)/10); //margin =65 + expect(Math.round((firstText.left - flexContainer.left)*10)/10).assertEqual(Math.round(vp2px(65)*10)/10); //margin =65 expect(flexContainer.left).assertEqual(secondText.left); expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); - expect(secondText.top - firstText.bottom).assertEqual(vp2px(65)); + expect(Math.round((secondText.top - firstText.bottom)*10)/10).assertEqual(Math.round(vp2px(65)*10)/10); expect(secondText.bottom).assertEqual(thirdText.top); expect(thirdText.bottom).assertEqual(fourthText.top); //无行间距 - expect(fourthText.bottom - flexContainer.bottom).assertEqual(vp2px(30)); //行首贴边行尾溢出 + expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(30)); //行首贴边行尾溢出 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_0800] END'); done(); }); @@ -103,20 +103,20 @@ export default function flex_AlignContent_SpaceBetween_TextMarTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceBetween'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 - expect(firstText.left - flexContainer.left).assertEqual(vp2px(10)); //margin =10 + expect(Math.round(firstText.left - flexContainer.left)).assertEqual(vp2px(10)); //margin =10 expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); expect(fourthText.left).assertEqual(flexContainer.left); - expect(firstText.top - flexContainer.top).assertEqual(vp2px(10)); + expect(Math.round(firstText.top - flexContainer.top)).assertEqual(vp2px(10)); expect(flexContainer.bottom).assertEqual(fourthText.bottom); //行首偏移行尾未溢出 - expect(secondText.top - firstText.bottom - vp2px(10)).assertEqual(thirdText.top - secondText.bottom); - expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //行间距相等 + expect(Math.round(secondText.top - firstText.bottom - vp2px(10))).assertEqual(Math.round(thirdText.top - secondText.bottom)); + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //行间距相等 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_0900] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextOffset.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextOffset.test.ets index 8cd50c04f451e77f1b2c95fec1e841e0ca87a3f3..713803b11af3341405daefa92ab118e259241b4e 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextOffset.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextOffset.test.ets @@ -68,20 +68,20 @@ export default function flex_AlignContent_SpaceBetween_TextOffsetTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceBetween'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(50)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100 - expect(firstText.top - flexContainer.top).assertEqual(vp2px(10)); - expect(firstText.left - flexContainer.left).assertEqual(vp2px(10)); //offset =10 + expect(Math.round(firstText.top - flexContainer.top)).assertEqual(vp2px(10)); + expect(Math.round(firstText.left - flexContainer.left)).assertEqual(vp2px(10)); //offset =10 expect(flexContainer.left).assertEqual(secondText.left); expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); expect(fourthText.bottom).assertEqual(flexContainer.bottom); //行首贴边行尾溢出 - expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); - expect(thirdText.top - secondText.bottom).assertEqual(distanceBefore); + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(distanceBefore); console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_1000] END');//其余组件行间距相等,未改变 done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextSize.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextSize.test.ets index 6d303ee08b792f5bcc2c59812b895be6ba118406..76bcf4915cf987bb897d82f3f77b03c5fbaf5436 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextSize.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextSize.test.ets @@ -64,10 +64,10 @@ export default function flex_AlignContent_SpaceBetween_TextSizeTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceBetween'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(70)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为70、100、50、100 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(70)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为70、100、50、100 expect(firstText.left).assertEqual(secondText.left); expect(secondText.left).assertEqual(thirdText.left); @@ -76,8 +76,8 @@ export default function flex_AlignContent_SpaceBetween_TextSizeTest() { expect(firstText.top).assertEqual(flexContainer.top); expect(fourthText.bottom).assertEqual(flexContainer.bottom); //行首行尾贴边 - expect(secondText.top - firstText.bottom).assertEqual(thirdText.top - secondText.bottom); - expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //行间距相等 + expect(Math.round(secondText.top - firstText.bottom)).assertEqual(Math.round(thirdText.top - secondText.bottom)); + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //行间距相等 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_1100] END'); done(); }); @@ -102,10 +102,10 @@ export default function flex_AlignContent_SpaceBetween_TextSizeTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceBetween'); - expect(firstText.bottom - firstText.top).assertEqual(vp2px(200)); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为200、100、50、100 + expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(200)); + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为200、100、50、100 expect(firstText.bottom).assertEqual(secondText.top); expect(secondText.bottom).assertEqual(thirdText.top); @@ -117,7 +117,7 @@ export default function flex_AlignContent_SpaceBetween_TextSizeTest() { expect(fourthText.left).assertEqual(flexContainer.left); expect(firstText.top).assertEqual(flexContainer.top); - expect(fourthText.bottom - flexContainer.bottom).assertEqual(vp2px(50)); //行首贴边行尾溢出 + expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(50)); //行首贴边行尾溢出 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_1200] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextVisibility.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextVisibility.test.ets index 5c2bbd8be377bd432335ba784dfe6a272a8755ca..69efc98cba10f241fefe9fd59a812b374d942281 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextVisibility.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextVisibility.test.ets @@ -67,18 +67,18 @@ export default function flex_AlignContent_SpaceBetween_TextVisibilityTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceBetween'); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //三个子组件的高度分别为100、50、100 + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //三个子组件的高度分别为100、50、100 expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); expect(fourthText.left).assertEqual(flexContainer.left); - expect(secondText.top - flexContainer.top).assertEqual(distanceBefore + vp2px(50)); //text1占位 + expect(Math.round(secondText.top - flexContainer.top)).assertEqual(Math.round(distanceBefore + vp2px(50))); //text1占位 expect(fourthText.bottom).assertEqual(flexContainer.bottom); //行首行尾贴边 - expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //剩余子组件行间距相等 - expect(thirdText.top - secondText.bottom).assertEqual(distanceBefore); + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //剩余子组件行间距相等 + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(distanceBefore)); console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_1300] END'); done(); }); @@ -105,9 +105,9 @@ export default function flex_AlignContent_SpaceBetween_TextVisibilityTest() { expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap'); expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceBetween'); - expect(secondText.bottom - secondText.top).assertEqual(vp2px(100)); - expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50)); - expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //三个子组件的高度分别为100、50、100 + expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)); + expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)); + expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //三个子组件的高度分别为100、50、100 expect(secondText.left).assertEqual(thirdText.left); expect(thirdText.left).assertEqual(fourthText.left); @@ -115,8 +115,8 @@ export default function flex_AlignContent_SpaceBetween_TextVisibilityTest() { expect(secondText.top).assertEqual(flexContainer.top); //text1不参与占位 expect(fourthText.bottom).assertEqual(flexContainer.bottom); //行首行尾贴边 - expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //剩余子组件行间距相等 - expect(thirdText.top - secondText.bottom).assertLarger(distanceBefore); //行距大于设置前 + expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //剩余子组件行间距相等 + expect(Math.round(thirdText.top - secondText.bottom)).assertLarger(Math.round(distanceBefore)); //行距大于设置前 console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_1400] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexAlignSelfJsunit.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexAlignSelfJsunit.test.ets index 618e31471a7a45b4ff9bae5abec535b8ab36123b..ecb37cbe8f8c587bc7eb8132d7f0aa477908f1c5 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexAlignSelfJsunit.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexAlignSelfJsunit.test.ets @@ -46,12 +46,12 @@ export default function flexAlignSelf_AutoJsunit() { }); /** - * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_1200 + * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_1300 * @tc.name ItemAlign_Auto_FlexAlignSelf - * @tc.desc aceFlexAlignItemTest + * @tc.desc The first subcomponent set ItemAlign.End attribute. */ - it('SUB_ACE_FLEXALIGNITEMS_AUTO_1200', 0, async function (done) { - console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1200 START'); + it('SUB_ACE_FLEXALIGNITEMS_AUTO_1300', 0, async function (done) { + console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1300 START'); let strJson1 = getInspectorByKey('flexAlignSelf'); let obj1 = JSON.parse(strJson1); let strJson2 = getInspectorByKey('textAlignSelf01'); @@ -66,17 +66,17 @@ export default function flexAlignSelf_AutoJsunit() { expect(textAlignSelf02.top).assertEqual(textAlignSelf03.top) expect(textAlignSelf01.bottom).assertEqual(flexAlignSelf01.bottom) - expect(textAlignSelf01.bottom - textAlignSelf01.top).assertEqual(vp2px(50)) - expect(textAlignSelf01.right - textAlignSelf01.left).assertEqual(vp2px(150)) - expect(textAlignSelf02.bottom - textAlignSelf02.top).assertEqual(vp2px(100)) - expect(textAlignSelf02.right - textAlignSelf02.left).assertEqual(vp2px(150)) - expect(textAlignSelf03.bottom - textAlignSelf03.top).assertEqual(vp2px(150)) - expect(textAlignSelf03.right - textAlignSelf03.left).assertEqual(vp2px(150)) + expect(Math.round(textAlignSelf01.bottom - textAlignSelf01.top)).assertEqual(vp2px(50)) + expect(Math.round(textAlignSelf01.right - textAlignSelf01.left)).assertEqual(vp2px(150)) + expect(Math.round(textAlignSelf02.bottom - textAlignSelf02.top)).assertEqual(vp2px(100)) + expect(Math.round(textAlignSelf02.right - textAlignSelf02.left)).assertEqual(vp2px(150)) + expect(Math.round(textAlignSelf03.bottom - textAlignSelf03.top)).assertEqual(vp2px(150)) + expect(Math.round(textAlignSelf03.right - textAlignSelf03.left)).assertEqual(vp2px(150)) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto') expect(obj2.$attrs.alignSelf).assertEqual("ItemAlign.End") - console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1200 END'); + console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1300 END'); done(); }); }) diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexBaseJsunit.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexBaseJsunit.test.ets index d2a018cc381b31072f9e3f4271dc401818e9a13e..862d6065377b50d4affc3d03b66eeb578c3524a9 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexBaseJsunit.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexBaseJsunit.test.ets @@ -47,7 +47,7 @@ export default function flexBase_AutoJsunit() { /** * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_0100 * @tc.name ItemAlign_Auto_FlexBase - * @tc.desc aceFlexAlignItemTest + * @tc.desc The subcomponent is inside the parent component. */ it('SUB_ACE_FLEXALIGNITEMS_AUTO_0100', 0, async function (done) { console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0100 START'); @@ -66,14 +66,14 @@ export default function flexBase_AutoJsunit() { expect(textFlex01.right).assertEqual(textFlex02.left) expect(textFlex02.right).assertEqual(textFlex03.left) - expect(flex01.right - textFlex03.right).assertEqual(vp2px(50)) + expect(Math.round(flex01.right - textFlex03.right)).assertEqual(vp2px(50)) - expect(textFlex01.bottom - textFlex01.top).assertEqual(vp2px(50)) - expect(textFlex02.bottom - textFlex02.top).assertEqual(vp2px(100)) - expect(textFlex03.bottom - textFlex03.top).assertEqual(vp2px(150)) - expect(textFlex01.right - textFlex01.left).assertEqual(vp2px(150)) - expect(textFlex02.right - textFlex02.left).assertEqual(vp2px(150)) - expect(textFlex03.right - textFlex03.left).assertEqual(vp2px(150)) + expect(Math.round(textFlex01.bottom - textFlex01.top)).assertEqual(vp2px(50)) + expect(Math.round(textFlex02.bottom - textFlex02.top)).assertEqual(vp2px(100)) + expect(Math.round(textFlex03.bottom - textFlex03.top)).assertEqual(vp2px(150)) + expect(Math.round(textFlex01.right - textFlex01.left)).assertEqual(vp2px(150)) + expect(Math.round(textFlex02.right - textFlex02.left)).assertEqual(vp2px(150)) + expect(Math.round(textFlex03.right - textFlex03.left)).assertEqual(vp2px(150)) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto') console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0100 END'); @@ -83,7 +83,7 @@ export default function flexBase_AutoJsunit() { /** * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_0200 * @tc.name ItemAlign_Auto_FlexBase - * @tc.desc aceFlexAlignItemTest + * @tc.desc The subcomponent exceeds the parent component. */ it('SUB_ACE_FLEXALIGNITEMS_AUTO_0200', 0, async function (done) { console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0200 START'); @@ -102,12 +102,12 @@ export default function flexBase_AutoJsunit() { expect(textFlex03.right).assertEqual(flex01.right) expect(textFlex03.bottom).assertLarger(flex01.bottom) - expect(textFlex01.bottom - textFlex01.top).assertEqual(vp2px(50)) - expect(textFlex02.bottom - textFlex02.top).assertEqual(vp2px(100)) - expect(textFlex03.bottom - textFlex03.top).assertEqual(vp2px(150)) - expect(textFlex01.right - textFlex01.left).assertEqual(vp2px(140)) - expect(textFlex02.right - textFlex02.left).assertEqual(vp2px(140)) - expect(textFlex03.right - textFlex03.left).assertEqual(vp2px(140)) + expect(Math.round(textFlex01.bottom - textFlex01.top)).assertEqual(vp2px(50)) + expect(Math.round(textFlex02.bottom - textFlex02.top)).assertEqual(vp2px(100)) + expect(Math.round(textFlex03.bottom - textFlex03.top)).assertEqual(vp2px(150)) + expect(Math.round(textFlex01.right - textFlex01.left)).assertEqual(vp2px(140)) + expect(Math.round(textFlex02.right - textFlex02.left)).assertEqual(vp2px(140)) + expect(Math.round(textFlex03.right - textFlex03.left)).assertEqual(vp2px(140)) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto') diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexExceedJsunit.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexExceedJsunit.test.ets index 0bf2e734ae53f8a6a4a77b7402095badddb910fb..f07a69d42519a5badbd41830bc6eab1f41d0e7fb 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexExceedJsunit.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexExceedJsunit.test.ets @@ -47,7 +47,7 @@ export default function flexExceed_AutoJsunit() { /** * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_0600 * @tc.name ItemAlign_Auto_FlexExceed - * @tc.desc aceEtsTest + * @tc.desc Subcomponent inside when parent component set margin and padding. */ it('SUB_ACE_FLEXALIGNITEMS_AUTO_0600', 0, async function (done) { console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0600 START'); @@ -60,17 +60,20 @@ export default function flexExceed_AutoJsunit() { let textExceed02 = CommonFunc.getComponentRect('textExceed02'); let textExceed03 = CommonFunc.getComponentRect('textExceed03'); let flexExceed01 = CommonFunc.getComponentRect('flexExceed01'); + expect(Math.round(textExceed01.left - flexExceed01.left)).assertEqual(vp2px(10)) + expect(textExceed01.right).assertEqual(textExceed02.left) + expect(textExceed02.right).assertEqual(textExceed03.left) + + expect(Math.round(textExceed01.top - flexExceed01.top)).assertEqual(vp2px(10)) expect(textExceed01.top).assertEqual(textExceed02.top) expect(textExceed02.top).assertEqual(textExceed03.top) - expect(textExceed01.top).assertLarger(flexExceed01.top) - expect(textExceed01.left).assertLarger(flexExceed01.left) - expect(textExceed03.right).assertLess(flexExceed01.right) - expect(textExceed01.bottom - textExceed01.top).assertEqual(vp2px(50)) - expect(textExceed02.bottom - textExceed02.top).assertEqual(vp2px(100)) - expect(textExceed03.bottom - textExceed03.top).assertEqual(vp2px(150)) - expect(textExceed01.right - textExceed01.left).assertEqual(vp2px(150)) - expect(textExceed02.right - textExceed02.left).assertEqual(vp2px(150)) - expect(textExceed03.right - textExceed03.left).assertEqual(vp2px(150)) + + expect(Math.round(textExceed01.bottom - textExceed01.top)).assertEqual(vp2px(50)) + expect(Math.round(textExceed02.bottom - textExceed02.top)).assertEqual(vp2px(100)) + expect(Math.round(textExceed03.bottom - textExceed03.top)).assertEqual(vp2px(150)) + expect(Math.round(textExceed01.right - textExceed01.left)).assertEqual(vp2px(150)) + expect(Math.round(textExceed02.right - textExceed02.left)).assertEqual(vp2px(150)) + expect(Math.round(textExceed03.right - textExceed03.left)).assertEqual(vp2px(150)) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto') console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0600 END'); @@ -80,7 +83,7 @@ export default function flexExceed_AutoJsunit() { /** * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_0700 * @tc.name ItemAlign_Auto_FlexExceed - * @tc.desc aceFlexAlignItemTest + * @tc.desc Subcomponent outside when parent component set margin and padding. */ it('SUB_ACE_FLEXALIGNITEMS_AUTO_0700', 0, async function (done) { console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0700 START'); @@ -93,14 +96,17 @@ export default function flexExceed_AutoJsunit() { let textExceed02 = CommonFunc.getComponentRect('textExceed02'); let textExceed03 = CommonFunc.getComponentRect('textExceed03'); let flexExceed01 = CommonFunc.getComponentRect('flexExceed01'); + expect(Math.round(textExceed01.left - flexExceed01.left)).assertEqual(vp2px(30)) + expect(textExceed01.right).assertEqual(textExceed02.left) + expect(textExceed02.right).assertEqual(textExceed03.left) + + expect(Math.round(textExceed01.top - flexExceed01.top)).assertEqual(vp2px(30)) expect(textExceed01.top).assertEqual(textExceed02.top) expect(textExceed02.top).assertEqual(textExceed03.top) - expect(textExceed01.top).assertLarger(flexExceed01.top) - expect(textExceed01.left).assertLarger(flexExceed01.left) - expect(textExceed03.right).assertLess(flexExceed01.right) - expect(textExceed01.bottom - textExceed01.top).assertEqual(vp2px(50)) - expect(textExceed02.bottom - textExceed02.top).assertEqual(vp2px(100)) - expect(textExceed03.bottom - textExceed03.top).assertEqual(vp2px(150)) + + expect(Math.round(textExceed01.bottom - textExceed01.top)).assertEqual(vp2px(50)) + expect(Math.round(textExceed02.bottom - textExceed02.top)).assertEqual(vp2px(100)) + expect(Math.round(textExceed03.bottom - textExceed03.top)).assertEqual(vp2px(150)) expect(Math.round(textExceed01.right - textExceed01.left)).assertEqual(Math.round(vp2px(440/3))) expect(Math.round(textExceed02.right - textExceed02.left)).assertEqual(Math.round(vp2px(440/3))) expect(Math.round(textExceed03.right - textExceed03.left)).assertEqual(Math.round(vp2px(440/3))) diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexHeightModifyJsunit.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexHeightModifyJsunit.test.ets index e8a0d81797613a30ba5726177682aabf2a27c2b4..7ced5b133e1684a863414fa792c1c33eb3fd0fe1 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexHeightModifyJsunit.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexHeightModifyJsunit.test.ets @@ -47,10 +47,43 @@ export default function flexHeightModify_AutoJsunit() { /** * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_0800 * @tc.name ItemAlign_Auto_FlexHeightModify - * @tc.desc aceFlexAlignItemTest + * @tc.desc Check the the default height of the first subcomponent. */ it('SUB_ACE_FLEXALIGNITEMS_AUTO_0800', 0, async function (done) { console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0800 START'); + let strJson1 = getInspectorByKey('flexHeightModify'); + let obj1 = JSON.parse(strJson1); + let textHeightModify01 = CommonFunc.getComponentRect('textHeightModify01'); + let textHeightModify02 = CommonFunc.getComponentRect('textHeightModify02'); + let textHeightModify03 = CommonFunc.getComponentRect('textHeightModify03'); + let flexHeightModify = CommonFunc.getComponentRect('flexHeightModify'); + + expect(textHeightModify01.top).assertEqual(textHeightModify02.top) + expect(textHeightModify02.top).assertEqual(textHeightModify03.top) + expect(textHeightModify01.top).assertEqual(flexHeightModify.top) + + expect(textHeightModify01.left).assertEqual(flexHeightModify.left) + expect(textHeightModify02.left).assertEqual(textHeightModify01.right) + + expect(Math.round(textHeightModify01.bottom - textHeightModify01.top)).assertEqual(vp2px(50)) + expect(Math.round(textHeightModify02.bottom - textHeightModify02.top)).assertEqual(vp2px(100)) + expect(Math.round(textHeightModify03.bottom - textHeightModify03.top)).assertEqual(vp2px(150)) + expect(Math.round(textHeightModify01.right - textHeightModify01.left)).assertEqual(vp2px(150)) + expect(Math.round(textHeightModify02.right - textHeightModify02.left)).assertEqual(vp2px(150)) + expect(Math.round(textHeightModify03.right - textHeightModify03.left)).assertEqual(vp2px(150)) + expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') + expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto') + console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0800 END'); + done(); + }); + + /** + * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_0900 + * @tc.name ItemAlign_Auto_FlexHeightModify + * @tc.desc Modify the first subcomponent's height. + */ + it('SUB_ACE_FLEXALIGNITEMS_AUTO_0900', 0, async function (done) { + console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0900 START'); globalThis.value.message.notify({name:'height', value:80}) await CommonFunc.sleep(2000); let strJson1 = getInspectorByKey('flexHeightModify'); @@ -67,15 +100,15 @@ export default function flexHeightModify_AutoJsunit() { expect(textHeightModify01.left).assertEqual(flexHeightModify.left) expect(textHeightModify02.left).assertEqual(textHeightModify01.right) - expect(textHeightModify01.bottom - textHeightModify01.top).assertEqual(vp2px(80)) - expect(textHeightModify02.bottom - textHeightModify02.top).assertEqual(vp2px(100)) - expect(textHeightModify03.bottom - textHeightModify03.top).assertEqual(vp2px(150)) - expect(textHeightModify01.right - textHeightModify01.left).assertEqual(vp2px(150)) - expect(textHeightModify02.right - textHeightModify02.left).assertEqual(vp2px(150)) - expect(textHeightModify03.right - textHeightModify03.left).assertEqual(vp2px(150)) + expect(Math.round(textHeightModify01.bottom - textHeightModify01.top)).assertEqual(vp2px(80)) + expect(Math.round(textHeightModify02.bottom - textHeightModify02.top)).assertEqual(vp2px(100)) + expect(Math.round(textHeightModify03.bottom - textHeightModify03.top)).assertEqual(vp2px(150)) + expect(Math.round(textHeightModify01.right - textHeightModify01.left)).assertEqual(vp2px(150)) + expect(Math.round(textHeightModify02.right - textHeightModify02.left)).assertEqual(vp2px(150)) + expect(Math.round(textHeightModify03.right - textHeightModify03.left)).assertEqual(vp2px(150)) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto') - console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0800 END'); + console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0900 END'); done(); }); }) diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexMarginJsunit.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexMarginJsunit.test.ets index 17dab8740ebf8637088125ea0e6ea95ee78e098f..097124434789da9d756de35238d824ab32fef177 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexMarginJsunit.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexMarginJsunit.test.ets @@ -57,17 +57,20 @@ export default function flexMargin_AutoJsunit() { let textFlexMargin02 = CommonFunc.getComponentRect('textFlexMargin02'); let textFlexMargin03 = CommonFunc.getComponentRect('textFlexMargin03'); let flexMargin = CommonFunc.getComponentRect('flexMargin'); - + expect(flexMargin.top).assertEqual(textFlexMargin01.top) expect(textFlexMargin01.top).assertEqual(textFlexMargin02.top) expect(textFlexMargin02.top).assertEqual(textFlexMargin03.top) - expect(textFlexMargin03.right).assertLess(flexMargin.right) - expect(textFlexMargin01.left).assertLarger(flexMargin.left) - expect(textFlexMargin01.bottom - textFlexMargin01.top).assertEqual(vp2px(50)) - expect(textFlexMargin02.bottom - textFlexMargin02.top).assertEqual(vp2px(100)) - expect(textFlexMargin03.bottom - textFlexMargin03.top).assertEqual(vp2px(150)) - expect(textFlexMargin01.right - textFlexMargin01.left).assertEqual(vp2px(150)) - expect(textFlexMargin02.right - textFlexMargin02.left).assertEqual(vp2px(150)) - expect(textFlexMargin03.right - textFlexMargin03.left).assertEqual(vp2px(150)) + + expect(flexMargin.left).assertEqual(textFlexMargin01.left) + expect(textFlexMargin01.right).assertEqual(textFlexMargin02.left) + expect(textFlexMargin02.right).assertEqual(textFlexMargin03.left) + + expect(Math.round(textFlexMargin01.bottom - textFlexMargin01.top)).assertEqual(vp2px(50)) + expect(Math.round(textFlexMargin02.bottom - textFlexMargin02.top)).assertEqual(vp2px(100)) + expect(Math.round(textFlexMargin03.bottom - textFlexMargin03.top)).assertEqual(vp2px(150)) + expect(Math.round(textFlexMargin01.right - textFlexMargin01.left)).assertEqual(vp2px(150)) + expect(Math.round(textFlexMargin02.right - textFlexMargin02.left)).assertEqual(vp2px(150)) + expect(Math.round(textFlexMargin03.right - textFlexMargin03.left)).assertEqual(vp2px(150)) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto') console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0500 END'); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexOffsetJsunit.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexOffsetJsunit.test.ets index 0d7acbe46a2953577a2cbb44cd0cc9c2027a75af..c49cde3af547fbbe89b64fd7300f897735b2033f 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexOffsetJsunit.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexOffsetJsunit.test.ets @@ -45,33 +45,33 @@ export default function flexOffset_AutoJsunit() { }); /** - * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_0900 + * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_1000 * @tc.name ItemAlign_Auto_FlexOffset - * @tc.desc aceFlexAlignItemTest + * @tc.desc First subcomponent set offset attribute. */ - it('SUB_ACE_FLEXALIGNITEMS_AUTO_0900', 0, async function (done) { - console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0900 START'); + it('SUB_ACE_FLEXALIGNITEMS_AUTO_1000', 0, async function (done) { + console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1000 START'); let strJson1 = getInspectorByKey('flexOffset'); let obj1 = JSON.parse(strJson1); let textOffset01 = CommonFunc.getComponentRect('textOffset01'); let textOffset02 = CommonFunc.getComponentRect('textOffset02'); let textOffset03 = CommonFunc.getComponentRect('textOffset03'); let flexOffset = CommonFunc.getComponentRect('flexOffset'); - expect(textOffset01.right - textOffset02.left).assertEqual(vp2px(15)) - expect(textOffset01.top - flexOffset.top).assertEqual(vp2px(30)) - expect(textOffset01.left - flexOffset.left).assertEqual(vp2px(15)) + expect(Math.round((textOffset01.right - textOffset02.left)*10)/10).assertEqual(Math.round(vp2px(15)*10)/10) + expect(Math.round(textOffset01.top - flexOffset.top)).assertEqual(vp2px(30)) + expect(Math.round((textOffset01.left - flexOffset.left)*10)/10).assertEqual(Math.round(vp2px(15)*10)/10) expect(textOffset02.top).assertEqual(textOffset03.top) expect(textOffset03.top).assertEqual(flexOffset.top) - expect(textOffset01.bottom - textOffset01.top).assertEqual(vp2px(50)) - expect(textOffset02.bottom - textOffset02.top).assertEqual(vp2px(100)) - expect(textOffset03.bottom - textOffset03.top).assertEqual(vp2px(150)) - expect(textOffset01.right - textOffset01.left).assertEqual(vp2px(150)) - expect(textOffset02.right - textOffset02.left).assertEqual(vp2px(150)) - expect(textOffset03.right - textOffset03.left).assertEqual(vp2px(150)) + expect(Math.round(textOffset01.bottom - textOffset01.top)).assertEqual(vp2px(50)) + expect(Math.round(textOffset02.bottom - textOffset02.top)).assertEqual(vp2px(100)) + expect(Math.round(textOffset03.bottom - textOffset03.top)).assertEqual(vp2px(150)) + expect(Math.round(textOffset01.right - textOffset01.left)).assertEqual(vp2px(150)) + expect(Math.round(textOffset02.right - textOffset02.left)).assertEqual(vp2px(150)) + expect(Math.round(textOffset03.right - textOffset03.left)).assertEqual(vp2px(150)) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto') - console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0900 END'); + console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1000 END'); done(); }); }) diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexPaddingJsunit.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexPaddingJsunit.test.ets index 701e633dbc5da52c1c1d62dcccf26e4cc9e9bbda..02ac1a1531ab3d29367d6d6ce0af5ccf6fd7e446 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexPaddingJsunit.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexPaddingJsunit.test.ets @@ -48,7 +48,7 @@ export default function flexPadding_AutoJsunit() { /** * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_0300 * @tc.name ItemAlign_Auto_testFlexPadding - * @tc.desc aceFlexAlignItemTest + * @tc.desc Parent component set paddding,subcomponent does not exceed the parent component. */ it('SUB_ACE_FLEXALIGNITEMS_AUTO_0300', 0, async function (done) { console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0300 START'); @@ -60,19 +60,21 @@ export default function flexPadding_AutoJsunit() { let textFlexPadding02 = CommonFunc.getComponentRect('textFlexPadding02') let textFlexPadding03 = CommonFunc.getComponentRect('textFlexPadding03') let flexPadding01 = CommonFunc.getComponentRect('flexPadding01') + expect(Math.round(textFlexPadding01.left - flexPadding01.left)).assertEqual(vp2px(10)) + expect(textFlexPadding01.right).assertEqual(textFlexPadding02.left) + expect(textFlexPadding02.right).assertEqual(textFlexPadding03.left) expect(textFlexPadding01.top).assertEqual(textFlexPadding02.top) expect(textFlexPadding02.top).assertEqual(textFlexPadding03.top) - expect(textFlexPadding01.top - flexPadding01.top).assertEqual(vp2px(10)) - expect(textFlexPadding03.right).assertLess(flexPadding01.right) + expect(Math.round(textFlexPadding01.top - flexPadding01.top)).assertEqual(vp2px(10)) - expect(textFlexPadding01.bottom - textFlexPadding01.top).assertEqual(vp2px(50)) - expect(textFlexPadding02.bottom - textFlexPadding02.top).assertEqual(vp2px(100)) - expect(textFlexPadding03.bottom - textFlexPadding03.top).assertEqual(vp2px(150)) + expect(Math.round(textFlexPadding01.bottom - textFlexPadding01.top)).assertEqual(vp2px(50)) + expect(Math.round(textFlexPadding02.bottom - textFlexPadding02.top)).assertEqual(vp2px(100)) + expect(Math.round(textFlexPadding03.bottom - textFlexPadding03.top)).assertEqual(vp2px(150)) - expect(textFlexPadding01.right - textFlexPadding01.left).assertEqual(vp2px(150)) - expect(textFlexPadding02.right - textFlexPadding02.left).assertEqual(vp2px(150)) - expect(textFlexPadding03.right - textFlexPadding03.left).assertEqual(vp2px(150)) + expect(Math.round(textFlexPadding01.right - textFlexPadding01.left)).assertEqual(vp2px(150)) + expect(Math.round(textFlexPadding02.right - textFlexPadding02.left)).assertEqual(vp2px(150)) + expect(Math.round(textFlexPadding03.right - textFlexPadding03.left)).assertEqual(vp2px(150)) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto') console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0300 END'); @@ -82,7 +84,7 @@ export default function flexPadding_AutoJsunit() { /** * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_0400 * @tc.name ItemAlign_Auto_FlexPadding - * @tc.desc aceFlexAlignItemTest + * @tc.desc Parent component set paddding,subcomponent exceedS the parent component. */ it('SUB_ACE_FLEXALIGNITEMS_AUTO_0400', 0, async function (done) { console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0400 START'); @@ -94,14 +96,17 @@ export default function flexPadding_AutoJsunit() { let textFlexPadding02 = CommonFunc.getComponentRect('textFlexPadding02'); let textFlexPadding03 = CommonFunc.getComponentRect('textFlexPadding03'); let flexPadding01 = CommonFunc.getComponentRect('flexPadding01'); + expect(Math.round(textFlexPadding01.left - flexPadding01.left)).assertEqual(vp2px(30)) + expect(textFlexPadding01.right).assertEqual(textFlexPadding02.left) + expect(textFlexPadding02.right).assertEqual(textFlexPadding03.left) + expect(textFlexPadding01.top).assertEqual(textFlexPadding02.top) expect(textFlexPadding02.top).assertEqual(textFlexPadding03.top) - expect(textFlexPadding01.top - flexPadding01.top).assertEqual(vp2px(30)) - expect(textFlexPadding03.right).assertLess(flexPadding01.right) - - expect(textFlexPadding01.bottom - textFlexPadding01.top).assertEqual(vp2px(50)) - expect(textFlexPadding02.bottom - textFlexPadding02.top).assertEqual(vp2px(100)) - expect(textFlexPadding03.bottom - textFlexPadding03.top).assertEqual(vp2px(150)) + expect(Math.round(textFlexPadding01.top - flexPadding01.top)).assertEqual(vp2px(30)) + + expect(Math.round(textFlexPadding01.bottom - textFlexPadding01.top)).assertEqual(vp2px(50)) + expect(Math.round(textFlexPadding02.bottom - textFlexPadding02.top)).assertEqual(vp2px(100)) + expect(Math.round(textFlexPadding03.bottom - textFlexPadding03.top)).assertEqual(vp2px(150)) expect(Math.round(textFlexPadding01.right - textFlexPadding01.left)).assertEqual(Math.round(vp2px(440/3))) expect(Math.round(textFlexPadding02.right - textFlexPadding02.left)).assertEqual(Math.round(vp2px(440/3))) expect(Math.round(textFlexPadding03.right - textFlexPadding03.left)).assertEqual(Math.round(vp2px(440/3))) diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexTextMarginJsunit.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexTextMarginJsunit.test.ets index a8c06de042200db7c9619e7298336fa7eb37b23e..e4401514e7e63ecb81547ee21852ac716742c6e8 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexTextMarginJsunit.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexTextMarginJsunit.test.ets @@ -46,12 +46,12 @@ export default function flexTextMargin_AutoJsunit() { }); /** - * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_1300 + * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_1400 * @tc.name ItemAlign_Auto_TextMargin - * @tc.desc aceFlexAlignItemTest + * @tc.desc Subcomponents set margin within the scope of the parent component. */ - it('SUB_ACE_FLEXALIGNITEMS_AUTO_1300', 0, async function (done) { - console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1300 START'); + it('SUB_ACE_FLEXALIGNITEMS_AUTO_1400', 0, async function (done) { + console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1400 START'); globalThis.value.message.notify({name:'margin', value:10}); await CommonFunc.sleep(2000); let strJson1 = getInspectorByKey('flexTextMargin01'); @@ -60,31 +60,33 @@ export default function flexTextMargin_AutoJsunit() { let textMargin02 = CommonFunc.getComponentRect('textMargin02'); let textMargin03 = CommonFunc.getComponentRect('textMargin03'); let flexTextMargin01 = CommonFunc.getComponentRect('flexTextMargin01'); - expect(textMargin01.left - flexTextMargin01.left).assertEqual(vp2px(10)) - expect(textMargin02.left).assertEqual(textMargin01.right) - expect(textMargin03.right).assertLess(flexTextMargin01.right) - expect(textMargin01.top).assertEqual(textMargin02.top) + expect(Math.round(textMargin01.left - flexTextMargin01.left)).assertEqual(vp2px(10)) + expect(Math.round(textMargin02.left - textMargin01.right)).assertEqual(vp2px(10)) + expect(textMargin02.right).assertEqual(textMargin03.left) + + expect(Math.round(textMargin01.top - flexTextMargin01.top)).assertEqual(vp2px(10)) expect(textMargin02.top).assertEqual(textMargin03.top) - expect(textMargin02.top).assertEqual(flexTextMargin01.top) - expect(textMargin01.bottom - textMargin01.top).assertEqual(vp2px(70)) - expect(textMargin02.bottom - textMargin02.top).assertEqual(vp2px(100)) - expect(textMargin03.bottom - textMargin03.top).assertEqual(vp2px(150)) - expect(textMargin01.right - textMargin01.left).assertEqual(vp2px(170)) - expect(textMargin02.right - textMargin02.left).assertEqual(vp2px(150)) - expect(textMargin03.right - textMargin03.left).assertEqual(vp2px(150)) + expect(textMargin03.top).assertEqual(flexTextMargin01.top) + + expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(50)) + expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(100)) + expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(150)) + expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(vp2px(150)) + expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(vp2px(150)) + expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(vp2px(150)) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto') - console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1300 END'); + console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1400 END'); done(); }); /** - * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_1400 + * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_1500 * @tc.name ItemAlign_Auto_TextMargin - * @tc.desc aceFlexAlignItemTest + * @tc.desc Subcomponents set margin outside the scope of the parent component */ - it('SUB_ACE_FLEXALIGNITEMS_AUTO_1400', 0, async function (done) { - console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1400 START'); + it('SUB_ACE_FLEXALIGNITEMS_AUTO_1500', 0, async function (done) { + console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1500 START'); globalThis.value.message.notify({name:'margin', value:30}); await CommonFunc.sleep(2000); let strJson1 = getInspectorByKey('flexTextMargin01'); @@ -93,21 +95,25 @@ export default function flexTextMargin_AutoJsunit() { let textMargin02 = CommonFunc.getComponentRect('textMargin02'); let textMargin03 = CommonFunc.getComponentRect('textMargin03'); let flexTextMargin01 = CommonFunc.getComponentRect('flexTextMargin01'); - expect(textMargin01.left - flexTextMargin01.left).assertEqual(vp2px(30)) - expect(textMargin02.left).assertEqual(textMargin01.right) + + expect(Math.round(textMargin01.left - flexTextMargin01.left)).assertEqual(Math.round(vp2px(500/17))) + expect(Math.round(textMargin02.left - textMargin01.right)).assertEqual(Math.round(vp2px(500/17))) + expect(textMargin02.right).assertEqual(textMargin03.left) expect(textMargin03.right).assertEqual(flexTextMargin01.right) - expect(textMargin01.top).assertEqual(textMargin02.top) + + expect(Math.round(textMargin01.top - flexTextMargin01.top)).assertEqual(vp2px(30)) expect(textMargin02.top).assertEqual(textMargin03.top) - expect(textMargin02.top).assertEqual(flexTextMargin01.top) - expect(textMargin01.bottom - textMargin01.top).assertEqual(vp2px(50)) - expect(textMargin02.bottom - textMargin02.top).assertEqual(vp2px(100)) - expect(textMargin03.bottom - textMargin03.top).assertEqual(vp2px(150)) - expect(textMargin01.right - textMargin01.left).assertLess(vp2px(150)) - expect(textMargin02.right - textMargin02.left).assertLess(vp2px(150)) - expect(textMargin03.right - textMargin03.left).assertLess(vp2px(150)) + expect(textMargin03.top).assertEqual(flexTextMargin01.top) + + expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(50)) + expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(100)) + expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(150)) + expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(Math.round(vp2px(2500/17))) + expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(Math.round(vp2px(2500/17))) + expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(Math.round(vp2px(2500/17))) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto') - console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1400 END'); + console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1500 END'); done(); }); }) diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexVisibilityJsunit.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexVisibilityJsunit.test.ets index c494c78f3a47bdc6d2df4cf7aaa967cd756c5627..ecc41f0c5ae215f8c1a5f910aa2beefc6945e9f5 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexVisibilityJsunit.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexVisibilityJsunit.test.ets @@ -46,18 +46,21 @@ export default function flexVisibility_AutoJsunit() { }); /** - * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_1000 + * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_1100 * @tc.name ItemAlign_Auto_FlexVisibility - * @tc.desc aceFlexAlignItemTest + * @tc.desc The first subcomponent set Visibility.None attribute. */ - it('SUB_ACE_FLEXALIGNITEMS_AUTO_1000', 0, async function (done) { - console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1000 START'); + it('SUB_ACE_FLEXALIGNITEMS_AUTO_1100', 0, async function (done) { + console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1100 START'); globalThis.value.message.notify({name:'visibility', value:Visibility.None}) await CommonFunc.sleep(2000); let strJson1 = getInspectorByKey('flexVisible'); let obj1 = JSON.parse(strJson1); - let strJson2 = getInspectorByKey('textVisible01'); - let obj2 = JSON.parse(strJson2); + setTimeout(() =>{ + let strJson2 = getInspectorByKey('textVisible01'); + let obj2 = JSON.parse(strJson2); + expect(obj2.$attrs.visibility).assertEqual("Visibility.Hidden"); + }) let textVisible01 = CommonFunc.getComponentRect('textVisible01') let textVisible02 = CommonFunc.getComponentRect('textVisible02') let textVisible03 = CommonFunc.getComponentRect('textVisible03') @@ -68,32 +71,34 @@ export default function flexVisibility_AutoJsunit() { expect(textVisible02.top).assertEqual(textVisible03.top) expect(textVisible03.top).assertEqual(flexVisible.top) - expect(textVisible02.bottom - textVisible02.top).assertEqual(vp2px(100)) - expect(textVisible03.bottom - textVisible03.top).assertEqual(vp2px(150)) - expect(textVisible02.right - textVisible02.left).assertEqual(vp2px(150)) - expect(textVisible03.right - textVisible03.left).assertEqual(vp2px(150)) - + expect(Math.round(textVisible02.bottom - textVisible02.top)).assertEqual(vp2px(100)) + expect(Math.round(textVisible03.bottom - textVisible03.top)).assertEqual(vp2px(150)) + expect(Math.round(textVisible02.right - textVisible02.left)).assertEqual(vp2px(150)) + expect(Math.round(textVisible03.right - textVisible03.left)).assertEqual(vp2px(150)) + expect(obj1.$attrs.visibility).assertEqual("Visibility.Visible"); expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto') - expect(obj2.$attrs.visibility).assertEqual("Visibility.None"); - console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1000 END'); + console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1100 END'); done(); }); /** - * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_1100 + * @tc.number SUB_ACE_FLEXALIGNITEMS_AUTO_1200 * @tc.name ItemAlign_Auto_FlexVisibility - * @tc.desc aceFlexAlignItemTest + * @tc.desc The first subcomponent set Visibility.Hidden attribute. */ - it('SUB_ACE_FLEXALIGNITEMS_AUTO_1100', 0, async function (done) { - console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1100 START'); + it('SUB_ACE_FLEXALIGNITEMS_AUTO_1200', 0, async function (done) { + console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1200 START'); globalThis.value.message.notify({name:'visibility', value:Visibility.Hidden}); await CommonFunc.sleep(2000); let strJson1 = getInspectorByKey('flexVisible'); let obj1 = JSON.parse(strJson1); - let strJson2 = getInspectorByKey('textVisible01'); - let obj2 = JSON.parse(strJson2); + setTimeout(() =>{ + let strJson2 = getInspectorByKey('textVisible01'); + let obj2 = JSON.parse(strJson2); + expect(obj2.$attrs.visibility).assertEqual("Visibility.Hidden"); + }) let textVisible01 = CommonFunc.getComponentRect('textVisible01'); let textVisible02 = CommonFunc.getComponentRect('textVisible02'); let textVisible03 = CommonFunc.getComponentRect('textVisible03'); @@ -103,16 +108,15 @@ export default function flexVisibility_AutoJsunit() { expect(textVisible02.top).assertEqual(textVisible03.top) expect(textVisible03.top).assertEqual(flexVisible.top) - expect(textVisible01.bottom - textVisible01.top).assertEqual(vp2px(50)) - expect(textVisible02.bottom - textVisible02.top).assertEqual(vp2px(100)) - expect(textVisible03.bottom - textVisible03.top).assertEqual(vp2px(150)) - expect(textVisible01.right - textVisible01.left).assertEqual(vp2px(150)) - expect(textVisible02.right - textVisible02.left).assertEqual(vp2px(150)) - expect(textVisible03.right - textVisible03.left).assertEqual(vp2px(150)) + expect(Math.round(textVisible01.bottom - textVisible01.top)).assertEqual(vp2px(50)) + expect(Math.round(textVisible02.bottom - textVisible02.top)).assertEqual(vp2px(100)) + expect(Math.round(textVisible03.bottom - textVisible03.top)).assertEqual(vp2px(150)) + expect(Math.round(textVisible01.right - textVisible01.left)).assertEqual(vp2px(150)) + expect(Math.round(textVisible02.right - textVisible02.left)).assertEqual(vp2px(150)) + expect(Math.round(textVisible03.right - textVisible03.left)).assertEqual(vp2px(150)) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto') - expect(obj2.$attrs.visibility).assertEqual("Visibility.Hidden"); - console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1100 END'); + console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1200 END'); done(); }); }) diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddAlign.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddAlign.test.ets index dd63b26c61125b7c38067e96177faac014975264..de8f8b8b3dae192255a91a99866d219f0fcc2d18 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddAlign.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddAlign.test.ets @@ -68,14 +68,16 @@ export default function AlignCenter_AddAlign() { expect(Center_AddAlign_011.top).assertEqual(Center_AddAlign_01.top); expect(Center_AddAlign_012.left).assertEqual(Center_AddAlign_011.right); expect(Center_AddAlign_013.left).assertEqual(Center_AddAlign_012.right); - expect(Center_AddAlign_011.left - Center_AddAlign_01.left).assertEqual(vp2px(25)); - expect(Center_AddAlign_01.right - Center_AddAlign_013.right).assertEqual(vp2px(25)); - expect(Center_AddAlign_011.right - Center_AddAlign_011.left).assertEqual(vp2px(150)); - expect(Center_AddAlign_012.right - Center_AddAlign_012.left).assertEqual(vp2px(150)); - expect(Center_AddAlign_013.right - Center_AddAlign_013.left).assertEqual(vp2px(150)); - expect(Center_AddAlign_011.bottom - Center_AddAlign_011.top).assertEqual(vp2px(50)); - expect(Center_AddAlign_012.bottom - Center_AddAlign_012.top).assertEqual(vp2px(100)); - expect(Center_AddAlign_013.bottom - Center_AddAlign_013.top).assertEqual(vp2px(150)); + expect(Math.round((Center_AddAlign_011.left - Center_AddAlign_01.left)*10)/10) + .assertEqual(Math.round(vp2px(25)*10)/10); + expect(Math.round((Center_AddAlign_01.right - Center_AddAlign_013.right)*10)/10) + .assertEqual(Math.round(vp2px(25)*10)/10); + expect(Math.round(Center_AddAlign_011.right - Center_AddAlign_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddAlign_012.right - Center_AddAlign_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddAlign_013.right - Center_AddAlign_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddAlign_011.bottom - Center_AddAlign_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Center_AddAlign_012.bottom - Center_AddAlign_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Center_AddAlign_013.bottom - Center_AddAlign_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_0800] END'); done() }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddAllSpace.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddAllSpace.test.ets index 635ceaa8afd5738d4ca4870523d9b2cb8ad6f0ee..79c7cd3e94e1b70d08e75312be2ba36cf98ffde2 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddAllSpace.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddAllSpace.test.ets @@ -69,17 +69,17 @@ export default function AlignCenter_AddAllSpace() { expect(Center_AddAllSpace_012.top).assertEqual(Center_AddAllSpace_013.top); expect(Center_AddAllSpace_012.left).assertEqual(Center_AddAllSpace_011.right); expect(Center_AddAllSpace_013.left).assertEqual(Center_AddAllSpace_012.right); - expect(Center_AddAllSpace_011.top - Center_AddAllSpace_01.top).assertEqual(vp2px(30)); - expect(Center_AddAllSpace_011.left - Center_AddAllSpace_01.left).assertEqual(vp2px(30)); - expect(Center_AddAllSpace_01.right - Center_AddAllSpace_013.right).assertEqual(vp2px(30)); - expect(Center_AddAllSpace_01.top - Center_AddAllSpace_01_Box.top).assertEqual(vp2px(10)); - expect(Center_AddAllSpace_01.left - Center_AddAllSpace_01_Box.left).assertEqual(vp2px(10)); - expect(Center_AddAllSpace_011.bottom - Center_AddAllSpace_011.top).assertEqual(vp2px(50)); - expect(Center_AddAllSpace_012.bottom - Center_AddAllSpace_012.top).assertEqual(vp2px(100)); - expect(Center_AddAllSpace_013.bottom - Center_AddAllSpace_013.top).assertEqual(vp2px(150)); - expect(Center_AddAllSpace_011.right - Center_AddAllSpace_011.left).assertEqual(vp2px(440/3)); - expect(Center_AddAllSpace_012.right - Center_AddAllSpace_012.left).assertEqual(vp2px(440/3)); - expect(Center_AddAllSpace_013.right - Center_AddAllSpace_013.left).assertEqual(vp2px(440/3)); + expect(Math.round(Center_AddAllSpace_011.top - Center_AddAllSpace_01.top)).assertEqual(vp2px(30)); + expect(Math.round(Center_AddAllSpace_011.left - Center_AddAllSpace_01.left)).assertEqual(vp2px(30)); + expect(Math.round(Center_AddAllSpace_01.right - Center_AddAllSpace_013.right)).assertEqual(vp2px(30)); + expect(Math.round(Center_AddAllSpace_01.top - Center_AddAllSpace_01_Box.top)).assertEqual(vp2px(10)); + expect(Math.round(Center_AddAllSpace_01.left - Center_AddAllSpace_01_Box.left)).assertEqual(vp2px(10)); + expect(Math.round(Center_AddAllSpace_011.bottom - Center_AddAllSpace_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Center_AddAllSpace_012.bottom - Center_AddAllSpace_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Center_AddAllSpace_013.bottom - Center_AddAllSpace_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddAllSpace_011.right - Center_AddAllSpace_011.left)).assertEqual(Math.round(vp2px(440/3))); + expect(Math.round(Center_AddAllSpace_012.right - Center_AddAllSpace_012.left)).assertEqual(Math.round(vp2px(440/3))); + expect(Math.round(Center_AddAllSpace_013.right - Center_AddAllSpace_013.left)).assertEqual(Math.round(vp2px(440/3))); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_0600] END'); done(); }); @@ -107,17 +107,19 @@ export default function AlignCenter_AddAllSpace() { expect(Center_AddAllSpace_012.top).assertEqual(Center_AddAllSpace_013.top); expect(Center_AddAllSpace_012.left).assertEqual(Center_AddAllSpace_011.right); expect(Center_AddAllSpace_013.left).assertEqual(Center_AddAllSpace_012.right); - expect(Center_AddAllSpace_011.top - Center_AddAllSpace_01.top).assertEqual(vp2px(20)); - expect(Center_AddAllSpace_011.left - Center_AddAllSpace_01.left).assertEqual(vp2px(25)); - expect(Center_AddAllSpace_01.right - Center_AddAllSpace_013.right).assertEqual(vp2px(25)); - expect(Center_AddAllSpace_01.top - Center_AddAllSpace_01_Box.top).assertEqual(vp2px(10)); - expect(Center_AddAllSpace_01.left - Center_AddAllSpace_01_Box.left).assertEqual(vp2px(10)); - expect(Center_AddAllSpace_011.bottom - Center_AddAllSpace_011.top).assertEqual(vp2px(50)); - expect(Center_AddAllSpace_012.bottom - Center_AddAllSpace_012.top).assertEqual(vp2px(100)); - expect(Center_AddAllSpace_013.bottom - Center_AddAllSpace_013.top).assertEqual(vp2px(150)); - expect(Center_AddAllSpace_011.right - Center_AddAllSpace_011.left).assertEqual(vp2px(150)); - expect(Center_AddAllSpace_012.right - Center_AddAllSpace_012.left).assertEqual(vp2px(150)); - expect(Center_AddAllSpace_013.right - Center_AddAllSpace_013.left).assertEqual(vp2px(150)); + expect(Math.round(Center_AddAllSpace_011.top - Center_AddAllSpace_01.top)).assertEqual(vp2px(20)); + expect(Math.round((Center_AddAllSpace_011.left - Center_AddAllSpace_01.left)*10)/10) + .assertEqual(Math.round(vp2px(25)*10)/10); + expect(Math.round((Center_AddAllSpace_01.right - Center_AddAllSpace_013.right)*10)/10) + .assertEqual(Math.round(vp2px(25)*10)/10); + expect(Math.round(Center_AddAllSpace_01.top - Center_AddAllSpace_01_Box.top)).assertEqual(vp2px(10)); + expect(Math.round(Center_AddAllSpace_01.left - Center_AddAllSpace_01_Box.left)).assertEqual(vp2px(10)); + expect(Math.round(Center_AddAllSpace_011.bottom - Center_AddAllSpace_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Center_AddAllSpace_012.bottom - Center_AddAllSpace_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Center_AddAllSpace_013.bottom - Center_AddAllSpace_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddAllSpace_011.right - Center_AddAllSpace_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddAllSpace_012.right - Center_AddAllSpace_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddAllSpace_013.right - Center_AddAllSpace_013.left)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_0700] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddLayoutWeight.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddLayoutWeight.test.ets index 37bedd77f1ff20262494f51644fef634612ca3b8..2c42b1110087ec28aef7dd6cdb6aa3766c6099d0 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddLayoutWeight.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddLayoutWeight.test.ets @@ -72,12 +72,12 @@ export default function AlignCenter_AddLayoutWeight() { expect(Center_AddLayoutWeight_012.right).assertEqual(Center_AddLayoutWeight_013.left); expect(Center_AddLayoutWeight_011.left).assertEqual(Center_AddLayoutWeight_01.left); expect(Center_AddLayoutWeight_013.right).assertEqual(Center_AddLayoutWeight_01.right); - expect(Center_AddLayoutWeight_011.right - Center_AddLayoutWeight_011.left).assertEqual(vp2px(100)); - expect(Center_AddLayoutWeight_012.right - Center_AddLayoutWeight_012.left).assertEqual(vp2px(200)); - expect(Center_AddLayoutWeight_013.right - Center_AddLayoutWeight_013.left).assertEqual(vp2px(200)); - expect(Center_AddLayoutWeight_011.bottom - Center_AddLayoutWeight_011.top).assertEqual(vp2px(50)); - expect(Center_AddLayoutWeight_012.bottom - Center_AddLayoutWeight_012.top).assertEqual(vp2px(100)); - expect(Center_AddLayoutWeight_013.bottom - Center_AddLayoutWeight_013.top).assertEqual(vp2px(150)); + expect(Math.round(Center_AddLayoutWeight_011.right - Center_AddLayoutWeight_011.left)).assertEqual(vp2px(100)); + expect(Math.round(Center_AddLayoutWeight_012.right - Center_AddLayoutWeight_012.left)).assertEqual(vp2px(200)); + expect(Math.round(Center_AddLayoutWeight_013.right - Center_AddLayoutWeight_013.left)).assertEqual(vp2px(200)); + expect(Math.round(Center_AddLayoutWeight_011.bottom - Center_AddLayoutWeight_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Center_AddLayoutWeight_012.bottom - Center_AddLayoutWeight_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Center_AddLayoutWeight_013.bottom - Center_AddLayoutWeight_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1200] END'); done(); }); @@ -108,14 +108,14 @@ export default function AlignCenter_AddLayoutWeight() { expect(Center_AddLayoutWeight_012.right).assertEqual(Center_AddLayoutWeight_013.left); expect(Center_AddLayoutWeight_011.left).assertEqual(Center_AddLayoutWeight_01.left); expect(Center_AddLayoutWeight_013.right).assertEqual(Center_AddLayoutWeight_01.right); - let oneWidth = Center_AddLayoutWeight_011.right - Center_AddLayoutWeight_011.left; - let twoWidth = Center_AddLayoutWeight_012.right - Center_AddLayoutWeight_012.left; + let oneWidth = Math.round(Center_AddLayoutWeight_011.right - Center_AddLayoutWeight_011.left); + let twoWidth = Math.round(Center_AddLayoutWeight_012.right - Center_AddLayoutWeight_012.left); expect(twoWidth / oneWidth).assertEqual(2); expect(twoWidth + oneWidth).assertEqual(vp2px(350)); - expect(Center_AddLayoutWeight_013.right - Center_AddLayoutWeight_013.left).assertEqual(vp2px(150)); - expect(Center_AddLayoutWeight_011.bottom - Center_AddLayoutWeight_011.top).assertEqual(vp2px(50)); - expect(Center_AddLayoutWeight_012.bottom - Center_AddLayoutWeight_012.top).assertEqual(vp2px(100)); - expect(Center_AddLayoutWeight_013.bottom - Center_AddLayoutWeight_013.top).assertEqual(vp2px(150)); + expect(Math.round(Center_AddLayoutWeight_013.right - Center_AddLayoutWeight_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddLayoutWeight_011.bottom - Center_AddLayoutWeight_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Center_AddLayoutWeight_012.bottom - Center_AddLayoutWeight_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Center_AddLayoutWeight_013.bottom - Center_AddLayoutWeight_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1600] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddMargin.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddMargin.test.ets index 6de90fba6f576f3027d0498a804c4614862b7789..958c8807c7cc539620a028b4f7bab46476e89e8a 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddMargin.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddMargin.test.ets @@ -68,16 +68,18 @@ export default function AlignCenter_AddMargin() { expect(Center_AddMargin_013.top).assertEqual(Center_AddMargin_012.top); expect(Center_AddMargin_012.left).assertEqual(Center_AddMargin_011.right); expect(Center_AddMargin_013.left).assertEqual(Center_AddMargin_012.right); - expect(Center_AddMargin_01.left - Center_AddMargin_01_Box.left).assertEqual(vp2px(20)); - expect(Center_AddMargin_01.top - Center_AddMargin_01_Box.top).assertEqual(vp2px(20)); - expect(Center_AddMargin_011.left - Center_AddMargin_01.left).assertEqual(vp2px(25)); - expect(Center_AddMargin_01.right - Center_AddMargin_013.right).assertEqual(vp2px(25)); - expect(Center_AddMargin_011.bottom - Center_AddMargin_011.top).assertEqual(vp2px(50)); - expect(Center_AddMargin_012.bottom - Center_AddMargin_012.top).assertEqual(vp2px(100)); - expect(Center_AddMargin_013.bottom - Center_AddMargin_013.top).assertEqual(vp2px(150)); - expect(Center_AddMargin_011.right - Center_AddMargin_011.left).assertEqual(vp2px(150)); - expect(Center_AddMargin_012.right - Center_AddMargin_012.left).assertEqual(vp2px(150)); - expect(Center_AddMargin_013.right - Center_AddMargin_013.left).assertEqual(vp2px(150)); + expect(Math.round(Center_AddMargin_01.left - Center_AddMargin_01_Box.left)).assertEqual(vp2px(20)); + expect(Math.round(Center_AddMargin_01.top - Center_AddMargin_01_Box.top)).assertEqual(vp2px(20)); + expect(Math.round((Center_AddMargin_011.left - Center_AddMargin_01.left)*10)/10) + .assertEqual(Math.round(vp2px(25)*10)/10); + expect(Math.round((Center_AddMargin_01.right - Center_AddMargin_013.right)*10)/10) + .assertEqual(Math.round(vp2px(25)*10)/10); + expect(Math.round(Center_AddMargin_011.bottom - Center_AddMargin_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Center_AddMargin_012.bottom - Center_AddMargin_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Center_AddMargin_013.bottom - Center_AddMargin_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddMargin_011.right - Center_AddMargin_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddMargin_012.right - Center_AddMargin_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddMargin_013.right - Center_AddMargin_013.left)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_0500] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddOffset.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddOffset.test.ets index 707d85698c007069e125eba2be3fa591de43738d..dc0a1be551939f6cb34e18d39580bdd107e56ed5 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddOffset.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddOffset.test.ets @@ -63,18 +63,21 @@ export default function AlignCenter_AddOffset() { let Center_AddOffset_012 = CommonFunc.getComponentRect('Center_AddOffset_012'); let Center_AddOffset_013 = CommonFunc.getComponentRect('Center_AddOffset_013'); let Center_AddOffset_01 = CommonFunc.getComponentRect('Center_AddOffset_01'); - expect(Center_AddOffset_011.top - Center_AddOffset_01.top).assertEqual(vp2px(15)); - expect(Center_AddOffset_011.left - Center_AddOffset_01.left).assertEqual(vp2px(35)); - expect(Center_AddOffset_01.right - Center_AddOffset_013.right).assertEqual(vp2px(25)); + expect(Math.round((Center_AddOffset_011.top - Center_AddOffset_01.top)*10)/10) + .assertEqual(Math.round(vp2px(15)*10)/10); + expect(Math.round((Center_AddOffset_011.left - Center_AddOffset_01.left)*10)/10) + .assertEqual(Math.round(vp2px(35)*10)/10); + expect(Math.round((Center_AddOffset_01.right - Center_AddOffset_013.right)*10)/10) + .assertEqual(Math.round(vp2px(25)*10)/10); expect(Center_AddOffset_012.top).assertEqual(Center_AddOffset_013.top); expect(Center_AddOffset_012.top).assertEqual(Center_AddOffset_01.top); expect(Center_AddOffset_013.left).assertEqual(Center_AddOffset_012.right); - expect(Center_AddOffset_011.right - Center_AddOffset_011.left).assertEqual(vp2px(150)); - expect(Center_AddOffset_012.right - Center_AddOffset_012.left).assertEqual(vp2px(150)); - expect(Center_AddOffset_013.right - Center_AddOffset_013.left).assertEqual(vp2px(150)); - expect(Center_AddOffset_011.bottom - Center_AddOffset_011.top).assertEqual(vp2px(50)); - expect(Center_AddOffset_012.bottom - Center_AddOffset_012.top).assertEqual(vp2px(100)); - expect(Center_AddOffset_013.bottom - Center_AddOffset_013.top).assertEqual(vp2px(150)); + expect(Math.round(Center_AddOffset_011.right - Center_AddOffset_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddOffset_012.right - Center_AddOffset_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddOffset_013.right - Center_AddOffset_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddOffset_011.bottom - Center_AddOffset_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Center_AddOffset_012.bottom - Center_AddOffset_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Center_AddOffset_013.bottom - Center_AddOffset_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_0900] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddOneMargin.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddOneMargin.test.ets index 30dea8f1daed519dcdb1205a2208fc1327eaecd9..7514f878eea31582146d7f6483dd34d022c7b1a5 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddOneMargin.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddOneMargin.test.ets @@ -67,16 +67,18 @@ export default function AlignCenter_AddOneMargin() { expect(Center_AddOneMargin_012.top).assertEqual(Center_AddOneMargin_01.top); expect(Center_AddOneMargin_013.top).assertEqual(Center_AddOneMargin_012.top); expect(Center_AddOneMargin_013.left).assertEqual(Center_AddOneMargin_012.right); - expect(Center_AddOneMargin_011.left - Center_AddOneMargin_01.left).assertEqual(vp2px(25)); - expect(Center_AddOneMargin_011.top - Center_AddOneMargin_01.top).assertEqual(vp2px(20)); - expect(Center_AddOneMargin_012.left - Center_AddOneMargin_011.right).assertEqual(vp2px(20)); - expect(Center_AddOneMargin_01.right - Center_AddOneMargin_013.right).assertEqual(vp2px(5)); - expect(Center_AddOneMargin_011.bottom - Center_AddOneMargin_011.top).assertEqual(vp2px(50)); - expect(Center_AddOneMargin_012.bottom - Center_AddOneMargin_012.top).assertEqual(vp2px(100)); - expect(Center_AddOneMargin_013.bottom - Center_AddOneMargin_013.top).assertEqual(vp2px(150)); - expect(Center_AddOneMargin_011.right - Center_AddOneMargin_011.left).assertEqual(vp2px(150)); - expect(Center_AddOneMargin_012.right - Center_AddOneMargin_012.left).assertEqual(vp2px(150)); - expect(Center_AddOneMargin_013.right - Center_AddOneMargin_013.left).assertEqual(vp2px(150)); + expect(Math.round((Center_AddOneMargin_011.left - Center_AddOneMargin_01.left)*10)/10) + .assertEqual(Math.round(vp2px(25)*10)/10); + expect(Math.round(Center_AddOneMargin_011.top - Center_AddOneMargin_01.top)).assertEqual(vp2px(20)); + expect(Math.round(Center_AddOneMargin_012.left - Center_AddOneMargin_011.right)).assertEqual(vp2px(20)); + expect(Math.round((Center_AddOneMargin_01.right - Center_AddOneMargin_013.right)*10)/10) + .assertEqual(Math.round(vp2px(5)*10)/10); + expect(Math.round(Center_AddOneMargin_011.bottom - Center_AddOneMargin_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Center_AddOneMargin_012.bottom - Center_AddOneMargin_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Center_AddOneMargin_013.bottom - Center_AddOneMargin_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddOneMargin_011.right - Center_AddOneMargin_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddOneMargin_012.right - Center_AddOneMargin_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddOneMargin_013.right - Center_AddOneMargin_013.left)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1400] END'); done(); }) @@ -101,16 +103,21 @@ export default function AlignCenter_AddOneMargin() { let Center_AddOneMargin_01 = CommonFunc.getComponentRect('Center_AddOneMargin_01'); expect(Center_AddOneMargin_01.top).assertEqual(Center_AddOneMargin_012.top); expect(Center_AddOneMargin_013.top).assertEqual(Center_AddOneMargin_012.top); - expect(Center_AddOneMargin_011.left - Center_AddOneMargin_01.left).assertEqual(vp2px(500/17)); - expect(Center_AddOneMargin_011.top - Center_AddOneMargin_01.top).assertEqual(vp2px(30)); - expect(Center_AddOneMargin_012.left - Center_AddOneMargin_011.right).assertEqual(vp2px(500/17)); + expect(Math.round(Center_AddOneMargin_011.left - Center_AddOneMargin_01.left)) + .assertEqual(Math.round(vp2px(500/17))); + expect(Math.round(Center_AddOneMargin_011.top - Center_AddOneMargin_01.top)).assertEqual(vp2px(30)); + expect(Math.round(Center_AddOneMargin_012.left - Center_AddOneMargin_011.right)) + .assertEqual(Math.round(vp2px(500/17))); expect(Center_AddOneMargin_012.right).assertEqual(Center_AddOneMargin_013.left); - expect(Center_AddOneMargin_011.bottom - Center_AddOneMargin_011.top).assertEqual(vp2px(50)); - expect(Center_AddOneMargin_012.bottom - Center_AddOneMargin_012.top).assertEqual(vp2px(100)); - expect(Center_AddOneMargin_013.bottom - Center_AddOneMargin_013.top).assertEqual(vp2px(150)); - expect(Center_AddOneMargin_011.right - Center_AddOneMargin_011.left).assertEqual(vp2px(2500/17)); - expect(Center_AddOneMargin_012.right - Center_AddOneMargin_012.left).assertEqual(vp2px(2500/17)); - expect(Center_AddOneMargin_013.right - Center_AddOneMargin_013.left).assertEqual(vp2px(2500/17)); + expect(Math.round(Center_AddOneMargin_011.bottom - Center_AddOneMargin_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Center_AddOneMargin_012.bottom - Center_AddOneMargin_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Center_AddOneMargin_013.bottom - Center_AddOneMargin_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddOneMargin_011.right - Center_AddOneMargin_011.left)) + .assertEqual(Math.round(vp2px(2500/17))); + expect(Math.round(Center_AddOneMargin_012.right - Center_AddOneMargin_012.left)) + .assertEqual(Math.round(vp2px(2500/17))); + expect(Math.round(Center_AddOneMargin_013.right - Center_AddOneMargin_013.left)) + .assertEqual(Math.round(vp2px(2500/17))); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1500] END'); done(); }) diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddOneWidth.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddOneWidth.test.ets index f096dad8d94a0a3b2c5d583e9ee139de6ea0b8e8..099285212ecca13bd411a5526fe61695e7426f13 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddOneWidth.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddOneWidth.test.ets @@ -68,14 +68,14 @@ export default function AlignCenter_AddOneWidth() { expect(Center_AddOneWidth_011.top).assertEqual(Center_AddOneWidth_01.top); expect(Center_AddOneWidth_011.right).assertEqual(Center_AddOneWidth_012.left); expect(Center_AddOneWidth_012.right).assertEqual(Center_AddOneWidth_013.left); - expect(Center_AddOneWidth_011.left - Center_AddOneWidth_01.left).assertEqual(vp2px(20)); - expect(Center_AddOneWidth_01.right - Center_AddOneWidth_013.right).assertEqual(vp2px(20)); - expect(Center_AddOneWidth_011.right - Center_AddOneWidth_011.left).assertEqual(vp2px(160)); - expect(Center_AddOneWidth_012.right - Center_AddOneWidth_012.left).assertEqual(vp2px(150)); - expect(Center_AddOneWidth_013.right - Center_AddOneWidth_013.left).assertEqual(vp2px(150)); - expect(Center_AddOneWidth_011.bottom - Center_AddOneWidth_011.top).assertEqual(vp2px(50)); - expect(Center_AddOneWidth_012.bottom - Center_AddOneWidth_012.top).assertEqual(vp2px(100)); - expect(Center_AddOneWidth_013.bottom - Center_AddOneWidth_013.top).assertEqual(vp2px(150)); + expect(Math.round(Center_AddOneWidth_011.left - Center_AddOneWidth_01.left)).assertEqual(vp2px(20)); + expect(Math.round(Center_AddOneWidth_01.right - Center_AddOneWidth_013.right)).assertEqual(vp2px(20)); + expect(Math.round(Center_AddOneWidth_011.right - Center_AddOneWidth_011.left)).assertEqual(vp2px(160)); + expect(Math.round(Center_AddOneWidth_012.right - Center_AddOneWidth_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddOneWidth_013.right - Center_AddOneWidth_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddOneWidth_011.bottom - Center_AddOneWidth_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Center_AddOneWidth_012.bottom - Center_AddOneWidth_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Center_AddOneWidth_013.bottom - Center_AddOneWidth_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1300] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddPadding.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddPadding.test.ets index 5cdbb7d515609ae7ed64ad8ef2b9543ea88ab601..676fa0fc082c3a254fb27b18a7bf76a49b8ee6f4 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddPadding.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddPadding.test.ets @@ -68,15 +68,15 @@ export default function AlignCenter_AddPadding() { expect(Center_AddPadding_012.top).assertEqual(Center_AddPadding_013.top); expect(Center_AddPadding_012.left).assertEqual(Center_AddPadding_011.right); expect(Center_AddPadding_013.left).assertEqual(Center_AddPadding_012.right); - expect(Center_AddPadding_011.left - Center_AddPadding_01.left).assertEqual(vp2px(30)); - expect(Center_AddPadding_01.right - Center_AddPadding_013.right).assertEqual(vp2px(30)); - expect(Center_AddPadding_011.top - Center_AddPadding_01.top).assertEqual(vp2px(30)); - expect(Center_AddPadding_011.bottom - Center_AddPadding_011.top).assertEqual(vp2px(50)); - expect(Center_AddPadding_012.bottom - Center_AddPadding_012.top).assertEqual(vp2px(100)); - expect(Center_AddPadding_013.bottom - Center_AddPadding_013.top).assertEqual(vp2px(150)); - expect(Center_AddPadding_011.right - Center_AddPadding_011.left).assertEqual(vp2px(440/3)); - expect(Center_AddPadding_012.right - Center_AddPadding_012.left).assertEqual(vp2px(440/3)); - expect(Center_AddPadding_013.right - Center_AddPadding_013.left).assertEqual(vp2px(440/3)); + expect(Math.round(Center_AddPadding_011.left - Center_AddPadding_01.left)).assertEqual(vp2px(30)); + expect(Math.round(Center_AddPadding_01.right - Center_AddPadding_013.right)).assertEqual(vp2px(30)); + expect(Math.round(Center_AddPadding_011.top - Center_AddPadding_01.top)).assertEqual(vp2px(30)); + expect(Math.round(Center_AddPadding_011.bottom - Center_AddPadding_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Center_AddPadding_012.bottom - Center_AddPadding_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Center_AddPadding_013.bottom - Center_AddPadding_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddPadding_011.right - Center_AddPadding_011.left)).assertEqual(Math.round(vp2px(440/3))); + expect(Math.round(Center_AddPadding_012.right - Center_AddPadding_012.left)).assertEqual(Math.round(vp2px(440/3))); + expect(Math.round(Center_AddPadding_013.right - Center_AddPadding_013.left)).assertEqual(Math.round(vp2px(440/3))); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_0300] END'); done(); }); @@ -103,15 +103,17 @@ export default function AlignCenter_AddPadding() { expect(Center_AddPadding_012.top).assertEqual(Center_AddPadding_013.top); expect(Center_AddPadding_012.left) .assertEqual(Center_AddPadding_011.right); expect(Center_AddPadding_013.left) .assertEqual(Center_AddPadding_012.right); - expect(Center_AddPadding_011.top - Center_AddPadding_01.top).assertEqual(vp2px(20)); - expect(Center_AddPadding_011.left - Center_AddPadding_01.left).assertEqual(vp2px(25)); - expect(Center_AddPadding_01.right - Center_AddPadding_013.right).assertEqual(vp2px(25)); - expect(Center_AddPadding_011.right - Center_AddPadding_011.left).assertEqual(vp2px(150)); - expect(Center_AddPadding_012.right - Center_AddPadding_012.left).assertEqual(vp2px(150)); - expect(Center_AddPadding_013.right - Center_AddPadding_013.left).assertEqual(vp2px(150)); - expect(Center_AddPadding_011.bottom - Center_AddPadding_011.top).assertEqual(vp2px(50)); - expect(Center_AddPadding_012.bottom - Center_AddPadding_012.top).assertEqual(vp2px(100)); - expect(Center_AddPadding_013.bottom - Center_AddPadding_013.top).assertEqual(vp2px(150)); + expect(Math.round(Center_AddPadding_011.top - Center_AddPadding_01.top)).assertEqual(vp2px(20)); + expect(Math.round((Center_AddPadding_011.left - Center_AddPadding_01.left)*10)/10) + .assertEqual(Math.round(vp2px(25)*10)/10); + expect(Math.round((Center_AddPadding_01.right - Center_AddPadding_013.right)*10)/10) + .assertEqual(Math.round(vp2px(25)*10)/10); + expect(Math.round(Center_AddPadding_011.right - Center_AddPadding_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddPadding_012.right - Center_AddPadding_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddPadding_013.right - Center_AddPadding_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddPadding_011.bottom - Center_AddPadding_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Center_AddPadding_012.bottom - Center_AddPadding_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Center_AddPadding_013.bottom - Center_AddPadding_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_0400] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddVisibility.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddVisibility.test.ets index 74f2357c0c3b43f5bbf945ef75f18392ac6803ef..f9d67ab36c0d6130ab1a15f6234d387ff673444e 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddVisibility.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddVisibility.test.ets @@ -68,12 +68,12 @@ export default function AlignCenter_AddVisibility() { expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_013.top); expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_01.top); expect(Center_AddVisibility_012.right).assertEqual(Center_AddVisibility_013.left); - expect(Center_AddVisibility_012.left - Center_AddVisibility_01.left).assertEqual(vp2px(100)); - expect(Center_AddVisibility_01.right - Center_AddVisibility_013.right).assertEqual(vp2px(100)); - expect(Center_AddVisibility_012.right - Center_AddVisibility_012.left).assertEqual(vp2px(150)); - expect(Center_AddVisibility_013.right - Center_AddVisibility_013.left).assertEqual(vp2px(150)); - expect(Center_AddVisibility_012.bottom - Center_AddVisibility_012.top).assertEqual(vp2px(100)); - expect(Center_AddVisibility_013.bottom - Center_AddVisibility_013.top).assertEqual(vp2px(150)); + expect(Math.round(Center_AddVisibility_012.left - Center_AddVisibility_01.left)).assertEqual(vp2px(100)); + expect(Math.round(Center_AddVisibility_01.right - Center_AddVisibility_013.right)).assertEqual(vp2px(100)); + expect(Math.round(Center_AddVisibility_012.right - Center_AddVisibility_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddVisibility_013.right - Center_AddVisibility_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddVisibility_012.bottom - Center_AddVisibility_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Center_AddVisibility_013.bottom - Center_AddVisibility_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1000] END'); done(); }); @@ -104,14 +104,16 @@ export default function AlignCenter_AddVisibility() { expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_01.top); expect(Center_AddVisibility_011.right).assertEqual(Center_AddVisibility_012.left); expect(Center_AddVisibility_012.right).assertEqual(Center_AddVisibility_013.left); - expect(Center_AddVisibility_011.left - Center_AddVisibility_01.left).assertEqual(vp2px(25)); - expect(Center_AddVisibility_01.right - Center_AddVisibility_013.right).assertEqual(vp2px(25)); - expect(Center_AddVisibility_011.right - Center_AddVisibility_011.left).assertEqual(vp2px(150)); - expect(Center_AddVisibility_012.right - Center_AddVisibility_012.left).assertEqual(vp2px(150)); - expect(Center_AddVisibility_013.right - Center_AddVisibility_013.left).assertEqual(vp2px(150)); - expect(Center_AddVisibility_011.bottom - Center_AddVisibility_011.top).assertEqual(vp2px(50)); - expect(Center_AddVisibility_012.bottom - Center_AddVisibility_012.top).assertEqual(vp2px(100)); - expect(Center_AddVisibility_013.bottom - Center_AddVisibility_013.top).assertEqual(vp2px(150)); + expect(Math.round((Center_AddVisibility_011.left - Center_AddVisibility_01.left)*10)/10) + .assertEqual(Math.round(vp2px(25)*10)/10); + expect(Math.round((Center_AddVisibility_01.right - Center_AddVisibility_013.right)*10)/10) + .assertEqual(Math.round(vp2px(25)*10)/10); + expect(Math.round(Center_AddVisibility_011.right - Center_AddVisibility_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddVisibility_012.right - Center_AddVisibility_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddVisibility_013.right - Center_AddVisibility_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddVisibility_011.bottom - Center_AddVisibility_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Center_AddVisibility_012.bottom - Center_AddVisibility_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Center_AddVisibility_013.bottom - Center_AddVisibility_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1100] END'); done(); }); @@ -142,14 +144,16 @@ export default function AlignCenter_AddVisibility() { expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_01.top); expect(Center_AddVisibility_011.right).assertEqual(Center_AddVisibility_012.left); expect(Center_AddVisibility_012.right).assertEqual(Center_AddVisibility_013.left); - expect(Center_AddVisibility_011.left - Center_AddVisibility_01.left).assertEqual(vp2px(25)); - expect(Center_AddVisibility_01.right - Center_AddVisibility_013.right).assertEqual(vp2px(25)); - expect(Center_AddVisibility_011.right - Center_AddVisibility_011.left).assertEqual(vp2px(150)); - expect(Center_AddVisibility_012.right - Center_AddVisibility_012.left).assertEqual(vp2px(150)); - expect(Center_AddVisibility_013.right - Center_AddVisibility_013.left).assertEqual(vp2px(150)); - expect(Center_AddVisibility_011.bottom - Center_AddVisibility_011.top).assertEqual(vp2px(50)); - expect(Center_AddVisibility_012.bottom - Center_AddVisibility_012.top).assertEqual(vp2px(100)); - expect(Center_AddVisibility_013.bottom - Center_AddVisibility_013.top).assertEqual(vp2px(150)); + expect(Math.round((Center_AddVisibility_011.left - Center_AddVisibility_01.left)*10)/10) + .assertEqual(Math.round(vp2px(25)*10)/10); + expect(Math.round((Center_AddVisibility_01.right - Center_AddVisibility_013.right)*10)/10) + .assertEqual(Math.round(vp2px(25)*10)/10); + expect(Math.round(Center_AddVisibility_011.right - Center_AddVisibility_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddVisibility_012.right - Center_AddVisibility_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddVisibility_013.right - Center_AddVisibility_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_AddVisibility_011.bottom - Center_AddVisibility_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Center_AddVisibility_012.bottom - Center_AddVisibility_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Center_AddVisibility_013.bottom - Center_AddVisibility_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1700] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_NoSpace.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_NoSpace.test.ets index 56ef32e17f9c8d1da3db89913dd55801d49f4674..0333e1764fc4a89f309c794fafc8ae4957f14988 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_NoSpace.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_NoSpace.test.ets @@ -71,12 +71,12 @@ export default function AlignCenter_NoSpace() { expect(Center_NoSpace_013.left).assertEqual(Center_NoSpace_012.right); expect(Center_NoSpace_011.left).assertEqual(Center_NoSpace_01.left); expect(Center_NoSpace_013.right).assertEqual(Center_NoSpace_01.right); - expect(Center_NoSpace_011.bottom - Center_NoSpace_011.top).assertEqual(vp2px(50)); - expect(Center_NoSpace_012.bottom - Center_NoSpace_012.top).assertEqual(vp2px(100)); - expect(Center_NoSpace_013.bottom - Center_NoSpace_013.top).assertEqual(vp2px(150)); - expect(Center_NoSpace_011.right - Center_NoSpace_011.left).assertEqual(vp2px(400/3)); - expect(Center_NoSpace_012.right - Center_NoSpace_012.left).assertEqual(vp2px(400/3)); - expect(Center_NoSpace_013.right - Center_NoSpace_013.left).assertEqual(vp2px(400/3)); + expect(Math.round(Center_NoSpace_011.bottom - Center_NoSpace_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Center_NoSpace_012.bottom - Center_NoSpace_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Center_NoSpace_013.bottom - Center_NoSpace_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Center_NoSpace_011.right - Center_NoSpace_011.left)).assertEqual(Math.round(vp2px(400/3))); + expect(Math.round(Center_NoSpace_012.right - Center_NoSpace_012.left)).assertEqual(Math.round(vp2px(400/3))); + expect(Math.round(Center_NoSpace_013.right - Center_NoSpace_013.left)).assertEqual(Math.round(vp2px(400/3))); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_0100] END'); done(); }); @@ -104,15 +104,15 @@ export default function AlignCenter_NoSpace() { expect(Center_NoSpace_011.top).assertEqual(Center_NoSpace_01.top); expect(Center_NoSpace_011.right).assertEqual(Center_NoSpace_012.left); expect(Center_NoSpace_013.left).assertEqual(Center_NoSpace_012.right); - expect(Center_NoSpace_011.left - Center_NoSpace_01.left) - .assertEqual(Center_NoSpace_01.right - Center_NoSpace_013.right); - expect(Center_NoSpace_011.left - Center_NoSpace_01.left).assertEqual(vp2px(25)); - expect(Center_NoSpace_011.right - Center_NoSpace_011.left).assertEqual(vp2px(150)); - expect(Center_NoSpace_012.right - Center_NoSpace_012.left).assertEqual(vp2px(150)); - expect(Center_NoSpace_013.right - Center_NoSpace_013.left).assertEqual(vp2px(150)); - expect(Center_NoSpace_011.bottom - Center_NoSpace_011.top).assertEqual(vp2px(50)); - expect(Center_NoSpace_012.bottom - Center_NoSpace_012.top).assertEqual(vp2px(100)); - expect(Center_NoSpace_013.bottom - Center_NoSpace_013.top).assertEqual(vp2px(150)); + expect(Math.round(Center_NoSpace_011.left - Center_NoSpace_01.left)) + .assertEqual(Math.round(Center_NoSpace_01.right - Center_NoSpace_013.right)); + expect(Math.round((Center_NoSpace_011.left - Center_NoSpace_01.left)*10)/10).assertEqual(Math.round(vp2px(25)*10)/10); + expect(Math.round(Center_NoSpace_011.right - Center_NoSpace_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_NoSpace_012.right - Center_NoSpace_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_NoSpace_013.right - Center_NoSpace_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Center_NoSpace_011.bottom - Center_NoSpace_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Center_NoSpace_012.bottom - Center_NoSpace_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Center_NoSpace_013.bottom - Center_NoSpace_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_0200] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddAlign.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddAlign.test.ets index ae41810520da02740b40a0c5bebcb2c81e9558ff..f0494ee5fcab0e8667b8aa85bd70566aaee5da81 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddAlign.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddAlign.test.ets @@ -69,13 +69,13 @@ export default function AlignEnd_AddAlign() { expect(End_AddAlign_012.left).assertEqual(End_AddAlign_011.right ); expect(End_AddAlign_013.left).assertEqual(End_AddAlign_012.right ); expect(End_AddAlign_013.right).assertEqual(End_AddAlign_01.right ); - expect(End_AddAlign_011.left - End_AddAlign_01.left).assertEqual(vp2px(50)); - expect(End_AddAlign_011.right - End_AddAlign_011.left).assertEqual(vp2px(150)); - expect(End_AddAlign_012.right - End_AddAlign_012.left).assertEqual(vp2px(150)); - expect(End_AddAlign_013.right - End_AddAlign_013.left).assertEqual(vp2px(150)); - expect(End_AddAlign_011.bottom - End_AddAlign_011.top).assertEqual(vp2px(50)); - expect(End_AddAlign_012.bottom - End_AddAlign_012.top).assertEqual(vp2px(100)); - expect(End_AddAlign_013.bottom - End_AddAlign_013.top).assertEqual(vp2px(150)); + expect(Math.round(End_AddAlign_011.left - End_AddAlign_01.left)).assertEqual(vp2px(50)); + expect(Math.round(End_AddAlign_011.right - End_AddAlign_011.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddAlign_012.right - End_AddAlign_012.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddAlign_013.right - End_AddAlign_013.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddAlign_011.bottom - End_AddAlign_011.top)).assertEqual(vp2px(50)); + expect(Math.round(End_AddAlign_012.bottom - End_AddAlign_012.top)).assertEqual(vp2px(100)); + expect(Math.round(End_AddAlign_013.bottom - End_AddAlign_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0800] END'); done() }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddAllSpace.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddAllSpace.test.ets index 96f601e3135cc39e8afecffb7cff10cabb0f02ad..b1283b4ebe5dc1b85786625ff47db459f41bfd8f 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddAllSpace.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddAllSpace.test.ets @@ -68,17 +68,17 @@ export default function AlignEnd_AddAllSpace() { expect(End_AddAllSpace_012.top).assertEqual(End_AddAllSpace_013.top); expect(End_AddAllSpace_012.left).assertEqual(End_AddAllSpace_011.right); expect(End_AddAllSpace_013.left).assertEqual(End_AddAllSpace_012.right); - expect(End_AddAllSpace_011.left - End_AddAllSpace_01.left).assertEqual(vp2px(30)); - expect(End_AddAllSpace_01.right - End_AddAllSpace_013.right).assertEqual(vp2px(30)); - expect(End_AddAllSpace_011.top - End_AddAllSpace_01.top).assertEqual(vp2px(30)); - expect(End_AddAllSpace_01.left - End_AddAllSpace_01_Box.left).assertEqual(vp2px(10)); - expect(End_AddAllSpace_01.top - End_AddAllSpace_01_Box.top).assertEqual(vp2px(10)); - expect(End_AddAllSpace_011.bottom - End_AddAllSpace_011.top).assertEqual(vp2px(50)); - expect(End_AddAllSpace_012.bottom - End_AddAllSpace_012.top).assertEqual(vp2px(100)); - expect(End_AddAllSpace_013.bottom - End_AddAllSpace_013.top).assertEqual(vp2px(150)); - expect(End_AddAllSpace_011.right - End_AddAllSpace_011.left).assertEqual(vp2px(440/3)); - expect(End_AddAllSpace_012.right - End_AddAllSpace_012.left).assertEqual(vp2px(440/3)); - expect(End_AddAllSpace_013.right - End_AddAllSpace_013.left).assertEqual(vp2px(440/3)); + expect(Math.round(End_AddAllSpace_011.left - End_AddAllSpace_01.left)).assertEqual(vp2px(30)); + expect(Math.round(End_AddAllSpace_01.right - End_AddAllSpace_013.right)).assertEqual(vp2px(30)); + expect(Math.round(End_AddAllSpace_011.top - End_AddAllSpace_01.top)).assertEqual(vp2px(30)); + expect(Math.round(End_AddAllSpace_01.left - End_AddAllSpace_01_Box.left)).assertEqual(vp2px(10)); + expect(Math.round(End_AddAllSpace_01.top - End_AddAllSpace_01_Box.top)).assertEqual(vp2px(10)); + expect(Math.round(End_AddAllSpace_011.bottom - End_AddAllSpace_011.top)).assertEqual(vp2px(50)); + expect(Math.round(End_AddAllSpace_012.bottom - End_AddAllSpace_012.top)).assertEqual(vp2px(100)); + expect(Math.round(End_AddAllSpace_013.bottom - End_AddAllSpace_013.top)).assertEqual(vp2px(150)); + expect(Math.round(End_AddAllSpace_011.right - End_AddAllSpace_011.left)).assertEqual(Math.round(vp2px(440/3))); + expect(Math.round(End_AddAllSpace_012.right - End_AddAllSpace_012.left)).assertEqual(Math.round(vp2px(440/3))); + expect(Math.round(End_AddAllSpace_013.right - End_AddAllSpace_013.left)).assertEqual(Math.round(vp2px(440/3))); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0600] END'); done(); }); @@ -106,17 +106,17 @@ export default function AlignEnd_AddAllSpace() { expect(End_AddAllSpace_012.top).assertEqual(End_AddAllSpace_013.top); expect(End_AddAllSpace_012.left).assertEqual(End_AddAllSpace_011.right); expect(End_AddAllSpace_013.left).assertEqual(End_AddAllSpace_012.right); - expect(End_AddAllSpace_011.left - End_AddAllSpace_01.left).assertEqual(vp2px(30)); - expect(End_AddAllSpace_01.right - End_AddAllSpace_013.right).assertEqual(vp2px(20)); - expect(End_AddAllSpace_011.top - End_AddAllSpace_01.top).assertEqual(vp2px(20)); - expect(End_AddAllSpace_01.left - End_AddAllSpace_01_Box.left).assertEqual(vp2px(10)); - expect(End_AddAllSpace_01.top - End_AddAllSpace_01_Box.top).assertEqual(vp2px(10)); - expect(End_AddAllSpace_011.right - End_AddAllSpace_011.left).assertEqual(vp2px(150)); - expect(End_AddAllSpace_012.right - End_AddAllSpace_012.left).assertEqual(vp2px(150)); - expect(End_AddAllSpace_013.right - End_AddAllSpace_013.left).assertEqual(vp2px(150)); - expect(End_AddAllSpace_011.bottom - End_AddAllSpace_011.top).assertEqual(vp2px(50)); - expect(End_AddAllSpace_012.bottom - End_AddAllSpace_012.top).assertEqual(vp2px(100)); - expect(End_AddAllSpace_013.bottom - End_AddAllSpace_013.top).assertEqual(vp2px(150)); + expect(Math.round(End_AddAllSpace_011.left - End_AddAllSpace_01.left)).assertEqual(vp2px(30)); + expect(Math.round(End_AddAllSpace_01.right - End_AddAllSpace_013.right)).assertEqual(vp2px(20)); + expect(Math.round(End_AddAllSpace_011.top - End_AddAllSpace_01.top)).assertEqual(vp2px(20)); + expect(Math.round(End_AddAllSpace_01.left - End_AddAllSpace_01_Box.left)).assertEqual(vp2px(10)); + expect(Math.round(End_AddAllSpace_01.top - End_AddAllSpace_01_Box.top)).assertEqual(vp2px(10)); + expect(Math.round(End_AddAllSpace_011.right - End_AddAllSpace_011.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddAllSpace_012.right - End_AddAllSpace_012.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddAllSpace_013.right - End_AddAllSpace_013.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddAllSpace_011.bottom - End_AddAllSpace_011.top)).assertEqual(vp2px(50)); + expect(Math.round(End_AddAllSpace_012.bottom - End_AddAllSpace_012.top)).assertEqual(vp2px(100)); + expect(Math.round(End_AddAllSpace_013.bottom - End_AddAllSpace_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0700] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddLayoutWeight.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddLayoutWeight.test.ets index b09dc952e6ae062a9fe1aea012ba74a435a51892..4ebab6b9c97390abc6354b900483ffb107bc0919 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddLayoutWeight.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddLayoutWeight.test.ets @@ -72,12 +72,12 @@ export default function AlignEnd_AddLayoutWeight() { expect(End_AddLayoutWeight_012.right).assertEqual(End_AddLayoutWeight_013.left); expect(End_AddLayoutWeight_011.left).assertEqual(End_AddLayoutWeight_01.left); expect(End_AddLayoutWeight_013.right).assertEqual(End_AddLayoutWeight_01.right); - expect(End_AddLayoutWeight_011.right - End_AddLayoutWeight_011.left).assertEqual(vp2px(100)); - expect(End_AddLayoutWeight_012.right - End_AddLayoutWeight_012.left).assertEqual(vp2px(200)); - expect(End_AddLayoutWeight_013.right - End_AddLayoutWeight_013.left).assertEqual(vp2px(200)); - expect(End_AddLayoutWeight_011.bottom - End_AddLayoutWeight_011.top).assertEqual(vp2px(50)); - expect(End_AddLayoutWeight_012.bottom - End_AddLayoutWeight_012.top).assertEqual(vp2px(100)); - expect(End_AddLayoutWeight_013.bottom - End_AddLayoutWeight_013.top).assertEqual(vp2px(150)); + expect(Math.round(End_AddLayoutWeight_011.right - End_AddLayoutWeight_011.left)).assertEqual(vp2px(100)); + expect(Math.round(End_AddLayoutWeight_012.right - End_AddLayoutWeight_012.left)).assertEqual(vp2px(200)); + expect(Math.round(End_AddLayoutWeight_013.right - End_AddLayoutWeight_013.left)).assertEqual(vp2px(200)); + expect(Math.round(End_AddLayoutWeight_011.bottom - End_AddLayoutWeight_011.top)).assertEqual(vp2px(50)); + expect(Math.round(End_AddLayoutWeight_012.bottom - End_AddLayoutWeight_012.top)).assertEqual(vp2px(100)); + expect(Math.round(End_AddLayoutWeight_013.bottom - End_AddLayoutWeight_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1200] END'); done(); }); @@ -108,14 +108,14 @@ export default function AlignEnd_AddLayoutWeight() { expect(End_AddLayoutWeight_012.right).assertEqual(End_AddLayoutWeight_013.left); expect(End_AddLayoutWeight_011.left).assertEqual(End_AddLayoutWeight_01.left); expect(End_AddLayoutWeight_013.right).assertEqual(End_AddLayoutWeight_01.right); - let oneWidth = End_AddLayoutWeight_011.right - End_AddLayoutWeight_011.left; - let twoWidth = End_AddLayoutWeight_012.right - End_AddLayoutWeight_012.left; + let oneWidth = Math.round(End_AddLayoutWeight_011.right - End_AddLayoutWeight_011.left); + let twoWidth = Math.round(End_AddLayoutWeight_012.right - End_AddLayoutWeight_012.left); expect(twoWidth / oneWidth).assertEqual(2); expect(twoWidth + oneWidth).assertEqual(vp2px(350)); - expect(End_AddLayoutWeight_013.right - End_AddLayoutWeight_013.left).assertEqual(vp2px(150)); - expect(End_AddLayoutWeight_011.bottom - End_AddLayoutWeight_011.top).assertEqual(vp2px(50)); - expect(End_AddLayoutWeight_012.bottom - End_AddLayoutWeight_012.top).assertEqual(vp2px(100)); - expect(End_AddLayoutWeight_013.bottom - End_AddLayoutWeight_013.top).assertEqual(vp2px(150)); + expect(Math.round(End_AddLayoutWeight_013.right - End_AddLayoutWeight_013.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddLayoutWeight_011.bottom - End_AddLayoutWeight_011.top)).assertEqual(vp2px(50)); + expect(Math.round(End_AddLayoutWeight_012.bottom - End_AddLayoutWeight_012.top)).assertEqual(vp2px(100)); + expect(Math.round(End_AddLayoutWeight_013.bottom - End_AddLayoutWeight_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1600] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddMargin.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddMargin.test.ets index 7091645358915ee3a6e8fbfe746c335b57bf3a36..122de95455f59788803caea44a9a788b5dfaa2bb 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddMargin.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddMargin.test.ets @@ -70,15 +70,15 @@ export default function AlignEnd_AddMargin() { expect(End_AddMargin_012.left).assertEqual(End_AddMargin_011.right); expect(End_AddMargin_013.left).assertEqual(End_AddMargin_012.right); expect(End_AddMargin_013.right).assertEqual(End_AddMargin_01.right); - expect(End_AddMargin_01.left - End_AddMargin_01_Box.left).assertEqual(vp2px(20)); - expect(End_AddMargin_01.top - End_AddMargin_01_Box.top).assertEqual(vp2px(20)); - expect(End_AddMargin_011.left - End_AddMargin_01.left).assertEqual(vp2px(50)); - expect(End_AddMargin_011.bottom - End_AddMargin_011.top).assertEqual(vp2px(50)); - expect(End_AddMargin_012.bottom - End_AddMargin_012.top).assertEqual(vp2px(100)); - expect(End_AddMargin_013.bottom - End_AddMargin_013.top).assertEqual(vp2px(150)); - expect(End_AddMargin_011.right - End_AddMargin_011.left).assertEqual(vp2px(150)); - expect(End_AddMargin_012.right - End_AddMargin_012.left).assertEqual(vp2px(150)); - expect(End_AddMargin_013.right - End_AddMargin_013.left).assertEqual(vp2px(150)); + expect(Math.round(End_AddMargin_01.left - End_AddMargin_01_Box.left)).assertEqual(vp2px(20)); + expect(Math.round(End_AddMargin_01.top - End_AddMargin_01_Box.top)).assertEqual(vp2px(20)); + expect(Math.round(End_AddMargin_011.left - End_AddMargin_01.left)).assertEqual(vp2px(50)); + expect(Math.round(End_AddMargin_011.bottom - End_AddMargin_011.top)).assertEqual(vp2px(50)); + expect(Math.round(End_AddMargin_012.bottom - End_AddMargin_012.top)).assertEqual(vp2px(100)); + expect(Math.round(End_AddMargin_013.bottom - End_AddMargin_013.top)).assertEqual(vp2px(150)); + expect(Math.round(End_AddMargin_011.right - End_AddMargin_011.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddMargin_012.right - End_AddMargin_012.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddMargin_013.right - End_AddMargin_013.left)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0500] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOffset.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOffset.test.ets index 7fe4045309860fd9fae32470a91d88a657830e8a..adb3dfaa6801818e978bd3fa47dec63b13dba9cf 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOffset.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOffset.test.ets @@ -63,19 +63,19 @@ export default function AlignEnd_AddOffset() { let End_AddOffset_012 = CommonFunc.getComponentRect('End_AddOffset_012'); let End_AddOffset_013 = CommonFunc.getComponentRect('End_AddOffset_013'); let End_AddOffset_01 = CommonFunc.getComponentRect('End_AddOffset_01'); - expect(End_AddOffset_011.top - End_AddOffset_01.top).assertEqual(vp2px(15)); - expect(End_AddOffset_011.right - End_AddOffset_012.left).assertEqual(vp2px(10)); - expect(End_AddOffset_011.left - End_AddOffset_01.left).assertEqual(vp2px(60)); + expect(Math.round((End_AddOffset_011.top - End_AddOffset_01.top)*10)/10).assertEqual(Math.round(vp2px(15)*10)/10); + expect(Math.round(End_AddOffset_011.right - End_AddOffset_012.left)).assertEqual(vp2px(10)); + expect(Math.round(End_AddOffset_011.left - End_AddOffset_01.left)).assertEqual(vp2px(60)); expect(End_AddOffset_012.top).assertEqual(End_AddOffset_013.top); expect(End_AddOffset_012.top).assertEqual(End_AddOffset_01.top); expect(End_AddOffset_013.left).assertEqual(End_AddOffset_012.right); expect(End_AddOffset_01.right).assertEqual(End_AddOffset_013.right); - expect(End_AddOffset_011.right - End_AddOffset_011.left).assertEqual(vp2px(150)); - expect(End_AddOffset_012.right - End_AddOffset_012.left).assertEqual(vp2px(150)); - expect(End_AddOffset_013.right - End_AddOffset_013.left).assertEqual(vp2px(150)); - expect(End_AddOffset_011.bottom - End_AddOffset_011.top).assertEqual(vp2px(50)); - expect(End_AddOffset_012.bottom - End_AddOffset_012.top).assertEqual(vp2px(100)); - expect(End_AddOffset_013.bottom - End_AddOffset_013.top).assertEqual(vp2px(150)); + expect(Math.round(End_AddOffset_011.right - End_AddOffset_011.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddOffset_012.right - End_AddOffset_012.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddOffset_013.right - End_AddOffset_013.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddOffset_011.bottom - End_AddOffset_011.top)).assertEqual(vp2px(50)); + expect(Math.round(End_AddOffset_012.bottom - End_AddOffset_012.top)).assertEqual(vp2px(100)); + expect(Math.round(End_AddOffset_013.bottom - End_AddOffset_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0900] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOneMargin.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOneMargin.test.ets index d89f9db6ea4a3d15c2945d434b5358d96e18b76d..ec1c7f504ae6495754819f86b6ce3116a6d2cf7f 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOneMargin.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOneMargin.test.ets @@ -64,19 +64,19 @@ export default function AlignEnd_AddOneMargin() { let End_AddOneMargin_012 = CommonFunc.getComponentRect('End_AddOneMargin_012'); let End_AddOneMargin_013 = CommonFunc.getComponentRect('End_AddOneMargin_013'); let End_AddOneMargin_01 = CommonFunc.getComponentRect('End_AddOneMargin_01'); - expect(End_AddOneMargin_011.top - End_AddOneMargin_01.top).assertEqual(vp2px(20)); - expect(End_AddOneMargin_012.left - End_AddOneMargin_011.right).assertEqual(vp2px(20)); - expect(End_AddOneMargin_011.left - End_AddOneMargin_01.left).assertEqual(vp2px(30)); + expect(Math.round(End_AddOneMargin_011.top - End_AddOneMargin_01.top)).assertEqual(vp2px(20)); + expect(Math.round(End_AddOneMargin_012.left - End_AddOneMargin_011.right)).assertEqual(vp2px(20)); + expect(Math.round(End_AddOneMargin_011.left - End_AddOneMargin_01.left)).assertEqual(vp2px(30)); expect(End_AddOneMargin_013.top).assertEqual(End_AddOneMargin_012.top); expect(End_AddOneMargin_012.top).assertEqual(End_AddOneMargin_01.top); expect(End_AddOneMargin_013.left).assertEqual(End_AddOneMargin_012.right); expect(End_AddOneMargin_013.right).assertEqual(End_AddOneMargin_01.right); - expect(End_AddOneMargin_011.bottom - End_AddOneMargin_011.top).assertEqual(vp2px(50)); - expect(End_AddOneMargin_012.bottom - End_AddOneMargin_012.top).assertEqual(vp2px(100)); - expect(End_AddOneMargin_013.bottom - End_AddOneMargin_013.top).assertEqual(vp2px(150)); - expect(End_AddOneMargin_011.right - End_AddOneMargin_011.left).assertEqual(vp2px(150)); - expect(End_AddOneMargin_012.right - End_AddOneMargin_012.left).assertEqual(vp2px(150)); - expect(End_AddOneMargin_013.right - End_AddOneMargin_013.left).assertEqual(vp2px(150)); + expect(Math.round(End_AddOneMargin_011.bottom - End_AddOneMargin_011.top)).assertEqual(vp2px(50)); + expect(Math.round(End_AddOneMargin_012.bottom - End_AddOneMargin_012.top)).assertEqual(vp2px(100)); + expect(Math.round(End_AddOneMargin_013.bottom - End_AddOneMargin_013.top)).assertEqual(vp2px(150)); + expect(Math.round(End_AddOneMargin_011.right - End_AddOneMargin_011.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddOneMargin_012.right - End_AddOneMargin_012.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddOneMargin_013.right - End_AddOneMargin_013.left)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1400] END'); done(); }) @@ -99,19 +99,19 @@ export default function AlignEnd_AddOneMargin() { let End_AddOneMargin_012 = CommonFunc.getComponentRect('End_AddOneMargin_012'); let End_AddOneMargin_013 = CommonFunc.getComponentRect('End_AddOneMargin_013'); let End_AddOneMargin_01 = CommonFunc.getComponentRect('End_AddOneMargin_01'); - expect(End_AddOneMargin_011.top - End_AddOneMargin_01.top).assertEqual(vp2px(30)); - expect(End_AddOneMargin_012.left - End_AddOneMargin_011.right).assertEqual(vp2px(500/17)); - expect(End_AddOneMargin_011.left - End_AddOneMargin_01.left).assertEqual(vp2px(500/17)); + expect(Math.round(End_AddOneMargin_011.top - End_AddOneMargin_01.top)).assertEqual(vp2px(30)); + expect(Math.round(End_AddOneMargin_012.left - End_AddOneMargin_011.right)).assertEqual(Math.round(vp2px(500/17))); + expect(Math.round(End_AddOneMargin_011.left - End_AddOneMargin_01.left)).assertEqual(Math.round(vp2px(500/17))); expect(End_AddOneMargin_013.top).assertEqual(End_AddOneMargin_012.top); expect(End_AddOneMargin_012.top).assertEqual(End_AddOneMargin_01.top); expect(End_AddOneMargin_013.left).assertEqual(End_AddOneMargin_012.right); expect(End_AddOneMargin_013.right).assertEqual(End_AddOneMargin_01.right); - expect(End_AddOneMargin_011.bottom - End_AddOneMargin_011.top).assertEqual(vp2px(50)); - expect(End_AddOneMargin_012.bottom - End_AddOneMargin_012.top).assertEqual(vp2px(100)); - expect(End_AddOneMargin_013.bottom - End_AddOneMargin_013.top).assertEqual(vp2px(150)); - expect(End_AddOneMargin_011.right - End_AddOneMargin_011.left).assertEqual(vp2px(2500/17)); - expect(End_AddOneMargin_012.right - End_AddOneMargin_012.left).assertEqual(vp2px(2500/17)); - expect(End_AddOneMargin_013.right - End_AddOneMargin_013.left).assertEqual(vp2px(2500/17)); + expect(Math.round(End_AddOneMargin_011.bottom - End_AddOneMargin_011.top)).assertEqual(vp2px(50)); + expect(Math.round(End_AddOneMargin_012.bottom - End_AddOneMargin_012.top)).assertEqual(vp2px(100)); + expect(Math.round(End_AddOneMargin_013.bottom - End_AddOneMargin_013.top)).assertEqual(vp2px(150)); + expect(Math.round(End_AddOneMargin_011.right - End_AddOneMargin_011.left)).assertEqual(Math.round(vp2px(2500/17))); + expect(Math.round(End_AddOneMargin_012.right - End_AddOneMargin_012.left)).assertEqual(Math.round(vp2px(2500/17))); + expect(Math.round(End_AddOneMargin_013.right - End_AddOneMargin_013.left)).assertEqual(Math.round(vp2px(2500/17))); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1500] END'); done(); }) diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOneWidth.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOneWidth.test.ets index c4b847a4d7ffbeff001624020a86f63dfe78edd7..e0193f237a40523ed1153f6081fd9d373b066566 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOneWidth.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOneWidth.test.ets @@ -69,13 +69,13 @@ export default function AlignEnd_AddOneWidth() { expect(End_AddOneWidth_011.top).assertEqual(End_AddOneWidth_012.top); expect(End_AddOneWidth_013.top).assertEqual(End_AddOneWidth_012.top); expect(End_AddOneWidth_01.top).assertEqual(End_AddOneWidth_011.top); - expect(End_AddOneWidth_011.left - End_AddOneWidth_01.left).assertEqual(vp2px(40)); - expect(End_AddOneWidth_011.right - End_AddOneWidth_011.left).assertEqual(vp2px(160)); - expect(End_AddOneWidth_012.right - End_AddOneWidth_012.left).assertEqual(vp2px(150)); - expect(End_AddOneWidth_013.right - End_AddOneWidth_013.left).assertEqual(vp2px(150)); - expect(End_AddOneWidth_011.bottom - End_AddOneWidth_011.top).assertEqual(vp2px(50)); - expect(End_AddOneWidth_012.bottom - End_AddOneWidth_012.top).assertEqual(vp2px(100)); - expect(End_AddOneWidth_013.bottom - End_AddOneWidth_013.top).assertEqual(vp2px(150)); + expect(Math.round(End_AddOneWidth_011.left - End_AddOneWidth_01.left)).assertEqual(vp2px(40)); + expect(Math.round(End_AddOneWidth_011.right - End_AddOneWidth_011.left)).assertEqual(vp2px(160)); + expect(Math.round(End_AddOneWidth_012.right - End_AddOneWidth_012.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddOneWidth_013.right - End_AddOneWidth_013.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddOneWidth_011.bottom - End_AddOneWidth_011.top)).assertEqual(vp2px(50)); + expect(Math.round(End_AddOneWidth_012.bottom - End_AddOneWidth_012.top)).assertEqual(vp2px(100)); + expect(Math.round(End_AddOneWidth_013.bottom - End_AddOneWidth_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1300] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddPadding.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddPadding.test.ets index 98534846cdc1c8b38c8fc6e14d52afb6ffb7e534..e2a2de32ff7587dfbf3ad8a0ec7391fa17fe2d17 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddPadding.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddPadding.test.ets @@ -68,15 +68,15 @@ export default function AlignEnd_AddPadding() { expect(End_AddPadding_012.top).assertEqual(End_AddPadding_013.top); expect(End_AddPadding_012.left).assertEqual(End_AddPadding_011.right); expect(End_AddPadding_013.left).assertEqual(End_AddPadding_012.right); - expect(End_AddPadding_011.top - End_AddPadding_01.top).assertEqual(vp2px(30)); - expect(End_AddPadding_011.left - End_AddPadding_01.left).assertEqual(vp2px(30)); - expect(End_AddPadding_01.right - End_AddPadding_013.right).assertEqual(vp2px(30)); - expect(End_AddPadding_011.bottom - End_AddPadding_011.top).assertEqual(vp2px(50)); - expect(End_AddPadding_012.bottom - End_AddPadding_012.top).assertEqual(vp2px(100)); - expect(End_AddPadding_013.bottom - End_AddPadding_013.top).assertEqual(vp2px(150)); - expect(End_AddPadding_011.right - End_AddPadding_011.left).assertEqual(vp2px(440/3)); - expect(End_AddPadding_012.right - End_AddPadding_012.left).assertEqual(vp2px(440/3)); - expect(End_AddPadding_013.right - End_AddPadding_013.left).assertEqual(vp2px(440/3)); + expect(Math.round(End_AddPadding_011.top - End_AddPadding_01.top)).assertEqual(vp2px(30)); + expect(Math.round(End_AddPadding_011.left - End_AddPadding_01.left)).assertEqual(vp2px(30)); + expect(Math.round(End_AddPadding_01.right - End_AddPadding_013.right)).assertEqual(vp2px(30)); + expect(Math.round(End_AddPadding_011.bottom - End_AddPadding_011.top)).assertEqual(vp2px(50)); + expect(Math.round(End_AddPadding_012.bottom - End_AddPadding_012.top)).assertEqual(vp2px(100)); + expect(Math.round(End_AddPadding_013.bottom - End_AddPadding_013.top)).assertEqual(vp2px(150)); + expect(Math.round(End_AddPadding_011.right - End_AddPadding_011.left)).assertEqual(vp2px(440/3)); + expect(Math.round(End_AddPadding_012.right - End_AddPadding_012.left)).assertEqual(vp2px(440/3)); + expect(Math.round(End_AddPadding_013.right - End_AddPadding_013.left)).assertEqual(vp2px(440/3)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0300] END'); done(); }); @@ -103,15 +103,15 @@ export default function AlignEnd_AddPadding() { expect(End_AddPadding_012.top).assertEqual(End_AddPadding_013.top); expect(End_AddPadding_011.right).assertEqual(End_AddPadding_012.left); expect(End_AddPadding_012.right).assertEqual(End_AddPadding_013.left); - expect(End_AddPadding_011.top - End_AddPadding_01.top).assertEqual(vp2px(20)); - expect(End_AddPadding_011.left - End_AddPadding_01.left).assertEqual(vp2px(30)); - expect(End_AddPadding_01.right - End_AddPadding_013.right).assertEqual(vp2px(20)); - expect(End_AddPadding_011.right - End_AddPadding_011.left).assertEqual(vp2px(150)); - expect(End_AddPadding_012.right - End_AddPadding_012.left).assertEqual(vp2px(150)); - expect(End_AddPadding_013.right - End_AddPadding_013.left).assertEqual(vp2px(150)); - expect(End_AddPadding_011.bottom - End_AddPadding_011.top).assertEqual(vp2px(50)); - expect(End_AddPadding_012.bottom - End_AddPadding_012.top).assertEqual(vp2px(100)); - expect(End_AddPadding_013.bottom - End_AddPadding_013.top).assertEqual(vp2px(150)); + expect(Math.round(End_AddPadding_011.top - End_AddPadding_01.top)).assertEqual(vp2px(20)); + expect(Math.round(End_AddPadding_011.left - End_AddPadding_01.left)).assertEqual(vp2px(30)); + expect(Math.round(End_AddPadding_01.right - End_AddPadding_013.right)).assertEqual(vp2px(20)); + expect(Math.round(End_AddPadding_011.right - End_AddPadding_011.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddPadding_012.right - End_AddPadding_012.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddPadding_013.right - End_AddPadding_013.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddPadding_011.bottom - End_AddPadding_011.top)).assertEqual(vp2px(50)); + expect(Math.round(End_AddPadding_012.bottom - End_AddPadding_012.top)).assertEqual(vp2px(100)); + expect(Math.round(End_AddPadding_013.bottom - End_AddPadding_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0400] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddVisibility.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddVisibility.test.ets index e05388dfcaae8635d808089227c2943f5ced6807..aef1997fe8b2961c338269fede2c5a98f38da817 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddVisibility.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddVisibility.test.ets @@ -69,11 +69,11 @@ export default function AlignEnd_AddVisibility() { expect(End_AddVisibility_012.top).assertEqual(End_AddVisibility_01.top); expect(End_AddVisibility_012.right).assertEqual(End_AddVisibility_013.left); expect(End_AddVisibility_013.right).assertEqual(End_AddVisibility_01.right); - expect(End_AddVisibility_012.left - End_AddVisibility_01.left).assertEqual(vp2px(200)); - expect(End_AddVisibility_012.right - End_AddVisibility_012.left).assertEqual(vp2px(150)); - expect(End_AddVisibility_013.right - End_AddVisibility_013.left).assertEqual(vp2px(150)); - expect(End_AddVisibility_012.bottom - End_AddVisibility_012.top).assertEqual(vp2px(100)); - expect(End_AddVisibility_013.bottom - End_AddVisibility_013.top).assertEqual(vp2px(150)); + expect(Math.round(End_AddVisibility_012.left - End_AddVisibility_01.left)).assertEqual(vp2px(200)); + expect(Math.round(End_AddVisibility_012.right - End_AddVisibility_012.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddVisibility_013.right - End_AddVisibility_013.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddVisibility_012.bottom - End_AddVisibility_012.top)).assertEqual(vp2px(100)); + expect(Math.round(End_AddVisibility_013.bottom - End_AddVisibility_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1000] END'); done(); }); @@ -105,13 +105,13 @@ export default function AlignEnd_AddVisibility() { expect(End_AddVisibility_011.right).assertEqual(End_AddVisibility_012.left); expect(End_AddVisibility_013.right).assertEqual(End_AddVisibility_01.right); expect(End_AddVisibility_013.left).assertEqual(End_AddVisibility_012.right); - expect(End_AddVisibility_011.left - End_AddVisibility_01.left).assertEqual(vp2px(50)); - expect(End_AddVisibility_011.right - End_AddVisibility_011.left).assertEqual(vp2px(150)); - expect(End_AddVisibility_012.right - End_AddVisibility_012.left).assertEqual(vp2px(150)); - expect(End_AddVisibility_013.right - End_AddVisibility_013.left).assertEqual(vp2px(150)); - expect(End_AddVisibility_011.bottom - End_AddVisibility_011.top).assertEqual(vp2px(50)); - expect(End_AddVisibility_012.bottom - End_AddVisibility_012.top).assertEqual(vp2px(100)); - expect(End_AddVisibility_013.bottom - End_AddVisibility_013.top).assertEqual(vp2px(150)); + expect(Math.round(End_AddVisibility_011.left - End_AddVisibility_01.left)).assertEqual(vp2px(50)); + expect(Math.round(End_AddVisibility_011.right - End_AddVisibility_011.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddVisibility_012.right - End_AddVisibility_012.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddVisibility_013.right - End_AddVisibility_013.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddVisibility_011.bottom - End_AddVisibility_011.top)).assertEqual(vp2px(50)); + expect(Math.round(End_AddVisibility_012.bottom - End_AddVisibility_012.top)).assertEqual(vp2px(100)); + expect(Math.round(End_AddVisibility_013.bottom - End_AddVisibility_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1100] END'); done(); }); @@ -143,13 +143,13 @@ export default function AlignEnd_AddVisibility() { expect(End_AddVisibility_011.right).assertEqual(End_AddVisibility_012.left); expect(End_AddVisibility_013.right).assertEqual(End_AddVisibility_01.right); expect(End_AddVisibility_013.left).assertEqual(End_AddVisibility_012.right); - expect(End_AddVisibility_011.left - End_AddVisibility_01.left).assertEqual(vp2px(50)); - expect(End_AddVisibility_011.right - End_AddVisibility_011.left).assertEqual(vp2px(150)); - expect(End_AddVisibility_012.right - End_AddVisibility_012.left).assertEqual(vp2px(150)); - expect(End_AddVisibility_013.right - End_AddVisibility_013.left).assertEqual(vp2px(150)); - expect(End_AddVisibility_011.bottom - End_AddVisibility_011.top).assertEqual(vp2px(50)); - expect(End_AddVisibility_012.bottom - End_AddVisibility_012.top).assertEqual(vp2px(100)); - expect(End_AddVisibility_013.bottom - End_AddVisibility_013.top).assertEqual(vp2px(150)); + expect(Math.round(End_AddVisibility_011.left - End_AddVisibility_01.left)).assertEqual(vp2px(50)); + expect(Math.round(End_AddVisibility_011.right - End_AddVisibility_011.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddVisibility_012.right - End_AddVisibility_012.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddVisibility_013.right - End_AddVisibility_013.left)).assertEqual(vp2px(150)); + expect(Math.round(End_AddVisibility_011.bottom - End_AddVisibility_011.top)).assertEqual(vp2px(50)); + expect(Math.round(End_AddVisibility_012.bottom - End_AddVisibility_012.top)).assertEqual(vp2px(100)); + expect(Math.round(End_AddVisibility_013.bottom - End_AddVisibility_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1700] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_NoSpace.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_NoSpace.test.ets index 97fef7143938fd82ef51972356b3e002781a987b..84745dbbc832e77d0af3262c040cd0db3f0020dd 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_NoSpace.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_NoSpace.test.ets @@ -71,12 +71,12 @@ export default function AlignEnd_NoSpace() { expect(End_NoSpace_012.left).assertEqual(End_NoSpace_011.right); expect(End_NoSpace_013.left).assertEqual(End_NoSpace_012.right); expect(End_NoSpace_013.right).assertEqual(End_NoSpace_01.right); - expect(End_NoSpace_011.bottom - End_NoSpace_011.top).assertEqual(vp2px(50)); - expect(End_NoSpace_012.bottom - End_NoSpace_012.top).assertEqual(vp2px(100)); - expect(End_NoSpace_013.bottom - End_NoSpace_013.top).assertEqual(vp2px(150)); - expect(End_NoSpace_011.right - End_NoSpace_011.left).assertEqual(vp2px(400/3)); - expect(End_NoSpace_012.right - End_NoSpace_012.left).assertEqual(vp2px(400/3)); - expect(End_NoSpace_013.right - End_NoSpace_013.left).assertEqual(vp2px(400/3)); + expect(Math.round(End_NoSpace_011.bottom - End_NoSpace_011.top)).assertEqual(vp2px(50)); + expect(Math.round(End_NoSpace_012.bottom - End_NoSpace_012.top)).assertEqual(vp2px(100)); + expect(Math.round(End_NoSpace_013.bottom - End_NoSpace_013.top)).assertEqual(vp2px(150)); + expect(Math.round(End_NoSpace_011.right - End_NoSpace_011.left)).assertEqual(Math.round(vp2px(400/3))); + expect(Math.round(End_NoSpace_012.right - End_NoSpace_012.left)).assertEqual(Math.round(vp2px(400/3))); + expect(Math.round(End_NoSpace_013.right - End_NoSpace_013.left)).assertEqual(Math.round(vp2px(400/3))); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0100] END'); done(); }); @@ -105,13 +105,13 @@ export default function AlignEnd_NoSpace() { expect(End_NoSpace_012.left).assertEqual(End_NoSpace_011.right); expect(End_NoSpace_013.left).assertEqual(End_NoSpace_012.right); expect(End_NoSpace_013.right).assertEqual(End_NoSpace_01.right); - expect(End_NoSpace_011.left - End_NoSpace_01.left).assertEqual(vp2px(50)); - expect(End_NoSpace_011.bottom - End_NoSpace_011.top).assertEqual(vp2px(50)); - expect(End_NoSpace_012.bottom - End_NoSpace_012.top).assertEqual(vp2px(100)); - expect(End_NoSpace_013.bottom - End_NoSpace_013.top).assertEqual(vp2px(150)); - expect(End_NoSpace_011.right - End_NoSpace_011.left).assertEqual(vp2px(150)); - expect(End_NoSpace_012.right - End_NoSpace_012.left).assertEqual(vp2px(150)); - expect(End_NoSpace_013.right - End_NoSpace_013.left).assertEqual(vp2px(150)); + expect(Math.round(End_NoSpace_011.left - End_NoSpace_01.left)).assertEqual(vp2px(50)); + expect(Math.round(End_NoSpace_011.bottom - End_NoSpace_011.top)).assertEqual(vp2px(50)); + expect(Math.round(End_NoSpace_012.bottom - End_NoSpace_012.top)).assertEqual(vp2px(100)); + expect(Math.round(End_NoSpace_013.bottom - End_NoSpace_013.top)).assertEqual(vp2px(150)); + expect(Math.round(End_NoSpace_011.right - End_NoSpace_011.left)).assertEqual(vp2px(150)); + expect(Math.round(End_NoSpace_012.right - End_NoSpace_012.left)).assertEqual(vp2px(150)); + expect(Math.round(End_NoSpace_013.right - End_NoSpace_013.left)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0200] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddAlign.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddAlign.test.ets index a347785f4175f05b9dc7f53a71ec9cee24f12d64..1f70f88c90b3f31211e91d030cff9587ed9638f0 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddAlign.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddAlign.test.ets @@ -66,18 +66,20 @@ export default function AlignSpaceEvenly_AddAlign() { expect(SpaceEvenly_AddAlign_011.top).assertEqual(SpaceEvenly_AddAlign_012.top); expect(SpaceEvenly_AddAlign_012.top).assertEqual(SpaceEvenly_AddAlign_013.top); expect(SpaceEvenly_AddAlign_011.top).assertEqual(SpaceEvenly_AddAlign_01.top); - expect(SpaceEvenly_AddAlign_012.left - SpaceEvenly_AddAlign_011.right) - .assertEqual(SpaceEvenly_AddAlign_013.left - SpaceEvenly_AddAlign_012.right); - expect(SpaceEvenly_AddAlign_011.left - SpaceEvenly_AddAlign_01.left) - .assertEqual(SpaceEvenly_AddAlign_01.right - SpaceEvenly_AddAlign_013.right); - expect(SpaceEvenly_AddAlign_012.left - SpaceEvenly_AddAlign_011.right).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_AddAlign_01.right - SpaceEvenly_AddAlign_013.right).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_AddAlign_011.right - SpaceEvenly_AddAlign_011.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddAlign_012.right - SpaceEvenly_AddAlign_012.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddAlign_013.right - SpaceEvenly_AddAlign_013.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddAlign_011.bottom - SpaceEvenly_AddAlign_011.top).assertEqual(vp2px(50)); - expect(SpaceEvenly_AddAlign_012.bottom - SpaceEvenly_AddAlign_012.top).assertEqual(vp2px(100)); - expect(SpaceEvenly_AddAlign_013.bottom - SpaceEvenly_AddAlign_013.top).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddAlign_012.left - SpaceEvenly_AddAlign_011.right)) + .assertEqual(Math.round(SpaceEvenly_AddAlign_013.left - SpaceEvenly_AddAlign_012.right)); + expect(Math.round(SpaceEvenly_AddAlign_011.left - SpaceEvenly_AddAlign_01.left)) + .assertEqual(Math.round(SpaceEvenly_AddAlign_01.right - SpaceEvenly_AddAlign_013.right)); + expect(Math.round((SpaceEvenly_AddAlign_012.left - SpaceEvenly_AddAlign_011.right)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round((SpaceEvenly_AddAlign_01.right - SpaceEvenly_AddAlign_013.right)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round(SpaceEvenly_AddAlign_011.right - SpaceEvenly_AddAlign_011.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddAlign_012.right - SpaceEvenly_AddAlign_012.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddAlign_013.right - SpaceEvenly_AddAlign_013.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddAlign_011.bottom - SpaceEvenly_AddAlign_011.top)).assertEqual(vp2px(50)); + expect(Math.round(SpaceEvenly_AddAlign_012.bottom - SpaceEvenly_AddAlign_012.top)).assertEqual(vp2px(100)); + expect(Math.round(SpaceEvenly_AddAlign_013.bottom - SpaceEvenly_AddAlign_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_0800] END'); done() }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddAllSpace.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddAllSpace.test.ets index 34b01cde85fde9b90a7cca2b2f33a0c22983b818..839aae505f3fa2b541dff17f42e5cb79d4e5c393 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddAllSpace.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddAllSpace.test.ets @@ -67,19 +67,19 @@ export default function AlignSpaceEvenly_AddAllSpace() { let SpaceEvenly_AddAllSpace_01_Box = CommonFunc.getComponentRect('SpaceEvenly_AddAllSpace_01_Box'); expect(SpaceEvenly_AddAllSpace_011.top).assertEqual(SpaceEvenly_AddAllSpace_012.top); expect(SpaceEvenly_AddAllSpace_012.top).assertEqual(SpaceEvenly_AddAllSpace_013.top); - expect(SpaceEvenly_AddAllSpace_011.top - SpaceEvenly_AddAllSpace_01.top).assertEqual(vp2px(30)); - expect(SpaceEvenly_AddAllSpace_01.right - SpaceEvenly_AddAllSpace_013.right).assertEqual(vp2px(30)); - expect(SpaceEvenly_AddAllSpace_011.left - SpaceEvenly_AddAllSpace_01.left).assertEqual(vp2px(30)); + expect(Math.round(SpaceEvenly_AddAllSpace_011.top - SpaceEvenly_AddAllSpace_01.top)).assertEqual(vp2px(30)); + expect(Math.round(SpaceEvenly_AddAllSpace_01.right - SpaceEvenly_AddAllSpace_013.right)).assertEqual(vp2px(30)); + expect(Math.round(SpaceEvenly_AddAllSpace_011.left - SpaceEvenly_AddAllSpace_01.left)).assertEqual(vp2px(30)); expect(SpaceEvenly_AddAllSpace_012.left).assertEqual(SpaceEvenly_AddAllSpace_011.right); expect(SpaceEvenly_AddAllSpace_013.left).assertEqual(SpaceEvenly_AddAllSpace_012.right); - expect(SpaceEvenly_AddAllSpace_01.left - SpaceEvenly_AddAllSpace_01_Box.left ).assertEqual(vp2px(10)); - expect(SpaceEvenly_AddAllSpace_01.top - SpaceEvenly_AddAllSpace_01_Box.top).assertEqual(vp2px(10)); - expect(SpaceEvenly_AddAllSpace_011.bottom - SpaceEvenly_AddAllSpace_011.top).assertEqual(vp2px(50)); - expect(SpaceEvenly_AddAllSpace_012.bottom - SpaceEvenly_AddAllSpace_012.top).assertEqual(vp2px(100)); - expect(SpaceEvenly_AddAllSpace_013.bottom - SpaceEvenly_AddAllSpace_013.top).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddAllSpace_011.right - SpaceEvenly_AddAllSpace_011.left).assertEqual(vp2px(440/3)); - expect(SpaceEvenly_AddAllSpace_012.right - SpaceEvenly_AddAllSpace_012.left).assertEqual(vp2px(440/3)); - expect(SpaceEvenly_AddAllSpace_013.right - SpaceEvenly_AddAllSpace_013.left).assertEqual(vp2px(440/3)); + expect(Math.round(SpaceEvenly_AddAllSpace_01.left - SpaceEvenly_AddAllSpace_01_Box.left)).assertEqual(vp2px(10)); + expect(Math.round(SpaceEvenly_AddAllSpace_01.top - SpaceEvenly_AddAllSpace_01_Box.top)).assertEqual(vp2px(10)); + expect(Math.round(SpaceEvenly_AddAllSpace_011.bottom - SpaceEvenly_AddAllSpace_011.top)).assertEqual(vp2px(50)); + expect(Math.round(SpaceEvenly_AddAllSpace_012.bottom - SpaceEvenly_AddAllSpace_012.top)).assertEqual(vp2px(100)); + expect(Math.round(SpaceEvenly_AddAllSpace_013.bottom - SpaceEvenly_AddAllSpace_013.top)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddAllSpace_011.right - SpaceEvenly_AddAllSpace_011.left)).assertEqual(vp2px(440/3)); + expect(Math.round(SpaceEvenly_AddAllSpace_012.right - SpaceEvenly_AddAllSpace_012.left)).assertEqual(vp2px(440/3)); + expect(Math.round(SpaceEvenly_AddAllSpace_013.right - SpaceEvenly_AddAllSpace_013.left)).assertEqual(vp2px(440/3)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_0600] END'); done(); }); @@ -105,20 +105,23 @@ export default function AlignSpaceEvenly_AddAllSpace() { let SpaceEvenly_AddAllSpace_01_Box = CommonFunc.getComponentRect('SpaceEvenly_AddAllSpace_01_Box'); expect(SpaceEvenly_AddAllSpace_011.top).assertEqual(SpaceEvenly_AddAllSpace_012.top); expect(SpaceEvenly_AddAllSpace_012.top).assertEqual(SpaceEvenly_AddAllSpace_013.top); - expect(SpaceEvenly_AddAllSpace_011.top - SpaceEvenly_AddAllSpace_01.top).assertEqual(vp2px(20)); - expect(SpaceEvenly_AddAllSpace_01.right - SpaceEvenly_AddAllSpace_013.right).assertEqual(vp2px(22.5)); - expect(SpaceEvenly_AddAllSpace_011.left - SpaceEvenly_AddAllSpace_01.left).assertEqual(vp2px(22.5)); - expect(SpaceEvenly_AddAllSpace_01.left - SpaceEvenly_AddAllSpace_01_Box.left).assertEqual(vp2px(10)); - expect(SpaceEvenly_AddAllSpace_01.top - SpaceEvenly_AddAllSpace_01_Box.top).assertEqual(vp2px(10)); - expect(SpaceEvenly_AddAllSpace_011.right - SpaceEvenly_AddAllSpace_011.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddAllSpace_012.right - SpaceEvenly_AddAllSpace_012.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddAllSpace_013.right - SpaceEvenly_AddAllSpace_013.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddAllSpace_011.bottom - SpaceEvenly_AddAllSpace_011.top).assertEqual(vp2px(50)); - expect(SpaceEvenly_AddAllSpace_012.bottom - SpaceEvenly_AddAllSpace_012.top).assertEqual(vp2px(100)); - expect(SpaceEvenly_AddAllSpace_013.bottom - SpaceEvenly_AddAllSpace_013.top).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddAllSpace_012.left - SpaceEvenly_AddAllSpace_011.right) - .assertEqual(SpaceEvenly_AddAllSpace_013.left - SpaceEvenly_AddAllSpace_012.right); - expect(SpaceEvenly_AddAllSpace_012.left - SpaceEvenly_AddAllSpace_011.right).assertEqual(vp2px(2.5)); + expect(Math.round(SpaceEvenly_AddAllSpace_011.top - SpaceEvenly_AddAllSpace_01.top)).assertEqual(vp2px(20)); + expect(Math.round((SpaceEvenly_AddAllSpace_01.right - SpaceEvenly_AddAllSpace_013.right)*100)/100) + .assertEqual(Math.round(vp2px(22.5)*100)/100); + expect(Math.round((SpaceEvenly_AddAllSpace_011.left - SpaceEvenly_AddAllSpace_01.left)*100)/100) + .assertEqual(Math.round(vp2px(22.5)*100)/100); + expect(Math.round(SpaceEvenly_AddAllSpace_01.left - SpaceEvenly_AddAllSpace_01_Box.left)).assertEqual(vp2px(10)); + expect(Math.round(SpaceEvenly_AddAllSpace_01.top - SpaceEvenly_AddAllSpace_01_Box.top)).assertEqual(vp2px(10)); + expect(Math.round(SpaceEvenly_AddAllSpace_011.right - SpaceEvenly_AddAllSpace_011.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddAllSpace_012.right - SpaceEvenly_AddAllSpace_012.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddAllSpace_013.right - SpaceEvenly_AddAllSpace_013.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddAllSpace_011.bottom - SpaceEvenly_AddAllSpace_011.top)).assertEqual(vp2px(50)); + expect(Math.round(SpaceEvenly_AddAllSpace_012.bottom - SpaceEvenly_AddAllSpace_012.top)).assertEqual(vp2px(100)); + expect(Math.round(SpaceEvenly_AddAllSpace_013.bottom - SpaceEvenly_AddAllSpace_013.top)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddAllSpace_012.left - SpaceEvenly_AddAllSpace_011.right)) + .assertEqual(Math.round(SpaceEvenly_AddAllSpace_013.left - SpaceEvenly_AddAllSpace_012.right)); + expect(Math.round((SpaceEvenly_AddAllSpace_012.left - SpaceEvenly_AddAllSpace_011.right)*100)/100) + .assertEqual(Math.round(vp2px(2.5)*100)/100); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_0700] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddLayoutWeight.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddLayoutWeight.test.ets index a3db54ab623eb79a3ec4d5a76e0d425140bd76c4..daffab809ac0d43f2fc9fd90eea4b8382dc1657c 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddLayoutWeight.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddLayoutWeight.test.ets @@ -72,12 +72,18 @@ export default function AlignSpaceEvenly_AddLayoutWeight() { expect(SpaceEvenly_AddLayoutWeight_012.right).assertEqual(SpaceEvenly_AddLayoutWeight_013.left); expect(SpaceEvenly_AddLayoutWeight_011.left).assertEqual(SpaceEvenly_AddLayoutWeight_01.left); expect(SpaceEvenly_AddLayoutWeight_013.right).assertEqual(SpaceEvenly_AddLayoutWeight_01.right); - expect(SpaceEvenly_AddLayoutWeight_011.bottom - SpaceEvenly_AddLayoutWeight_011.top).assertEqual(vp2px(50)); - expect(SpaceEvenly_AddLayoutWeight_012.bottom - SpaceEvenly_AddLayoutWeight_012.top).assertEqual(vp2px(100)); - expect(SpaceEvenly_AddLayoutWeight_013.bottom - SpaceEvenly_AddLayoutWeight_013.top).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddLayoutWeight_011.right - SpaceEvenly_AddLayoutWeight_011.left).assertEqual(vp2px(100)); - expect(SpaceEvenly_AddLayoutWeight_012.right - SpaceEvenly_AddLayoutWeight_012.left).assertEqual(vp2px(200)); - expect(SpaceEvenly_AddLayoutWeight_013.right - SpaceEvenly_AddLayoutWeight_013.left).assertEqual(vp2px(200)); + expect(Math.round(SpaceEvenly_AddLayoutWeight_011.bottom - SpaceEvenly_AddLayoutWeight_011.top)) + .assertEqual(vp2px(50)); + expect(Math.round(SpaceEvenly_AddLayoutWeight_012.bottom - SpaceEvenly_AddLayoutWeight_012.top)) + .assertEqual(vp2px(100)); + expect(Math.round(SpaceEvenly_AddLayoutWeight_013.bottom - SpaceEvenly_AddLayoutWeight_013.top)) + .assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddLayoutWeight_011.right - SpaceEvenly_AddLayoutWeight_011.left)) + .assertEqual(vp2px(100)); + expect(Math.round(SpaceEvenly_AddLayoutWeight_012.right - SpaceEvenly_AddLayoutWeight_012.left)) + .assertEqual(vp2px(200)); + expect(Math.round(SpaceEvenly_AddLayoutWeight_013.right - SpaceEvenly_AddLayoutWeight_013.left)) + .assertEqual(vp2px(200)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1200] END'); done(); }); @@ -108,14 +114,18 @@ export default function AlignSpaceEvenly_AddLayoutWeight() { expect(SpaceEvenly_AddLayoutWeight_012.right).assertEqual(SpaceEvenly_AddLayoutWeight_013.left); expect(SpaceEvenly_AddLayoutWeight_011.left).assertEqual(SpaceEvenly_AddLayoutWeight_01.left); expect(SpaceEvenly_AddLayoutWeight_013.right).assertEqual(SpaceEvenly_AddLayoutWeight_01.right); - expect(SpaceEvenly_AddLayoutWeight_011.bottom - SpaceEvenly_AddLayoutWeight_011.top).assertEqual(vp2px(50)); - expect(SpaceEvenly_AddLayoutWeight_012.bottom - SpaceEvenly_AddLayoutWeight_012.top).assertEqual(vp2px(100)); - expect(SpaceEvenly_AddLayoutWeight_013.bottom - SpaceEvenly_AddLayoutWeight_013.top).assertEqual(vp2px(150)); - let oneWidth = SpaceEvenly_AddLayoutWeight_011.right - SpaceEvenly_AddLayoutWeight_011.left; - let twoWidth = SpaceEvenly_AddLayoutWeight_012.right - SpaceEvenly_AddLayoutWeight_012.left; + expect(Math.round(SpaceEvenly_AddLayoutWeight_011.bottom - SpaceEvenly_AddLayoutWeight_011.top)) + .assertEqual(vp2px(50)); + expect(Math.round(SpaceEvenly_AddLayoutWeight_012.bottom - SpaceEvenly_AddLayoutWeight_012.top)) + .assertEqual(vp2px(100)); + expect(Math.round(SpaceEvenly_AddLayoutWeight_013.bottom - SpaceEvenly_AddLayoutWeight_013.top)) + .assertEqual(vp2px(150)); + let oneWidth = Math.round(SpaceEvenly_AddLayoutWeight_011.right - SpaceEvenly_AddLayoutWeight_011.left); + let twoWidth = Math.round(SpaceEvenly_AddLayoutWeight_012.right - SpaceEvenly_AddLayoutWeight_012.left); expect(twoWidth / oneWidth).assertEqual(2); expect(twoWidth + oneWidth).assertEqual(vp2px(350)); - expect(SpaceEvenly_AddLayoutWeight_013.right - SpaceEvenly_AddLayoutWeight_013.left).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddLayoutWeight_013.right - SpaceEvenly_AddLayoutWeight_013.left)). + assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1300] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddMargin.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddMargin.test.ets index 99c26ee66358f80acb155aaa281b8be2c64ff589..6d87f1288e29bf346f3489a29a43da5ffbd919d2 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddMargin.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddMargin.test.ets @@ -68,17 +68,20 @@ export default function AlignSpaceEvenly_AddMargin() { expect(SpaceEvenly_AddMargin_011.top).assertEqual(SpaceEvenly_AddMargin_012.top); expect(SpaceEvenly_AddMargin_013.top).assertEqual(SpaceEvenly_AddMargin_012.top); expect(SpaceEvenly_AddMargin_011.top).assertEqual(SpaceEvenly_AddMargin_01.top); - expect(SpaceEvenly_AddMargin_011.left - SpaceEvenly_AddMargin_01.left).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_AddMargin_012.left - SpaceEvenly_AddMargin_011.right).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_AddMargin_013.left - SpaceEvenly_AddMargin_012.right).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_AddMargin_01.left - SpaceEvenly_AddMargin_01_Box.left).assertEqual(vp2px(20)); - expect(SpaceEvenly_AddMargin_01.top - SpaceEvenly_AddMargin_01_Box.top).assertEqual(vp2px(20)); - expect(SpaceEvenly_AddMargin_011.right - SpaceEvenly_AddMargin_011.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddMargin_012.right - SpaceEvenly_AddMargin_012.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddMargin_013.right - SpaceEvenly_AddMargin_013.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddMargin_011.bottom - SpaceEvenly_AddMargin_011.top).assertEqual(vp2px(50)); - expect(SpaceEvenly_AddMargin_012.bottom - SpaceEvenly_AddMargin_012.top).assertEqual(vp2px(100)); - expect(SpaceEvenly_AddMargin_013.bottom - SpaceEvenly_AddMargin_013.top).assertEqual(vp2px(150)); + expect(Math.round((SpaceEvenly_AddMargin_011.left - SpaceEvenly_AddMargin_01.left)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round((SpaceEvenly_AddMargin_012.left - SpaceEvenly_AddMargin_011.right)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round((SpaceEvenly_AddMargin_013.left - SpaceEvenly_AddMargin_012.right)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round(SpaceEvenly_AddMargin_01.left - SpaceEvenly_AddMargin_01_Box.left)).assertEqual(vp2px(20)); + expect(Math.round(SpaceEvenly_AddMargin_01.top - SpaceEvenly_AddMargin_01_Box.top)).assertEqual(vp2px(20)); + expect(Math.round(SpaceEvenly_AddMargin_011.right - SpaceEvenly_AddMargin_011.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddMargin_012.right - SpaceEvenly_AddMargin_012.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddMargin_013.right - SpaceEvenly_AddMargin_013.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddMargin_011.bottom - SpaceEvenly_AddMargin_011.top)).assertEqual(vp2px(50)); + expect(Math.round(SpaceEvenly_AddMargin_012.bottom - SpaceEvenly_AddMargin_012.top)).assertEqual(vp2px(100)); + expect(Math.round(SpaceEvenly_AddMargin_013.bottom - SpaceEvenly_AddMargin_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_0500] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddOffset.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddOffset.test.ets index b7c27fca703b3d7571147d84e99066aba67919d1..ed409e06a3293088a4b1884a361eb06f6dffe299 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddOffset.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddOffset.test.ets @@ -63,21 +63,25 @@ export default function AlignSpaceEvenly_AddOffset() { let SpaceEvenly_AddOffset_012 = CommonFunc.getComponentRect('SpaceEvenly_AddOffset_012'); let SpaceEvenly_AddOffset_013 = CommonFunc.getComponentRect('SpaceEvenly_AddOffset_013'); let SpaceEvenly_AddOffset_01 = CommonFunc.getComponentRect('SpaceEvenly_AddOffset_01'); - expect(SpaceEvenly_AddOffset_011.top - SpaceEvenly_AddOffset_01.top).assertEqual(vp2px(15)); - expect(SpaceEvenly_AddOffset_011.left - SpaceEvenly_AddOffset_01.left).assertEqual(vp2px(22.5)); + expect(Math.round((SpaceEvenly_AddOffset_011.top - SpaceEvenly_AddOffset_01.top)*10)/10).assertEqual(vp2px(15)); + expect(Math.round((SpaceEvenly_AddOffset_011.left - SpaceEvenly_AddOffset_01.left)*100)/100) + .assertEqual(Math.round(vp2px(22.5)*100)/100); expect(SpaceEvenly_AddOffset_012.top).assertEqual(SpaceEvenly_AddOffset_013.top); expect(SpaceEvenly_AddOffset_012.top).assertEqual(SpaceEvenly_AddOffset_01.top); - expect(SpaceEvenly_AddOffset_01.right - SpaceEvenly_AddOffset_013.right).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_AddOffset_012.left - SpaceEvenly_AddOffset_011.right).assertEqual(vp2px(2.5)); - expect(SpaceEvenly_AddOffset_013.left - SpaceEvenly_AddOffset_012.right ).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_AddOffset_011.right - SpaceEvenly_AddOffset_011.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddOffset_012.right - SpaceEvenly_AddOffset_012.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddOffset_013.right - SpaceEvenly_AddOffset_013.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddOffset_011.bottom - SpaceEvenly_AddOffset_011.top).assertEqual(vp2px(50)); - expect(SpaceEvenly_AddOffset_012.bottom - SpaceEvenly_AddOffset_012.top).assertEqual(vp2px(100)); - expect(SpaceEvenly_AddOffset_013.bottom - SpaceEvenly_AddOffset_013.top).assertEqual(vp2px(150)); + expect(Math.round((SpaceEvenly_AddOffset_01.right - SpaceEvenly_AddOffset_013.right)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round((SpaceEvenly_AddOffset_012.left - SpaceEvenly_AddOffset_011.right)*100)/100) + .assertEqual(Math.round(vp2px(2.5)*100)/100); + expect(Math.round((SpaceEvenly_AddOffset_013.left - SpaceEvenly_AddOffset_012.right)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round(SpaceEvenly_AddOffset_011.right - SpaceEvenly_AddOffset_011.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddOffset_012.right - SpaceEvenly_AddOffset_012.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddOffset_013.right - SpaceEvenly_AddOffset_013.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddOffset_011.bottom - SpaceEvenly_AddOffset_011.top)).assertEqual(vp2px(50)); + expect(Math.round(SpaceEvenly_AddOffset_012.bottom - SpaceEvenly_AddOffset_012.top)).assertEqual(vp2px(100)); + expect(Math.round(SpaceEvenly_AddOffset_013.bottom - SpaceEvenly_AddOffset_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_0900] END'); done(); }); }) -} +} \ No newline at end of file diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddOneMargin.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddOneMargin.test.ets index 8ce9b9843531028d2d56e1d20adb7d5dd4fdbf5b..296ee6974bd94bbfcca771a6dcf0493226a00c2a 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddOneMargin.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddOneMargin.test.ets @@ -64,20 +64,23 @@ export default function AlignSpaceEvenly_AddOneMargin() { let SpaceEvenly_AddOneMargin_012 = CommonFunc.getComponentRect('SpaceEvenly_AddOneMargin_012'); let SpaceEvenly_AddOneMargin_013 = CommonFunc.getComponentRect('SpaceEvenly_AddOneMargin_013'); let SpaceEvenly_AddOneMargin_01 = CommonFunc.getComponentRect('SpaceEvenly_AddOneMargin_01'); - expect(SpaceEvenly_AddOneMargin_011.top - SpaceEvenly_AddOneMargin_01.top).assertEqual(vp2px(20)); - expect(SpaceEvenly_AddOneMargin_011.left - SpaceEvenly_AddOneMargin_01.left).assertEqual(vp2px(22.5)); - expect(SpaceEvenly_AddOneMargin_013.left - SpaceEvenly_AddOneMargin_012.right).assertEqual(vp2px(2.5)); - expect(SpaceEvenly_AddOneMargin_012.left - SpaceEvenly_AddOneMargin_011.right - vp2px(20)) - .assertEqual(SpaceEvenly_AddOneMargin_013.left - SpaceEvenly_AddOneMargin_012.right); + expect(Math.round(SpaceEvenly_AddOneMargin_011.top - SpaceEvenly_AddOneMargin_01.top)).assertEqual(vp2px(20)); + expect(Math.round((SpaceEvenly_AddOneMargin_011.left - SpaceEvenly_AddOneMargin_01.left)*100)/100) + .assertEqual(Math.round(vp2px(22.5)*100)/100); + expect(Math.round((SpaceEvenly_AddOneMargin_013.left - SpaceEvenly_AddOneMargin_012.right)*100)/100) + .assertEqual(Math.round(vp2px(2.5)*100)/100); + expect(Math.round(SpaceEvenly_AddOneMargin_012.left - SpaceEvenly_AddOneMargin_011.right - vp2px(20))) + .assertEqual(Math.round(SpaceEvenly_AddOneMargin_013.left - SpaceEvenly_AddOneMargin_012.right)); expect(SpaceEvenly_AddOneMargin_013.top).assertEqual(SpaceEvenly_AddOneMargin_012.top); expect(SpaceEvenly_AddOneMargin_012.top).assertEqual(SpaceEvenly_AddOneMargin_01.top); - expect(SpaceEvenly_AddOneMargin_01.right - SpaceEvenly_AddOneMargin_013.right).assertEqual(vp2px(2.5)); - expect(SpaceEvenly_AddOneMargin_011.bottom - SpaceEvenly_AddOneMargin_011.top).assertEqual(vp2px(50)); - expect(SpaceEvenly_AddOneMargin_012.bottom - SpaceEvenly_AddOneMargin_012.top).assertEqual(vp2px(100)); - expect(SpaceEvenly_AddOneMargin_013.bottom - SpaceEvenly_AddOneMargin_013.top).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddOneMargin_011.right - SpaceEvenly_AddOneMargin_011.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddOneMargin_012.right - SpaceEvenly_AddOneMargin_012.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddOneMargin_013.right - SpaceEvenly_AddOneMargin_013.left).assertEqual(vp2px(150)); + expect(Math.round((SpaceEvenly_AddOneMargin_01.right - SpaceEvenly_AddOneMargin_013.right)*100)/100) + .assertEqual(Math.round(vp2px(2.5)*100)/100); + expect(Math.round(SpaceEvenly_AddOneMargin_011.bottom - SpaceEvenly_AddOneMargin_011.top)).assertEqual(vp2px(50)); + expect(Math.round(SpaceEvenly_AddOneMargin_012.bottom - SpaceEvenly_AddOneMargin_012.top)).assertEqual(vp2px(100)); + expect(Math.round(SpaceEvenly_AddOneMargin_013.bottom - SpaceEvenly_AddOneMargin_013.top)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddOneMargin_011.right - SpaceEvenly_AddOneMargin_011.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddOneMargin_012.right - SpaceEvenly_AddOneMargin_012.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddOneMargin_013.right - SpaceEvenly_AddOneMargin_013.left)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1500] END'); done(); }) @@ -100,20 +103,24 @@ export default function AlignSpaceEvenly_AddOneMargin() { let SpaceEvenly_AddOneMargin_012 = CommonFunc.getComponentRect('SpaceEvenly_AddOneMargin_012'); let SpaceEvenly_AddOneMargin_013 = CommonFunc.getComponentRect('SpaceEvenly_AddOneMargin_013'); let SpaceEvenly_AddOneMargin_01 = CommonFunc.getComponentRect('SpaceEvenly_AddOneMargin_01'); - expect(SpaceEvenly_AddOneMargin_011.top - SpaceEvenly_AddOneMargin_01.top).assertEqual(vp2px(30)); - expect(SpaceEvenly_AddOneMargin_011.left - SpaceEvenly_AddOneMargin_01.left).assertEqual(vp2px(500/17)); - expect(SpaceEvenly_AddOneMargin_012.left - SpaceEvenly_AddOneMargin_011.right) - .assertEqual(SpaceEvenly_AddOneMargin_011.left - SpaceEvenly_AddOneMargin_01.left); + expect(Math.round(SpaceEvenly_AddOneMargin_011.top - SpaceEvenly_AddOneMargin_01.top)).assertEqual(vp2px(30)); + expect(Math.round(SpaceEvenly_AddOneMargin_011.left - SpaceEvenly_AddOneMargin_01.left)) + .assertEqual(Math.round(vp2px(500/17))); + expect(Math.round(SpaceEvenly_AddOneMargin_012.left - SpaceEvenly_AddOneMargin_011.right)) + .assertEqual(Math.round(SpaceEvenly_AddOneMargin_011.left - SpaceEvenly_AddOneMargin_01.left)); expect(SpaceEvenly_AddOneMargin_013.right).assertEqual(SpaceEvenly_AddOneMargin_01.right); expect(SpaceEvenly_AddOneMargin_013.top).assertEqual(SpaceEvenly_AddOneMargin_012.top); expect(SpaceEvenly_AddOneMargin_012.top).assertEqual(SpaceEvenly_AddOneMargin_01.top); expect(SpaceEvenly_AddOneMargin_012.right).assertEqual(SpaceEvenly_AddOneMargin_013.left); - expect(SpaceEvenly_AddOneMargin_011.bottom - SpaceEvenly_AddOneMargin_011.top).assertEqual(vp2px(50)); - expect(SpaceEvenly_AddOneMargin_012.bottom - SpaceEvenly_AddOneMargin_012.top).assertEqual(vp2px(100)); - expect(SpaceEvenly_AddOneMargin_013.bottom - SpaceEvenly_AddOneMargin_013.top).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddOneMargin_011.right - SpaceEvenly_AddOneMargin_011.left).assertEqual(vp2px(2500/17)); - expect(SpaceEvenly_AddOneMargin_012.right - SpaceEvenly_AddOneMargin_012.left).assertEqual(vp2px(2500/17)); - expect(SpaceEvenly_AddOneMargin_013.right - SpaceEvenly_AddOneMargin_013.left).assertEqual(vp2px(2500/17)); + expect(Math.round(SpaceEvenly_AddOneMargin_011.bottom - SpaceEvenly_AddOneMargin_011.top)).assertEqual(vp2px(50)); + expect(Math.round(SpaceEvenly_AddOneMargin_012.bottom - SpaceEvenly_AddOneMargin_012.top)).assertEqual(vp2px(100)); + expect(Math.round(SpaceEvenly_AddOneMargin_013.bottom - SpaceEvenly_AddOneMargin_013.top)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddOneMargin_011.right - SpaceEvenly_AddOneMargin_011.left)) + .assertEqual(Math.round(vp2px(2500/17))); + expect(Math.round(SpaceEvenly_AddOneMargin_012.right - SpaceEvenly_AddOneMargin_012.left)) + .assertEqual(Math.round(vp2px(2500/17))); + expect(Math.round(SpaceEvenly_AddOneMargin_013.right - SpaceEvenly_AddOneMargin_013.left)) + .assertEqual(Math.round(vp2px(2500/17))); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1600] END'); done(); }) diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddOneWidth.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddOneWidth.test.ets index 5daf85b6bb296b7be6bdbb37e3c04803075d1085..4d8d50d5a939f2a7d1d5302be972613695c0cf5a 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddOneWidth.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddOneWidth.test.ets @@ -65,18 +65,18 @@ export default function AlignSpaceEvenly_AddOneWidth() { let SpaceEvenly_AddOneWidth_01 = CommonFunc.getComponentRect('SpaceEvenly_AddOneWidth_01'); expect(SpaceEvenly_AddOneWidth_012.left - SpaceEvenly_AddOneWidth_011.right) .assertEqual(SpaceEvenly_AddOneWidth_013.left - SpaceEvenly_AddOneWidth_012.right); - expect(SpaceEvenly_AddOneWidth_012.left - SpaceEvenly_AddOneWidth_011.right).assertEqual(vp2px(10)); + expect(Math.round(SpaceEvenly_AddOneWidth_012.left - SpaceEvenly_AddOneWidth_011.right)).assertEqual(vp2px(10)); expect(SpaceEvenly_AddOneWidth_011.top).assertEqual(SpaceEvenly_AddOneWidth_012.top); expect(SpaceEvenly_AddOneWidth_013.top).assertEqual(SpaceEvenly_AddOneWidth_012.top); expect(SpaceEvenly_AddOneWidth_011.top).assertEqual(SpaceEvenly_AddOneWidth_01.top); - expect(SpaceEvenly_AddOneWidth_011.left - SpaceEvenly_AddOneWidth_01.left).assertEqual(vp2px(10)); - expect(SpaceEvenly_AddOneWidth_01.right - SpaceEvenly_AddOneWidth_013.right).assertEqual(vp2px(10)); - expect(SpaceEvenly_AddOneWidth_011.right - SpaceEvenly_AddOneWidth_011.left).assertEqual(vp2px(160)); - expect(SpaceEvenly_AddOneWidth_012.right - SpaceEvenly_AddOneWidth_012.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddOneWidth_013.right - SpaceEvenly_AddOneWidth_013.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddOneWidth_011.bottom - SpaceEvenly_AddOneWidth_011.top).assertEqual(vp2px(50)); - expect(SpaceEvenly_AddOneWidth_012.bottom - SpaceEvenly_AddOneWidth_012.top).assertEqual(vp2px(100)); - expect(SpaceEvenly_AddOneWidth_013.bottom - SpaceEvenly_AddOneWidth_013.top).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddOneWidth_011.left - SpaceEvenly_AddOneWidth_01.left)).assertEqual(vp2px(10)); + expect(Math.round(SpaceEvenly_AddOneWidth_01.right - SpaceEvenly_AddOneWidth_013.right)).assertEqual(vp2px(10)); + expect(Math.round(SpaceEvenly_AddOneWidth_011.right - SpaceEvenly_AddOneWidth_011.left)).assertEqual(vp2px(160)); + expect(Math.round(SpaceEvenly_AddOneWidth_012.right - SpaceEvenly_AddOneWidth_012.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddOneWidth_013.right - SpaceEvenly_AddOneWidth_013.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddOneWidth_011.bottom - SpaceEvenly_AddOneWidth_011.top)).assertEqual(vp2px(50)); + expect(Math.round(SpaceEvenly_AddOneWidth_012.bottom - SpaceEvenly_AddOneWidth_012.top)).assertEqual(vp2px(100)); + expect(Math.round(SpaceEvenly_AddOneWidth_013.bottom - SpaceEvenly_AddOneWidth_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1400] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddPadding.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddPadding.test.ets index 56b5676d31e05eae3a4102dd737e54d69e102f51..95b5be0e6bc224b348401b5f88f8f3e7a745095e 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddPadding.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddPadding.test.ets @@ -68,15 +68,19 @@ export default function AlignSpaceEvenly_AddPadding() { expect( SpaceEvenly_AddPadding_012.top ).assertEqual(SpaceEvenly_AddPadding_013.top); expect( SpaceEvenly_AddPadding_012.left ).assertEqual(SpaceEvenly_AddPadding_011.right); expect( SpaceEvenly_AddPadding_013.left ).assertEqual(SpaceEvenly_AddPadding_012.right); - expect(SpaceEvenly_AddPadding_011.top - SpaceEvenly_AddPadding_01.top).assertEqual(vp2px(30)); - expect(SpaceEvenly_AddPadding_011.bottom - SpaceEvenly_AddPadding_011.top).assertEqual(vp2px(50)); - expect(SpaceEvenly_AddPadding_012.bottom - SpaceEvenly_AddPadding_012.top).assertEqual(vp2px(100)); - expect(SpaceEvenly_AddPadding_013.bottom - SpaceEvenly_AddPadding_013.top).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddPadding_011.right - SpaceEvenly_AddPadding_011.left).assertEqual(vp2px(440/3)); - expect(SpaceEvenly_AddPadding_012.right - SpaceEvenly_AddPadding_012.left).assertEqual(vp2px(440/3)); - expect(SpaceEvenly_AddPadding_013.right - SpaceEvenly_AddPadding_013.left).assertEqual(vp2px(440/3)); - expect(SpaceEvenly_AddPadding_011.left - SpaceEvenly_AddPadding_01.left).assertEqual(vp2px(30)); - expect(SpaceEvenly_AddPadding_01.right - SpaceEvenly_AddPadding_013.right).assertEqual(vp2px(30)); + expect(Math.round(SpaceEvenly_AddPadding_011.top - SpaceEvenly_AddPadding_01.top)).assertEqual(vp2px(30)); + expect(Math.round(SpaceEvenly_AddPadding_011.bottom - SpaceEvenly_AddPadding_011.top)).assertEqual(vp2px(50)); + expect(Math.round(SpaceEvenly_AddPadding_012.bottom - SpaceEvenly_AddPadding_012.top)).assertEqual(vp2px(100)); + expect(Math.round(SpaceEvenly_AddPadding_013.bottom - SpaceEvenly_AddPadding_013.top)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddPadding_011.right - SpaceEvenly_AddPadding_011.left)) + .assertEqual(Math.round(vp2px(440/3))); + expect(Math.round(SpaceEvenly_AddPadding_012.right - SpaceEvenly_AddPadding_012.left)) + .assertEqual(Math.round(vp2px(440/3))); + expect(Math.round(SpaceEvenly_AddPadding_013.right - SpaceEvenly_AddPadding_013.left)) + .assertEqual(Math.round(vp2px(440/3))); + expect(Math.round(SpaceEvenly_AddPadding_011.left - SpaceEvenly_AddPadding_01.left)) + .assertEqual(vp2px(30)); + expect(Math.round(SpaceEvenly_AddPadding_01.right - SpaceEvenly_AddPadding_013.right)).assertEqual(vp2px(30)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_0300] END'); done(); }); @@ -101,17 +105,21 @@ export default function AlignSpaceEvenly_AddPadding() { let SpaceEvenly_AddPadding_01 = CommonFunc.getComponentRect('SpaceEvenly_AddPadding_01'); expect(SpaceEvenly_AddPadding_011.top).assertEqual(SpaceEvenly_AddPadding_012.top); expect(SpaceEvenly_AddPadding_012.top).assertEqual(SpaceEvenly_AddPadding_013.top); - expect(SpaceEvenly_AddPadding_011.top - SpaceEvenly_AddPadding_01.top).assertEqual(vp2px(20)); - expect(SpaceEvenly_AddPadding_011.right - SpaceEvenly_AddPadding_011.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddPadding_012.right - SpaceEvenly_AddPadding_012.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddPadding_013.right - SpaceEvenly_AddPadding_013.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddPadding_011.bottom - SpaceEvenly_AddPadding_011.top).assertEqual(vp2px(50)); - expect(SpaceEvenly_AddPadding_012.bottom - SpaceEvenly_AddPadding_012.top).assertEqual(vp2px(100)); - expect(SpaceEvenly_AddPadding_013.bottom - SpaceEvenly_AddPadding_013.top).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddPadding_013.left - SpaceEvenly_AddPadding_012.right).assertEqual(vp2px(2.5)); - expect(SpaceEvenly_AddPadding_012.left - SpaceEvenly_AddPadding_011.right).assertEqual(vp2px(2.5)); - expect(SpaceEvenly_AddPadding_011.left - SpaceEvenly_AddPadding_01.left).assertEqual(vp2px(22.5)); - expect(SpaceEvenly_AddPadding_01.right - SpaceEvenly_AddPadding_013.right).assertEqual(vp2px(22.5)); + expect(Math.round(SpaceEvenly_AddPadding_011.top - SpaceEvenly_AddPadding_01.top)).assertEqual(vp2px(20)); + expect(Math.round(SpaceEvenly_AddPadding_011.right - SpaceEvenly_AddPadding_011.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddPadding_012.right - SpaceEvenly_AddPadding_012.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddPadding_013.right - SpaceEvenly_AddPadding_013.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddPadding_011.bottom - SpaceEvenly_AddPadding_011.top)).assertEqual(vp2px(50)); + expect(Math.round(SpaceEvenly_AddPadding_012.bottom - SpaceEvenly_AddPadding_012.top)).assertEqual(vp2px(100)); + expect(Math.round(SpaceEvenly_AddPadding_013.bottom - SpaceEvenly_AddPadding_013.top)).assertEqual(vp2px(150)); + expect(Math.round((SpaceEvenly_AddPadding_013.left - SpaceEvenly_AddPadding_012.right)*100)/100) + .assertEqual(Math.round(vp2px(2.5)*100)/100); + expect(Math.round((SpaceEvenly_AddPadding_012.left - SpaceEvenly_AddPadding_011.right)*100)/100) + .assertEqual(Math.round(vp2px(2.5)*100)/100); + expect(Math.round((SpaceEvenly_AddPadding_011.left - SpaceEvenly_AddPadding_01.left)*100)/100) + .assertEqual(Math.round(vp2px(22.5)*100)/100); + expect(Math.round((SpaceEvenly_AddPadding_01.right - SpaceEvenly_AddPadding_013.right)*100)/100) + .assertEqual(Math.round(vp2px(22.5)*100)/100); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_0400] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddVisibility.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddVisibility.test.ets index f9343d67ef123af4f0b8eb21c603192772d5cdb3..f8747bd3488766c4c3c5f86c6eae8f587dc7da00 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddVisibility.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddVisibility.test.ets @@ -67,13 +67,20 @@ export default function AlignSpaceEvenly_AddVisibility() { let SpaceEvenly_AddVisibility_01 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_01'); expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_013.top); expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_01.top); - expect(SpaceEvenly_AddVisibility_012.left - SpaceEvenly_AddVisibility_01.left).assertEqual(vp2px(200/3)); - expect(SpaceEvenly_AddVisibility_01.right - SpaceEvenly_AddVisibility_013.right).assertEqual(vp2px(200/3)); - expect(SpaceEvenly_AddVisibility_013.left - SpaceEvenly_AddVisibility_012.right).assertEqual(vp2px(200/3)); - expect(SpaceEvenly_AddVisibility_012.right - SpaceEvenly_AddVisibility_012.left ).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddVisibility_013.right - SpaceEvenly_AddVisibility_013.left ).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddVisibility_012.bottom - SpaceEvenly_AddVisibility_012.top ).assertEqual(vp2px(100)); - expect(SpaceEvenly_AddVisibility_013.bottom - SpaceEvenly_AddVisibility_013.top ).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddVisibility_012.left - SpaceEvenly_AddVisibility_01.left)) + .assertEqual(Math.round(vp2px(200/3))); + expect(Math.round(SpaceEvenly_AddVisibility_01.right - SpaceEvenly_AddVisibility_013.right)) + .assertEqual(Math.round(vp2px(200/3))); + expect(Math.round(SpaceEvenly_AddVisibility_013.left - SpaceEvenly_AddVisibility_012.right)) + .assertEqual(Math.round(vp2px(200/3))); + expect(Math.round(SpaceEvenly_AddVisibility_012.right - SpaceEvenly_AddVisibility_012.left )) + .assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddVisibility_013.right - SpaceEvenly_AddVisibility_013.left)) + .assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddVisibility_012.bottom - SpaceEvenly_AddVisibility_012.top)) + .assertEqual(vp2px(100)); + expect(Math.round(SpaceEvenly_AddVisibility_013.bottom - SpaceEvenly_AddVisibility_013.top)) + .assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1000] END'); done(); }); @@ -102,16 +109,26 @@ export default function AlignSpaceEvenly_AddVisibility() { expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_013.top); expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_01.top); expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_011.top); - expect(SpaceEvenly_AddVisibility_011.left - SpaceEvenly_AddVisibility_01.left).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_AddVisibility_01.right - SpaceEvenly_AddVisibility_013.right).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_AddVisibility_012.left - SpaceEvenly_AddVisibility_011.right).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_AddVisibility_013.left - SpaceEvenly_AddVisibility_012.right).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_AddVisibility_011.right - SpaceEvenly_AddVisibility_011.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddVisibility_012.right - SpaceEvenly_AddVisibility_012.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddVisibility_013.right - SpaceEvenly_AddVisibility_013.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddVisibility_011.bottom - SpaceEvenly_AddVisibility_011.top ).assertEqual(vp2px(50)); - expect(SpaceEvenly_AddVisibility_012.bottom - SpaceEvenly_AddVisibility_012.top ).assertEqual(vp2px(100)); - expect(SpaceEvenly_AddVisibility_013.bottom - SpaceEvenly_AddVisibility_013.top ).assertEqual(vp2px(150)); + expect(Math.round((SpaceEvenly_AddVisibility_011.left - SpaceEvenly_AddVisibility_01.left)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round((SpaceEvenly_AddVisibility_01.right - SpaceEvenly_AddVisibility_013.right)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round((SpaceEvenly_AddVisibility_012.left - SpaceEvenly_AddVisibility_011.right)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round((SpaceEvenly_AddVisibility_013.left - SpaceEvenly_AddVisibility_012.right)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round(SpaceEvenly_AddVisibility_011.right - SpaceEvenly_AddVisibility_011.left)) + .assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddVisibility_012.right - SpaceEvenly_AddVisibility_012.left)) + .assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddVisibility_013.right - SpaceEvenly_AddVisibility_013.left)) + .assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddVisibility_011.bottom - SpaceEvenly_AddVisibility_011.top)) + .assertEqual(vp2px(50)); + expect(Math.round(SpaceEvenly_AddVisibility_012.bottom - SpaceEvenly_AddVisibility_012.top)) + .assertEqual(vp2px(100)); + expect(Math.round(SpaceEvenly_AddVisibility_013.bottom - SpaceEvenly_AddVisibility_013.top)) + .assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1100] END'); done(); }); @@ -140,16 +157,26 @@ export default function AlignSpaceEvenly_AddVisibility() { expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_013.top); expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_01.top); expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_011.top); - expect(SpaceEvenly_AddVisibility_011.left - SpaceEvenly_AddVisibility_01.left).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_AddVisibility_01.right - SpaceEvenly_AddVisibility_013.right).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_AddVisibility_012.left - SpaceEvenly_AddVisibility_011.right).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_AddVisibility_013.left - SpaceEvenly_AddVisibility_012.right).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_AddVisibility_011.right - SpaceEvenly_AddVisibility_011.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddVisibility_012.right - SpaceEvenly_AddVisibility_012.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddVisibility_013.right - SpaceEvenly_AddVisibility_013.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_AddVisibility_011.bottom - SpaceEvenly_AddVisibility_011.top ).assertEqual(vp2px(50)); - expect(SpaceEvenly_AddVisibility_012.bottom - SpaceEvenly_AddVisibility_012.top ).assertEqual(vp2px(100)); - expect(SpaceEvenly_AddVisibility_013.bottom - SpaceEvenly_AddVisibility_013.top ).assertEqual(vp2px(150)); + expect(Math.round((SpaceEvenly_AddVisibility_011.left - SpaceEvenly_AddVisibility_01.left)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round((SpaceEvenly_AddVisibility_01.right - SpaceEvenly_AddVisibility_013.right)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round((SpaceEvenly_AddVisibility_012.left - SpaceEvenly_AddVisibility_011.right)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round((SpaceEvenly_AddVisibility_013.left - SpaceEvenly_AddVisibility_012.right)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round(SpaceEvenly_AddVisibility_011.right - SpaceEvenly_AddVisibility_011.left)) + .assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddVisibility_012.right - SpaceEvenly_AddVisibility_012.left)) + .assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddVisibility_013.right - SpaceEvenly_AddVisibility_013.left)) + .assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_AddVisibility_011.bottom - SpaceEvenly_AddVisibility_011.top)) + .assertEqual(vp2px(50)); + expect(Math.round(SpaceEvenly_AddVisibility_012.bottom - SpaceEvenly_AddVisibility_012.top)) + .assertEqual(vp2px(100)); + expect(Math.round(SpaceEvenly_AddVisibility_013.bottom - SpaceEvenly_AddVisibility_013.top)) + .assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1700] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_NoSpace.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_NoSpace.test.ets index 0414ecd43a811b29ce55bf13806c1fa7a0bc3d30..2a0830576e79ec3af75ff7811b45af45ef7a64aa 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_NoSpace.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_NoSpace.test.ets @@ -71,12 +71,15 @@ export default function AlignSpaceEvenly_NoSpace() { expect(SpaceEvenly_NoSpace_01.right).assertEqual(SpaceEvenly_NoSpace_013.right); expect(SpaceEvenly_NoSpace_012.left).assertEqual(SpaceEvenly_NoSpace_011.right); expect(SpaceEvenly_NoSpace_013.left).assertEqual(SpaceEvenly_NoSpace_012.right); - expect(SpaceEvenly_NoSpace_011.right - SpaceEvenly_NoSpace_011.left).assertEqual(vp2px(400/3)); - expect(SpaceEvenly_NoSpace_012.right - SpaceEvenly_NoSpace_012.left).assertEqual(vp2px(400/3)); - expect(SpaceEvenly_NoSpace_013.right - SpaceEvenly_NoSpace_013.left).assertEqual(vp2px(400/3)); - expect(SpaceEvenly_NoSpace_011.bottom - SpaceEvenly_NoSpace_011.top).assertEqual(vp2px(50)); - expect(SpaceEvenly_NoSpace_012.bottom - SpaceEvenly_NoSpace_012.top).assertEqual(vp2px(100)); - expect(SpaceEvenly_NoSpace_013.bottom - SpaceEvenly_NoSpace_013.top).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_NoSpace_011.right - SpaceEvenly_NoSpace_011.left)) + .assertEqual(Math.round(vp2px(400/3))); + expect(Math.round(SpaceEvenly_NoSpace_012.right - SpaceEvenly_NoSpace_012.left)) + .assertEqual(Math.round(vp2px(400/3))); + expect(Math.round(SpaceEvenly_NoSpace_013.right - SpaceEvenly_NoSpace_013.left)) + .assertEqual(Math.round(vp2px(400/3))); + expect(Math.round(SpaceEvenly_NoSpace_011.bottom - SpaceEvenly_NoSpace_011.top)).assertEqual(vp2px(50)); + expect(Math.round(SpaceEvenly_NoSpace_012.bottom - SpaceEvenly_NoSpace_012.top)).assertEqual(vp2px(100)); + expect(Math.round(SpaceEvenly_NoSpace_013.bottom - SpaceEvenly_NoSpace_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_0100] END'); done(); }); @@ -102,16 +105,20 @@ export default function AlignSpaceEvenly_NoSpace() { expect(SpaceEvenly_NoSpace_011.top).assertEqual(SpaceEvenly_NoSpace_012.top); expect(SpaceEvenly_NoSpace_012.top).assertEqual(SpaceEvenly_NoSpace_013.top); expect(SpaceEvenly_NoSpace_011.top).assertEqual(SpaceEvenly_NoSpace_01.top); - expect(SpaceEvenly_NoSpace_012.left - SpaceEvenly_NoSpace_011.right).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_NoSpace_011.left - SpaceEvenly_NoSpace_01.left).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_NoSpace_013.left - SpaceEvenly_NoSpace_012.right).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_NoSpace_01.right - SpaceEvenly_NoSpace_013.right).assertEqual(vp2px(12.5)); - expect(SpaceEvenly_NoSpace_011.right - SpaceEvenly_NoSpace_011.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_NoSpace_012.right - SpaceEvenly_NoSpace_012.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_NoSpace_013.right - SpaceEvenly_NoSpace_013.left).assertEqual(vp2px(150)); - expect(SpaceEvenly_NoSpace_011.bottom - SpaceEvenly_NoSpace_011.top).assertEqual(vp2px(50)); - expect(SpaceEvenly_NoSpace_012.bottom - SpaceEvenly_NoSpace_012.top).assertEqual(vp2px(100)); - expect(SpaceEvenly_NoSpace_013.bottom - SpaceEvenly_NoSpace_013.top).assertEqual(vp2px(150)); + expect(Math.round((SpaceEvenly_NoSpace_012.left - SpaceEvenly_NoSpace_011.right)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round((SpaceEvenly_NoSpace_011.left - SpaceEvenly_NoSpace_01.left)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round((SpaceEvenly_NoSpace_013.left - SpaceEvenly_NoSpace_012.right)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round((SpaceEvenly_NoSpace_01.right - SpaceEvenly_NoSpace_013.right)*100)/100) + .assertEqual(Math.round(vp2px(12.5)*100)/100); + expect(Math.round(SpaceEvenly_NoSpace_011.right - SpaceEvenly_NoSpace_011.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_NoSpace_012.right - SpaceEvenly_NoSpace_012.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_NoSpace_013.right - SpaceEvenly_NoSpace_013.left)).assertEqual(vp2px(150)); + expect(Math.round(SpaceEvenly_NoSpace_011.bottom - SpaceEvenly_NoSpace_011.top)).assertEqual(vp2px(50)); + expect(Math.round(SpaceEvenly_NoSpace_012.bottom - SpaceEvenly_NoSpace_012.top)).assertEqual(vp2px(100)); + expect(Math.round(SpaceEvenly_NoSpace_013.bottom - SpaceEvenly_NoSpace_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_0200] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddAlign.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddAlign.test.ets index 6f2263a2bfb21698ba1bb1408e8566eef3082e3e..734e1d5c9df1a0f2091d8ebdea657c331c2b97a2 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddAlign.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddAlign.test.ets @@ -69,13 +69,13 @@ export default function AlignStart_AddAlign() { expect(Start_AddAlign_012.left).assertEqual(Start_AddAlign_011.right); expect(Start_AddAlign_013.left).assertEqual(Start_AddAlign_012.right); expect(Start_AddAlign_01.left).assertEqual(Start_AddAlign_011.left); - expect(Start_AddAlign_011.right - Start_AddAlign_011.left).assertEqual(vp2px(150)); - expect(Start_AddAlign_012.right - Start_AddAlign_012.left).assertEqual(vp2px(150)); - expect(Start_AddAlign_013.right - Start_AddAlign_013.left).assertEqual(vp2px(150)); - expect(Start_AddAlign_011.bottom - Start_AddAlign_011.top).assertEqual(vp2px(50)); - expect(Start_AddAlign_012.bottom - Start_AddAlign_012.top).assertEqual(vp2px(100)); - expect(Start_AddAlign_013.bottom - Start_AddAlign_013.top).assertEqual(vp2px(150)); - expect(Start_AddAlign_01.right - Start_AddAlign_013.right).assertEqual(vp2px(50)); + expect(Math.round(Start_AddAlign_011.right - Start_AddAlign_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddAlign_012.right - Start_AddAlign_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddAlign_013.right - Start_AddAlign_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddAlign_011.bottom - Start_AddAlign_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Start_AddAlign_012.bottom - Start_AddAlign_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Start_AddAlign_013.bottom - Start_AddAlign_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddAlign_01.right - Start_AddAlign_013.right)).assertEqual(vp2px(50)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_0800] END'); done() }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddAllSpace.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddAllSpace.test.ets index 51c9f412b04ba69126bac61d05f483f2dce58c6f..662c3c5964b588a90f9958c2af04204ce3d2271c 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddAllSpace.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddAllSpace.test.ets @@ -68,17 +68,17 @@ export default function AlignStart_AddAllSpace() { expect( Start_AddAllSpace_012.top ).assertEqual(Start_AddAllSpace_013.top); expect( Start_AddAllSpace_012.left ).assertEqual(Start_AddAllSpace_011.right); expect( Start_AddAllSpace_013.left ).assertEqual(Start_AddAllSpace_012.right); - expect( Start_AddAllSpace_011.top - Start_AddAllSpace_01.top ).assertEqual(vp2px(30)); - expect( Start_AddAllSpace_011.left - Start_AddAllSpace_01.left ).assertEqual(vp2px(30)); - expect( Start_AddAllSpace_01.right - Start_AddAllSpace_013.right ).assertEqual(vp2px(30)); - expect( Start_AddAllSpace_01.top - Start_AddAllSpace_01_Box.top ).assertEqual(vp2px(10)); - expect( Start_AddAllSpace_01.left - Start_AddAllSpace_01_Box.left ).assertEqual(vp2px(10)); - expect(Start_AddAllSpace_011.bottom - Start_AddAllSpace_011.top).assertEqual(vp2px(50)); - expect(Start_AddAllSpace_012.bottom - Start_AddAllSpace_012.top).assertEqual(vp2px(100)); - expect(Start_AddAllSpace_013.bottom - Start_AddAllSpace_013.top).assertEqual(vp2px(150)); - expect(Start_AddAllSpace_011.right - Start_AddAllSpace_011.left).assertEqual(vp2px(440/3)); - expect(Start_AddAllSpace_012.right - Start_AddAllSpace_012.left).assertEqual(vp2px(440/3)); - expect(Start_AddAllSpace_013.right - Start_AddAllSpace_013.left).assertEqual(vp2px(440/3)); + expect( Math.round(Start_AddAllSpace_011.top - Start_AddAllSpace_01.top) ).assertEqual(vp2px(30)); + expect( Math.round(Start_AddAllSpace_011.left - Start_AddAllSpace_01.left) ).assertEqual(vp2px(30)); + expect( Math.round(Start_AddAllSpace_01.right - Start_AddAllSpace_013.right) ).assertEqual(vp2px(30)); + expect( Math.round(Start_AddAllSpace_01.top - Start_AddAllSpace_01_Box.top) ).assertEqual(vp2px(10)); + expect( Math.round(Start_AddAllSpace_01.left - Start_AddAllSpace_01_Box.left) ).assertEqual(vp2px(10)); + expect(Math.round(Start_AddAllSpace_011.bottom - Start_AddAllSpace_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Start_AddAllSpace_012.bottom - Start_AddAllSpace_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Start_AddAllSpace_013.bottom - Start_AddAllSpace_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddAllSpace_011.right - Start_AddAllSpace_011.left)).assertEqual(Math.round(vp2px(440/3))); + expect(Math.round(Start_AddAllSpace_012.right - Start_AddAllSpace_012.left)).assertEqual(Math.round(vp2px(440/3))); + expect(Math.round(Start_AddAllSpace_013.right - Start_AddAllSpace_013.left)).assertEqual(Math.round(vp2px(440/3))); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_0600] END'); done(); }); @@ -106,17 +106,17 @@ export default function AlignStart_AddAllSpace() { expect(Start_AddAllSpace_012.top).assertEqual(Start_AddAllSpace_013.top); expect(Start_AddAllSpace_012.left).assertEqual(Start_AddAllSpace_011.right); expect(Start_AddAllSpace_013.left).assertEqual(Start_AddAllSpace_012.right); - expect( Start_AddAllSpace_011.left - Start_AddAllSpace_01.left ).assertEqual(vp2px(20)); - expect( Start_AddAllSpace_01.right - Start_AddAllSpace_013.right ).assertEqual(vp2px(30)); - expect( Start_AddAllSpace_011.top - Start_AddAllSpace_01.top ).assertEqual(vp2px(20)); - expect( Start_AddAllSpace_01.left - Start_AddAllSpace_01_Box.left ).assertEqual(vp2px(10)); - expect( Start_AddAllSpace_01.top - Start_AddAllSpace_01_Box.top ).assertEqual(vp2px(10)); - expect(Start_AddAllSpace_011.right - Start_AddAllSpace_011.left).assertEqual(vp2px(150)); - expect(Start_AddAllSpace_012.right - Start_AddAllSpace_012.left).assertEqual(vp2px(150)); - expect(Start_AddAllSpace_013.right - Start_AddAllSpace_013.left).assertEqual(vp2px(150)); - expect(Start_AddAllSpace_011.bottom - Start_AddAllSpace_011.top).assertEqual(vp2px(50)); - expect(Start_AddAllSpace_012.bottom - Start_AddAllSpace_012.top).assertEqual(vp2px(100)); - expect(Start_AddAllSpace_013.bottom - Start_AddAllSpace_013.top).assertEqual(vp2px(150)); + expect( Math.round(Start_AddAllSpace_011.left - Start_AddAllSpace_01.left) ).assertEqual(vp2px(20)); + expect( Math.round(Start_AddAllSpace_01.right - Start_AddAllSpace_013.right) ).assertEqual(vp2px(30)); + expect( Math.round(Start_AddAllSpace_011.top - Start_AddAllSpace_01.top) ).assertEqual(vp2px(20)); + expect( Math.round(Start_AddAllSpace_01.left - Start_AddAllSpace_01_Box.left) ).assertEqual(vp2px(10)); + expect( Math.round(Start_AddAllSpace_01.top - Start_AddAllSpace_01_Box.top) ).assertEqual(vp2px(10)); + expect(Math.round(Start_AddAllSpace_011.right - Start_AddAllSpace_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddAllSpace_012.right - Start_AddAllSpace_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddAllSpace_013.right - Start_AddAllSpace_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddAllSpace_011.bottom - Start_AddAllSpace_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Start_AddAllSpace_012.bottom - Start_AddAllSpace_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Start_AddAllSpace_013.bottom - Start_AddAllSpace_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_0700] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddLayoutWeight.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddLayoutWeight.test.ets index a5d23c16b491637c1de381ba36038309c0adbe4a..ba74c9920c898d8f543a8784f4f5f1d948b4ca47 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddLayoutWeight.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddLayoutWeight.test.ets @@ -72,12 +72,12 @@ export default function AlignStart_AddLayoutWeight() { expect(Start_AddLayoutWeight_012.right).assertEqual(Start_AddLayoutWeight_013.left); expect(Start_AddLayoutWeight_01.left).assertEqual(Start_AddLayoutWeight_011.left); expect(Start_AddLayoutWeight_013.right).assertEqual(Start_AddLayoutWeight_01.right); - expect(Start_AddLayoutWeight_011.right - Start_AddLayoutWeight_011.left).assertEqual(vp2px(100)); - expect(Start_AddLayoutWeight_012.right - Start_AddLayoutWeight_012.left).assertEqual(vp2px(200)); - expect(Start_AddLayoutWeight_013.right - Start_AddLayoutWeight_013.left).assertEqual(vp2px(200)); - expect(Start_AddLayoutWeight_011.bottom - Start_AddLayoutWeight_011.top).assertEqual(vp2px(50)); - expect(Start_AddLayoutWeight_012.bottom - Start_AddLayoutWeight_012.top).assertEqual(vp2px(100)); - expect(Start_AddLayoutWeight_013.bottom - Start_AddLayoutWeight_013.top).assertEqual(vp2px(150)); + expect(Math.round(Start_AddLayoutWeight_011.right - Start_AddLayoutWeight_011.left)).assertEqual(vp2px(100)); + expect(Math.round(Start_AddLayoutWeight_012.right - Start_AddLayoutWeight_012.left)).assertEqual(vp2px(200)); + expect(Math.round(Start_AddLayoutWeight_013.right - Start_AddLayoutWeight_013.left)).assertEqual(vp2px(200)); + expect(Math.round(Start_AddLayoutWeight_011.bottom - Start_AddLayoutWeight_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Start_AddLayoutWeight_012.bottom - Start_AddLayoutWeight_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Start_AddLayoutWeight_013.bottom - Start_AddLayoutWeight_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1200] END'); done(); }); @@ -108,14 +108,14 @@ export default function AlignStart_AddLayoutWeight() { expect(Start_AddLayoutWeight_012.right).assertEqual(Start_AddLayoutWeight_013.left); expect(Start_AddLayoutWeight_01.left).assertEqual(Start_AddLayoutWeight_011.left); expect(Start_AddLayoutWeight_013.right).assertEqual(Start_AddLayoutWeight_01.right); - let oneWidth = Start_AddLayoutWeight_011.right - Start_AddLayoutWeight_011.left; - let twoWidth = Start_AddLayoutWeight_012.right - Start_AddLayoutWeight_012.left; + let oneWidth = Math.round(Start_AddLayoutWeight_011.right - Start_AddLayoutWeight_011.left); + let twoWidth = Math.round(Start_AddLayoutWeight_012.right - Start_AddLayoutWeight_012.left); expect(twoWidth / oneWidth).assertEqual(2); expect(twoWidth + oneWidth).assertEqual(vp2px(350)); - expect(Start_AddLayoutWeight_013.right - Start_AddLayoutWeight_013.left).assertEqual(vp2px(150)); - expect(Start_AddLayoutWeight_011.bottom - Start_AddLayoutWeight_011.top).assertEqual(vp2px(50)); - expect(Start_AddLayoutWeight_012.bottom - Start_AddLayoutWeight_012.top).assertEqual(vp2px(100)); - expect(Start_AddLayoutWeight_013.bottom - Start_AddLayoutWeight_013.top).assertEqual(vp2px(150)); + expect(Math.round(Start_AddLayoutWeight_013.right - Start_AddLayoutWeight_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddLayoutWeight_011.bottom - Start_AddLayoutWeight_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Start_AddLayoutWeight_012.bottom - Start_AddLayoutWeight_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Start_AddLayoutWeight_013.bottom - Start_AddLayoutWeight_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1600] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddMargin.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddMargin.test.ets index 7b9530e5cc8af11779c8c4451e6b7f284cc0ab17..af9e7745b13d61615b71963edf0a6ef3f2f75b8e 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddMargin.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddMargin.test.ets @@ -71,14 +71,14 @@ export default function AlignStart_AddMargin() { expect(Start_AddMargin_012.left).assertEqual(Start_AddMargin_011.right); expect(Start_AddMargin_013.left).assertEqual(Start_AddMargin_012.right); expect(Start_AddMargin_011.left).assertEqual(Start_AddMargin_01.left); - expect(Start_AddMargin_01.top - Start_AddMargin_01_Box.top).assertEqual(vp2px(20)); - expect(Start_AddMargin_01.left - Start_AddMargin_01_Box.left).assertEqual(vp2px(20)); - expect(Start_AddMargin_011.bottom - Start_AddMargin_011.top).assertEqual(vp2px(50)); - expect(Start_AddMargin_012.bottom - Start_AddMargin_012.top).assertEqual(vp2px(100)); - expect(Start_AddMargin_013.bottom - Start_AddMargin_013.top).assertEqual(vp2px(150)); - expect(Start_AddMargin_011.right - Start_AddMargin_011.left).assertEqual(vp2px(150)); - expect(Start_AddMargin_012.right - Start_AddMargin_012.left).assertEqual(vp2px(150)); - expect(Start_AddMargin_013.right - Start_AddMargin_013.left).assertEqual(vp2px(150)); + expect(Math.round(Start_AddMargin_01.top - Start_AddMargin_01_Box.top)).assertEqual(vp2px(20)); + expect(Math.round(Start_AddMargin_01.left - Start_AddMargin_01_Box.left)).assertEqual(vp2px(20)); + expect(Math.round(Start_AddMargin_011.bottom - Start_AddMargin_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Start_AddMargin_012.bottom - Start_AddMargin_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Start_AddMargin_013.bottom - Start_AddMargin_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddMargin_011.right - Start_AddMargin_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddMargin_012.right - Start_AddMargin_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddMargin_013.right - Start_AddMargin_013.left)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_0500] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOffset.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOffset.test.ets index ee74e14b4f3a5e70edd39c7eade4adc5a13f68ba..edf8df6c3c991ab578c1de026dd8560905e4eb85 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOffset.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOffset.test.ets @@ -63,17 +63,17 @@ export default function AlignStart_AddOffset() { let Start_AddOffset_012 = CommonFunc.getComponentRect('Start_AddOffset_012'); let Start_AddOffset_013 = CommonFunc.getComponentRect('Start_AddOffset_013'); let Start_AddOffset_01 = CommonFunc.getComponentRect('Start_AddOffset_01'); - expect(Start_AddOffset_011.top - Start_AddOffset_01.top).assertEqual(vp2px(15)); - expect(Start_AddOffset_011.left - Start_AddOffset_01.left).assertEqual(vp2px(10)); + expect(Math.round((Start_AddOffset_011.top - Start_AddOffset_01.top)*10)/10).assertEqual(Math.round(vp2px(15)*10)/10); + expect(Math.round(Start_AddOffset_011.left - Start_AddOffset_01.left)).assertEqual(vp2px(10)); expect(Start_AddOffset_012.top).assertEqual(Start_AddOffset_013.top); expect(Start_AddOffset_013.left).assertEqual(Start_AddOffset_012.right); - expect(Start_AddOffset_01.right - Start_AddOffset_013.right).assertEqual(vp2px(50)); - expect(Start_AddOffset_011.right - Start_AddOffset_011.left).assertEqual(vp2px(150)); - expect(Start_AddOffset_012.right - Start_AddOffset_012.left).assertEqual(vp2px(150)); - expect(Start_AddOffset_013.right - Start_AddOffset_013.left).assertEqual(vp2px(150)); - expect(Start_AddOffset_011.bottom - Start_AddOffset_011.top).assertEqual(vp2px(50)); - expect(Start_AddOffset_012.bottom - Start_AddOffset_012.top).assertEqual(vp2px(100)); - expect(Start_AddOffset_013.bottom - Start_AddOffset_013.top).assertEqual(vp2px(150)); + expect(Math.round(Start_AddOffset_01.right - Start_AddOffset_013.right)).assertEqual(vp2px(50)); + expect(Math.round(Start_AddOffset_011.right - Start_AddOffset_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddOffset_012.right - Start_AddOffset_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddOffset_013.right - Start_AddOffset_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddOffset_011.bottom - Start_AddOffset_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Start_AddOffset_012.bottom - Start_AddOffset_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Start_AddOffset_013.bottom - Start_AddOffset_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_0900] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOneMargin.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOneMargin.test.ets index 2627bfbcd6591dc7468873ba5617e5a7c445db5f..c8392735b66e8a17ddf3341d95c4a976c66663e6 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOneMargin.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOneMargin.test.ets @@ -68,15 +68,15 @@ export default function AlignStart_AddOneMargin() { expect(Start_AddOneMargin_013.top).assertEqual(Start_AddOneMargin_012.top); expect(Start_AddOneMargin_01.top).assertEqual(Start_AddOneMargin_012.top); expect(Start_AddOneMargin_013.left).assertEqual(Start_AddOneMargin_012.right); - expect(Start_AddOneMargin_012.left - Start_AddOneMargin_011.right).assertEqual(vp2px(20)); - expect(Start_AddOneMargin_011.top - Start_AddOneMargin_01.top).assertEqual(vp2px(20)); - expect(Start_AddOneMargin_011.left - Start_AddOneMargin_01.left).assertEqual(vp2px(20)); - expect(Start_AddOneMargin_011.right - Start_AddOneMargin_011.left).assertEqual(vp2px(150)); - expect(Start_AddOneMargin_012.right - Start_AddOneMargin_012.left).assertEqual(vp2px(150)); - expect(Start_AddOneMargin_013.right - Start_AddOneMargin_013.left).assertEqual(vp2px(150)); - expect(Start_AddOneMargin_011.bottom - Start_AddOneMargin_011.top).assertEqual(vp2px(50)); - expect(Start_AddOneMargin_012.bottom - Start_AddOneMargin_012.top).assertEqual(vp2px(100)); - expect(Start_AddOneMargin_013.bottom - Start_AddOneMargin_013.top).assertEqual(vp2px(150)); + expect(Math.round(Start_AddOneMargin_012.left - Start_AddOneMargin_011.right)).assertEqual(vp2px(20)); + expect(Math.round(Start_AddOneMargin_011.top - Start_AddOneMargin_01.top)).assertEqual(vp2px(20)); + expect(Math.round(Start_AddOneMargin_011.left - Start_AddOneMargin_01.left)).assertEqual(vp2px(20)); + expect(Math.round(Start_AddOneMargin_011.right - Start_AddOneMargin_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddOneMargin_012.right - Start_AddOneMargin_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddOneMargin_013.right - Start_AddOneMargin_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddOneMargin_011.bottom - Start_AddOneMargin_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Start_AddOneMargin_012.bottom - Start_AddOneMargin_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Start_AddOneMargin_013.bottom - Start_AddOneMargin_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1400] END'); done(); }) @@ -103,15 +103,20 @@ export default function AlignStart_AddOneMargin() { expect(Start_AddOneMargin_01.top).assertEqual(Start_AddOneMargin_012.top); expect(Start_AddOneMargin_013.left).assertEqual(Start_AddOneMargin_012.right); expect(Start_AddOneMargin_013.right).assertEqual(Start_AddOneMargin_01.right); - expect(Start_AddOneMargin_012.left - Start_AddOneMargin_011.right).assertEqual(vp2px(500/17)); - expect(Start_AddOneMargin_011.top - Start_AddOneMargin_01.top).assertEqual(vp2px(30)); - expect(Start_AddOneMargin_011.left - Start_AddOneMargin_01.left).assertEqual(vp2px(500/17)); - expect(Start_AddOneMargin_011.right - Start_AddOneMargin_011.left).assertEqual(vp2px(2500/17)); - expect(Start_AddOneMargin_012.right - Start_AddOneMargin_012.left).assertEqual(vp2px(2500/17)); - expect(Start_AddOneMargin_013.right - Start_AddOneMargin_013.left).assertEqual(vp2px(2500/17)); - expect(Start_AddOneMargin_011.bottom - Start_AddOneMargin_011.top).assertEqual(vp2px(50)); - expect(Start_AddOneMargin_012.bottom - Start_AddOneMargin_012.top).assertEqual(vp2px(100)); - expect(Start_AddOneMargin_013.bottom - Start_AddOneMargin_013.top).assertEqual(vp2px(150)); + expect(Math.round(Start_AddOneMargin_012.left - Start_AddOneMargin_011.right)) + .assertEqual(Math.round(vp2px(500/17))); + expect(Math.round(Start_AddOneMargin_011.top - Start_AddOneMargin_01.top)).assertEqual(vp2px(30)); + expect(Math.round(Start_AddOneMargin_011.left - Start_AddOneMargin_01.left)) + .assertEqual(Math.round(vp2px(500/17))); + expect(Math.round(Start_AddOneMargin_011.right - Start_AddOneMargin_011.left)) + .assertEqual(Math.round(vp2px(2500/17))); + expect(Math.round(Start_AddOneMargin_012.right - Start_AddOneMargin_012.left)) + .assertEqual(Math.round(vp2px(2500/17))); + expect(Math.round(Start_AddOneMargin_013.right - Start_AddOneMargin_013.left)) + .assertEqual(Math.round(vp2px(2500/17))); + expect(Math.round(Start_AddOneMargin_011.bottom - Start_AddOneMargin_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Start_AddOneMargin_012.bottom - Start_AddOneMargin_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Start_AddOneMargin_013.bottom - Start_AddOneMargin_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1500] END'); done(); }) diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOneWidth.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOneWidth.test.ets index ba459f5f34dcfb17c576f6d502405587ec7b264a..c97fb1b7081263612e1d3c88034b8196354365da 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOneWidth.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOneWidth.test.ets @@ -69,13 +69,13 @@ export default function AlignStart_AddOneWidth() { expect(Start_AddOneWidth_01.left).assertEqual(Start_AddOneWidth_011.left); expect(Start_AddOneWidth_012.left).assertEqual(Start_AddOneWidth_011.right); expect(Start_AddOneWidth_013.left).assertEqual(Start_AddOneWidth_012.right); - expect(Start_AddOneWidth_011.right - Start_AddOneWidth_011.left).assertEqual(vp2px(160)); - expect(Start_AddOneWidth_012.right - Start_AddOneWidth_012.left).assertEqual(vp2px(150)); - expect(Start_AddOneWidth_013.right - Start_AddOneWidth_013.left).assertEqual(vp2px(150)); - expect(Start_AddOneWidth_011.bottom - Start_AddOneWidth_011.top).assertEqual(vp2px(50)); - expect(Start_AddOneWidth_012.bottom - Start_AddOneWidth_012.top).assertEqual(vp2px(100)); - expect(Start_AddOneWidth_013.bottom - Start_AddOneWidth_013.top).assertEqual(vp2px(150)); - expect(Start_AddOneWidth_01.right - Start_AddOneWidth_013.right).assertEqual(vp2px(40)); + expect(Math.round(Start_AddOneWidth_011.right - Start_AddOneWidth_011.left)).assertEqual(vp2px(160)); + expect(Math.round(Start_AddOneWidth_012.right - Start_AddOneWidth_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddOneWidth_013.right - Start_AddOneWidth_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddOneWidth_011.bottom - Start_AddOneWidth_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Start_AddOneWidth_012.bottom - Start_AddOneWidth_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Start_AddOneWidth_013.bottom - Start_AddOneWidth_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddOneWidth_01.right - Start_AddOneWidth_013.right)).assertEqual(vp2px(40)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1300] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddPadding.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddPadding.test.ets index 2bf6dec5ccf3ed2faf07e0ff87d9299b26755b92..ca50fa60684922e4b3a933c4fdef4d5ce7e6866c 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddPadding.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddPadding.test.ets @@ -69,15 +69,15 @@ export default function AlignStart_AddPadding() { expect(Start_AddPadding_012.top).assertEqual(Start_AddPadding_013.top); expect(Start_AddPadding_012.left).assertEqual(Start_AddPadding_011.right); expect(Start_AddPadding_013.left).assertEqual(Start_AddPadding_012.right); - expect(Start_AddPadding_011.left - Start_AddPadding_01.left).assertEqual(vp2px(30)); - expect(Start_AddPadding_01.right - Start_AddPadding_013.right).assertEqual(vp2px(30)); - expect(Start_AddPadding_011.top - Start_AddPadding_01.top).assertEqual(vp2px(30)); - expect(Start_AddPadding_011.right - Start_AddPadding_011.left).assertEqual(vp2px(440/3)); - expect(Start_AddPadding_012.right - Start_AddPadding_012.left).assertEqual(vp2px(440/3)); - expect(Start_AddPadding_013.right - Start_AddPadding_013.left).assertEqual(vp2px(440/3)); - expect(Start_AddPadding_011.bottom - Start_AddPadding_011.top).assertEqual(vp2px(50)); - expect(Start_AddPadding_012.bottom - Start_AddPadding_012.top).assertEqual(vp2px(100)); - expect(Start_AddPadding_013.bottom - Start_AddPadding_013.top).assertEqual(vp2px(150)); + expect(Math.round(Start_AddPadding_011.left - Start_AddPadding_01.left)).assertEqual(vp2px(30)); + expect(Math.round(Start_AddPadding_01.right - Start_AddPadding_013.right)).assertEqual(vp2px(30)); + expect(Math.round(Start_AddPadding_011.top - Start_AddPadding_01.top)).assertEqual(vp2px(30)); + expect(Math.round(Start_AddPadding_011.right - Start_AddPadding_011.left)).assertEqual(Math.round(vp2px(440/3))); + expect(Math.round(Start_AddPadding_012.right - Start_AddPadding_012.left)).assertEqual(Math.round(vp2px(440/3))); + expect(Math.round(Start_AddPadding_013.right - Start_AddPadding_013.left)).assertEqual(Math.round(vp2px(440/3))); + expect(Math.round(Start_AddPadding_011.bottom - Start_AddPadding_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Start_AddPadding_012.bottom - Start_AddPadding_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Start_AddPadding_013.bottom - Start_AddPadding_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_0300] END'); done(); }); @@ -104,15 +104,15 @@ export default function AlignStart_AddPadding() { expect(Start_AddPadding_012.top).assertEqual(Start_AddPadding_013.top) expect( Start_AddPadding_012.left ).assertEqual(Start_AddPadding_011.right) expect( Start_AddPadding_013.left ).assertEqual(Start_AddPadding_012.right) - expect(Start_AddPadding_011.left - Start_AddPadding_01.left).assertEqual(vp2px(20)); - expect(Start_AddPadding_01.right - Start_AddPadding_013.right).assertEqual(vp2px(30)); - expect(Start_AddPadding_011.top - Start_AddPadding_01.top).assertEqual(vp2px(20)); - expect(Start_AddPadding_011.right - Start_AddPadding_011.left).assertEqual(vp2px(150)); - expect(Start_AddPadding_012.right - Start_AddPadding_012.left).assertEqual(vp2px(150)); - expect(Start_AddPadding_013.right - Start_AddPadding_013.left).assertEqual(vp2px(150)); - expect(Start_AddPadding_011.bottom - Start_AddPadding_011.top).assertEqual(vp2px(50)); - expect(Start_AddPadding_012.bottom - Start_AddPadding_012.top).assertEqual(vp2px(100)); - expect(Start_AddPadding_013.bottom - Start_AddPadding_013.top).assertEqual(vp2px(150)); + expect(Math.round(Start_AddPadding_011.left - Start_AddPadding_01.left)).assertEqual(vp2px(20)); + expect(Math.round(Start_AddPadding_01.right - Start_AddPadding_013.right)).assertEqual(vp2px(30)); + expect(Math.round(Start_AddPadding_011.top - Start_AddPadding_01.top)).assertEqual(vp2px(20)); + expect(Math.round(Start_AddPadding_011.right - Start_AddPadding_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddPadding_012.right - Start_AddPadding_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddPadding_013.right - Start_AddPadding_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddPadding_011.bottom - Start_AddPadding_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Start_AddPadding_012.bottom - Start_AddPadding_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Start_AddPadding_013.bottom - Start_AddPadding_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_0400] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddVisibility.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddVisibility.test.ets index 9bf6c2a5d1f0643e046e3473bcf7dacdfd1f533b..c798fa7cbfdf7af7abf59f0d183b11600547e7a3 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddVisibility.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddVisibility.test.ets @@ -67,11 +67,11 @@ export default function AlignStart_AddVisibility() { expect(Start_AddVisibility_012.top).assertEqual(Start_AddVisibility_01.top); expect(Start_AddVisibility_012.left).assertEqual(Start_AddVisibility_01.left); expect(Start_AddVisibility_012.right).assertEqual(Start_AddVisibility_013.left); - expect(Start_AddVisibility_012.right - Start_AddVisibility_012.left).assertEqual(vp2px(150)); - expect(Start_AddVisibility_013.right - Start_AddVisibility_013.left).assertEqual(vp2px(150)); - expect(Start_AddVisibility_012.bottom - Start_AddVisibility_012.top).assertEqual(vp2px(100)); - expect(Start_AddVisibility_013.bottom - Start_AddVisibility_013.top).assertEqual(vp2px(150)); - expect(Start_AddVisibility_01.right - Start_AddVisibility_013.right).assertEqual(vp2px(200)); + expect(Math.round(Start_AddVisibility_012.right - Start_AddVisibility_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddVisibility_013.right - Start_AddVisibility_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddVisibility_012.bottom - Start_AddVisibility_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Start_AddVisibility_013.bottom - Start_AddVisibility_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddVisibility_01.right - Start_AddVisibility_013.right)).assertEqual(vp2px(200)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1000] END'); done(); }); @@ -103,13 +103,13 @@ export default function AlignStart_AddVisibility() { expect(Start_AddVisibility_012.left).assertEqual(Start_AddVisibility_011.right); expect(Start_AddVisibility_013.left).assertEqual(Start_AddVisibility_012.right); expect(Start_AddVisibility_01.left).assertEqual(Start_AddVisibility_011.left); - expect(Start_AddVisibility_011.right - Start_AddVisibility_011.left).assertEqual(vp2px(150)); - expect(Start_AddVisibility_012.right - Start_AddVisibility_012.left).assertEqual(vp2px(150)); - expect(Start_AddVisibility_013.right - Start_AddVisibility_013.left).assertEqual(vp2px(150)); - expect(Start_AddVisibility_011.bottom - Start_AddVisibility_011.top).assertEqual(vp2px(50)); - expect(Start_AddVisibility_012.bottom - Start_AddVisibility_012.top).assertEqual(vp2px(100)); - expect(Start_AddVisibility_013.bottom - Start_AddVisibility_013.top).assertEqual(vp2px(150)); - expect(Start_AddVisibility_012.left - Start_AddVisibility_01.left).assertEqual(vp2px(150)); + expect(Math.round(Start_AddVisibility_011.right - Start_AddVisibility_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddVisibility_012.right - Start_AddVisibility_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddVisibility_013.right - Start_AddVisibility_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddVisibility_011.bottom - Start_AddVisibility_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Start_AddVisibility_012.bottom - Start_AddVisibility_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Start_AddVisibility_013.bottom - Start_AddVisibility_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddVisibility_012.left - Start_AddVisibility_01.left)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1100] END'); done(); }); @@ -141,13 +141,13 @@ export default function AlignStart_AddVisibility() { expect(Start_AddVisibility_012.left).assertEqual(Start_AddVisibility_011.right); expect(Start_AddVisibility_013.left).assertEqual(Start_AddVisibility_012.right); expect(Start_AddVisibility_01.left).assertEqual(Start_AddVisibility_011.left); - expect(Start_AddVisibility_011.right - Start_AddVisibility_011.left).assertEqual(vp2px(150)); - expect(Start_AddVisibility_012.right - Start_AddVisibility_012.left).assertEqual(vp2px(150)); - expect(Start_AddVisibility_013.right - Start_AddVisibility_013.left).assertEqual(vp2px(150)); - expect(Start_AddVisibility_011.bottom - Start_AddVisibility_011.top).assertEqual(vp2px(50)); - expect(Start_AddVisibility_012.bottom - Start_AddVisibility_012.top).assertEqual(vp2px(100)); - expect(Start_AddVisibility_013.bottom - Start_AddVisibility_013.top).assertEqual(vp2px(150)); - expect(Start_AddVisibility_012.left - Start_AddVisibility_01.left).assertEqual(vp2px(150)); + expect(Math.round(Start_AddVisibility_011.right - Start_AddVisibility_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddVisibility_012.right - Start_AddVisibility_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddVisibility_013.right - Start_AddVisibility_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddVisibility_011.bottom - Start_AddVisibility_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Start_AddVisibility_012.bottom - Start_AddVisibility_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Start_AddVisibility_013.bottom - Start_AddVisibility_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Start_AddVisibility_012.left - Start_AddVisibility_01.left)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1700] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_NoSpace.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_NoSpace.test.ets index 356d44455bb756038c08c6c8c7b1316be07bd757..88f1fccae8ca86590ac7bf426e6404600a5862f4 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_NoSpace.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_NoSpace.test.ets @@ -71,12 +71,12 @@ export default function AlignStart_NoSpace() { expect(Start_NoSpace_013.left).assertEqual(Start_NoSpace_012.right); expect(Start_NoSpace_01.left).assertEqual(Start_NoSpace_011.left); expect(Start_NoSpace_01.right).assertEqual(Start_NoSpace_013.right); - expect(Start_NoSpace_011.right - Start_NoSpace_011.left).assertEqual(vp2px(400/3)); - expect(Start_NoSpace_012.right - Start_NoSpace_012.left).assertEqual(vp2px(400/3)); - expect(Start_NoSpace_013.right - Start_NoSpace_013.left).assertEqual(vp2px(400/3)); - expect(Start_NoSpace_011.bottom - Start_NoSpace_011.top).assertEqual(vp2px(50)); - expect(Start_NoSpace_012.bottom - Start_NoSpace_012.top).assertEqual(vp2px(100)); - expect(Start_NoSpace_013.bottom - Start_NoSpace_013.top).assertEqual(vp2px(150)); + expect(Math.round(Start_NoSpace_011.right - Start_NoSpace_011.left)).assertEqual(Math.round(vp2px(400/3))); + expect(Math.round(Start_NoSpace_012.right - Start_NoSpace_012.left)).assertEqual(Math.round(vp2px(400/3))); + expect(Math.round(Start_NoSpace_013.right - Start_NoSpace_013.left)).assertEqual(Math.round(vp2px(400/3))); + expect(Math.round(Start_NoSpace_011.bottom - Start_NoSpace_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Start_NoSpace_012.bottom - Start_NoSpace_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Start_NoSpace_013.bottom - Start_NoSpace_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_0100] END'); done(); }); @@ -105,13 +105,13 @@ export default function AlignStart_NoSpace() { expect(Start_NoSpace_01.left).assertEqual(Start_NoSpace_011.left); expect(Start_NoSpace_012.left).assertEqual(Start_NoSpace_011.right); expect(Start_NoSpace_013.left).assertEqual(Start_NoSpace_012.right); - expect(Start_NoSpace_01.right - Start_NoSpace_013.right).assertEqual(vp2px(50)); - expect(Start_NoSpace_011.right - Start_NoSpace_011.left).assertEqual(vp2px(150)); - expect(Start_NoSpace_012.right - Start_NoSpace_012.left).assertEqual(vp2px(150)); - expect(Start_NoSpace_013.right - Start_NoSpace_013.left).assertEqual(vp2px(150)); - expect(Start_NoSpace_011.bottom - Start_NoSpace_011.top).assertEqual(vp2px(50)); - expect(Start_NoSpace_012.bottom - Start_NoSpace_012.top).assertEqual(vp2px(100)); - expect(Start_NoSpace_013.bottom - Start_NoSpace_013.top).assertEqual(vp2px(150)); + expect(Math.round(Start_NoSpace_01.right - Start_NoSpace_013.right)).assertEqual(vp2px(50)); + expect(Math.round(Start_NoSpace_011.right - Start_NoSpace_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_NoSpace_012.right - Start_NoSpace_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_NoSpace_013.right - Start_NoSpace_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Start_NoSpace_011.bottom - Start_NoSpace_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Start_NoSpace_012.bottom - Start_NoSpace_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Start_NoSpace_013.bottom - Start_NoSpace_013.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_0200] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_Gap.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_Gap.test.ets index 3b44c9e7ff5a7f34d8c78b85972bb00f6f55af8a..4986e16cd409430afed384b36bbbe30e1a069c6c 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_Gap.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_Gap.test.ets @@ -63,8 +63,10 @@ export default function Grid_RowCol_Gap() { expect(Grid_RowCol_Gap_011.left).assertEqual(Grid_RowCol_Gap_01.left); expect(Grid_RowCol_Gap_013.left).assertEqual(Grid_RowCol_Gap_01.left); - expect(Grid_RowCol_Gap_012.left - Grid_RowCol_Gap_011.right).assertEqual(vp2px(5)); - expect(Grid_RowCol_Gap_014.left - Grid_RowCol_Gap_013.right).assertEqual(vp2px(5)); + expect(Math.round((Grid_RowCol_Gap_012.left - Grid_RowCol_Gap_011.right)*10)/10) + .assertEqual(Math.round(vp2px(5)*10)/10); + expect(Math.round((Grid_RowCol_Gap_014.left - Grid_RowCol_Gap_013.right)*10)/10) + .assertEqual(Math.round(vp2px(5)*10)/10); expect(Grid_RowCol_Gap_012.right).assertEqual(Grid_RowCol_Gap_01.right); expect(Grid_RowCol_Gap_014.right).assertEqual(Grid_RowCol_Gap_01.right); @@ -81,15 +83,19 @@ export default function Grid_RowCol_Gap() { expect(Grid_RowCol_Gap_011.right).assertEqual(Grid_RowCol_Gap_013.right); expect(Grid_RowCol_Gap_012.left).assertEqual(Grid_RowCol_Gap_014.left); - expect(Grid_RowCol_Gap_011.right - Grid_RowCol_Gap_011.left).assertEqual(vp2px(147.5)); - expect(Grid_RowCol_Gap_012.right - Grid_RowCol_Gap_012.left).assertEqual(vp2px(147.5)); - expect(Grid_RowCol_Gap_013.right - Grid_RowCol_Gap_013.left).assertEqual(vp2px(147.5)); - expect(Grid_RowCol_Gap_014.right - Grid_RowCol_Gap_014.left).assertEqual(vp2px(147.5)); - - expect(Grid_RowCol_Gap_011.bottom - Grid_RowCol_Gap_011.top).assertEqual(vp2px(150)); - expect(Grid_RowCol_Gap_012.bottom - Grid_RowCol_Gap_012.top).assertEqual(vp2px(150)); - expect(Grid_RowCol_Gap_013.bottom - Grid_RowCol_Gap_013.top).assertEqual(vp2px(150)); - expect(Grid_RowCol_Gap_014.bottom - Grid_RowCol_Gap_014.top).assertEqual(vp2px(150)); + expect(Math.round((Grid_RowCol_Gap_011.right - Grid_RowCol_Gap_011.left)*100)/100) + .assertEqual(Math.round(vp2px(147.5)*100)/100); + expect(Math.round((Grid_RowCol_Gap_012.right - Grid_RowCol_Gap_012.left)*100)/100) + .assertEqual(Math.round(vp2px(147.5)*100)/100); + expect(Math.round((Grid_RowCol_Gap_013.right - Grid_RowCol_Gap_013.left)*100)/100) + .assertEqual(Math.round(vp2px(147.5)*100)/100); + expect(Math.round((Grid_RowCol_Gap_014.right - Grid_RowCol_Gap_014.left)*100)/100) + .assertEqual(Math.round(vp2px(147.5)*100)/100); + + expect(Math.round(Grid_RowCol_Gap_011.bottom - Grid_RowCol_Gap_011.top)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_Gap_012.bottom - Grid_RowCol_Gap_012.top)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_Gap_013.bottom - Grid_RowCol_Gap_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_Gap_014.bottom - Grid_RowCol_Gap_014.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_GRID_GRIDTEMPLATESALLSET_GRIDCHANGE_0600] END'); done(); }); @@ -129,18 +135,24 @@ export default function Grid_RowCol_Gap() { expect(Grid_RowCol_Gap_013.top).assertEqual(Grid_RowCol_Gap_014.top); expect(Grid_RowCol_Gap_011.bottom).assertEqual(Grid_RowCol_Gap_012.bottom); - expect(Grid_RowCol_Gap_013.top - Grid_RowCol_Gap_011.bottom).assertEqual(vp2px(5)); - expect(Grid_RowCol_Gap_014.top - Grid_RowCol_Gap_012.bottom).assertEqual(vp2px(5)); - - expect(Grid_RowCol_Gap_011.right - Grid_RowCol_Gap_011.left).assertEqual(vp2px(150)); - expect(Grid_RowCol_Gap_012.right - Grid_RowCol_Gap_012.left).assertEqual(vp2px(150)); - expect(Grid_RowCol_Gap_013.right - Grid_RowCol_Gap_013.left).assertEqual(vp2px(150)); - expect(Grid_RowCol_Gap_014.right - Grid_RowCol_Gap_014.left).assertEqual(vp2px(150)); - - expect(Grid_RowCol_Gap_011.bottom - Grid_RowCol_Gap_011.top).assertEqual(vp2px(147.5)); - expect(Grid_RowCol_Gap_012.bottom - Grid_RowCol_Gap_012.top).assertEqual(vp2px(147.5)); - expect(Grid_RowCol_Gap_013.bottom - Grid_RowCol_Gap_013.top).assertEqual(vp2px(147.5)); - expect(Grid_RowCol_Gap_014.bottom - Grid_RowCol_Gap_014.top).assertEqual(vp2px(147.5)); + expect(Math.round((Grid_RowCol_Gap_013.top - Grid_RowCol_Gap_011.bottom)*10)/10) + .assertEqual(Math.round(vp2px(5)*10)/10); + expect(Math.round((Grid_RowCol_Gap_014.top - Grid_RowCol_Gap_012.bottom)*10)/10) + .assertEqual(Math.round(vp2px(5)*10)/10); + + expect(Math.round(Grid_RowCol_Gap_011.right - Grid_RowCol_Gap_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_Gap_012.right - Grid_RowCol_Gap_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_Gap_013.right - Grid_RowCol_Gap_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_Gap_014.right - Grid_RowCol_Gap_014.left)).assertEqual(vp2px(150)); + + expect(Math.round((Grid_RowCol_Gap_011.bottom - Grid_RowCol_Gap_011.top)*100)/100) + .assertEqual(Math.round(vp2px(147.5)*100)/100); + expect(Math.round((Grid_RowCol_Gap_012.bottom - Grid_RowCol_Gap_012.top)*100)/100) + .assertEqual(Math.round(vp2px(147.5)*100)/100); + expect(Math.round((Grid_RowCol_Gap_013.bottom - Grid_RowCol_Gap_013.top)*100)/100) + .assertEqual(Math.round(vp2px(147.5)*100)/100); + expect(Math.round((Grid_RowCol_Gap_014.bottom - Grid_RowCol_Gap_014.top)*100)/100) + .assertEqual(Math.round(vp2px(147.5)*100)/100); console.info('[SUB_ACE_GRID_GRIDTEMPLATESALLSET_GRIDCHANGE_0700] END'); done(); }); @@ -177,21 +189,33 @@ export default function Grid_RowCol_Gap() { expect(Grid_RowCol_Gap_013.top).assertEqual(Grid_RowCol_Gap_014.top); expect(Grid_RowCol_Gap_011.bottom).assertEqual(Grid_RowCol_Gap_012.bottom); - expect(Grid_RowCol_Gap_013.top - Grid_RowCol_Gap_011.bottom).assertEqual(vp2px(5)); - expect(Grid_RowCol_Gap_014.top - Grid_RowCol_Gap_012.bottom).assertEqual(vp2px(5)); - - expect(Grid_RowCol_Gap_012.left - Grid_RowCol_Gap_011.right).assertEqual(vp2px(5)); - expect(Grid_RowCol_Gap_014.left - Grid_RowCol_Gap_013.right).assertEqual(vp2px(5)); - - expect(Grid_RowCol_Gap_011.right - Grid_RowCol_Gap_011.left).assertEqual(vp2px(147.5)); - expect(Grid_RowCol_Gap_012.right - Grid_RowCol_Gap_012.left).assertEqual(vp2px(147.5)); - expect(Grid_RowCol_Gap_013.right - Grid_RowCol_Gap_013.left).assertEqual(vp2px(147.5)); - expect(Grid_RowCol_Gap_014.right - Grid_RowCol_Gap_014.left).assertEqual(vp2px(147.5)); - - expect(Grid_RowCol_Gap_011.bottom - Grid_RowCol_Gap_011.top).assertEqual(vp2px(147.5)); - expect(Grid_RowCol_Gap_012.bottom - Grid_RowCol_Gap_012.top).assertEqual(vp2px(147.5)); - expect(Grid_RowCol_Gap_013.bottom - Grid_RowCol_Gap_013.top).assertEqual(vp2px(147.5)); - expect(Grid_RowCol_Gap_014.bottom - Grid_RowCol_Gap_014.top).assertEqual(vp2px(147.5)); + expect(Math.round((Grid_RowCol_Gap_013.top - Grid_RowCol_Gap_011.bottom)*10)/10) + .assertEqual(Math.round(vp2px(5)*10)/10); + expect(Math.round((Grid_RowCol_Gap_014.top - Grid_RowCol_Gap_012.bottom)*10)/10) + .assertEqual(Math.round(vp2px(5)*10)/10); + + expect(Math.round((Grid_RowCol_Gap_012.left - Grid_RowCol_Gap_011.right)*10)/10) + .assertEqual(Math.round(vp2px(5)*10)/10); + expect(Math.round((Grid_RowCol_Gap_014.left - Grid_RowCol_Gap_013.right)*10)/10) + .assertEqual(Math.round(vp2px(5)*10)/10); + + expect(Math.round((Grid_RowCol_Gap_011.right - Grid_RowCol_Gap_011.left)*100)/100) + .assertEqual(Math.round(vp2px(147.5)*100)/100); + expect(Math.round((Grid_RowCol_Gap_012.right - Grid_RowCol_Gap_012.left)*100)/100) + .assertEqual(Math.round(vp2px(147.5)*100)/100); + expect(Math.round((Grid_RowCol_Gap_013.right - Grid_RowCol_Gap_013.left)*100)/100) + .assertEqual(Math.round(vp2px(147.5)*100)/100); + expect(Math.round((Grid_RowCol_Gap_014.right - Grid_RowCol_Gap_014.left)*100)/100) + .assertEqual(Math.round(vp2px(147.5)*100)/100); + + expect(Math.round((Grid_RowCol_Gap_011.bottom - Grid_RowCol_Gap_011.top)*100)/100) + .assertEqual(Math.round(vp2px(147.5)*100)/100); + expect(Math.round((Grid_RowCol_Gap_012.bottom - Grid_RowCol_Gap_012.top)*100)/100) + .assertEqual(Math.round(vp2px(147.5)*100)/100); + expect(Math.round((Grid_RowCol_Gap_013.bottom - Grid_RowCol_Gap_013.top)*100)/100) + .assertEqual(Math.round(vp2px(147.5)*100)/100); + expect(Math.round((Grid_RowCol_Gap_014.bottom - Grid_RowCol_Gap_014.top)*100)/100) + .assertEqual(Math.round(vp2px(147.5)*100)/100); console.info('[SUB_ACE_GRID_GRIDTEMPLATESALLSET_GRIDCHANGE_0800] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_GridSize.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_GridSize.test.ets index 72f68fe35c294fe54d9dcb6f2dab538a2deddac6..738e60e93b6d35715d4a07113230982a2a7e5b92 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_GridSize.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_GridSize.test.ets @@ -79,15 +79,15 @@ export default function Grid_RowCol_GridSize() { expect(Grid_RowCol_GridSize_014.bottom).assertEqual(Grid_RowCol_GridSize_01.bottom); - expect(Grid_RowCol_GridSize_011.right - Grid_RowCol_GridSize_011.left).assertEqual(vp2px(100)); - expect(Grid_RowCol_GridSize_012.right - Grid_RowCol_GridSize_012.left).assertEqual(vp2px(100)); - expect(Grid_RowCol_GridSize_013.right - Grid_RowCol_GridSize_013.left).assertEqual(vp2px(100)); - expect(Grid_RowCol_GridSize_014.right - Grid_RowCol_GridSize_014.left).assertEqual(vp2px(100)); - - expect(Grid_RowCol_GridSize_011.bottom - Grid_RowCol_GridSize_011.top).assertEqual(vp2px(100)); - expect(Grid_RowCol_GridSize_012.bottom - Grid_RowCol_GridSize_012.top).assertEqual(vp2px(100)); - expect(Grid_RowCol_GridSize_013.bottom - Grid_RowCol_GridSize_013.top).assertEqual(vp2px(100)); - expect(Grid_RowCol_GridSize_014.bottom - Grid_RowCol_GridSize_014.top).assertEqual(vp2px(100)); + expect(Math.round(Grid_RowCol_GridSize_011.right - Grid_RowCol_GridSize_011.left)).assertEqual(vp2px(100)); + expect(Math.round(Grid_RowCol_GridSize_012.right - Grid_RowCol_GridSize_012.left)).assertEqual(vp2px(100)); + expect(Math.round(Grid_RowCol_GridSize_013.right - Grid_RowCol_GridSize_013.left)).assertEqual(vp2px(100)); + expect(Math.round(Grid_RowCol_GridSize_014.right - Grid_RowCol_GridSize_014.left)).assertEqual(vp2px(100)); + + expect(Math.round(Grid_RowCol_GridSize_011.bottom - Grid_RowCol_GridSize_011.top)).assertEqual(vp2px(100)); + expect(Math.round(Grid_RowCol_GridSize_012.bottom - Grid_RowCol_GridSize_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Grid_RowCol_GridSize_013.bottom - Grid_RowCol_GridSize_013.top)).assertEqual(vp2px(100)); + expect(Math.round(Grid_RowCol_GridSize_014.bottom - Grid_RowCol_GridSize_014.top)).assertEqual(vp2px(100)); console.info('[SUB_ACE_GRID_GRIDTEMPLATESALLSET_GRIDCHANGE_0100] END'); done(); }); @@ -127,15 +127,15 @@ export default function Grid_RowCol_GridSize() { expect(Grid_RowCol_GridSize_014.bottom).assertEqual(Grid_RowCol_GridSize_01.bottom); - expect(Grid_RowCol_GridSize_011.right - Grid_RowCol_GridSize_011.left).assertEqual(vp2px(100)); - expect(Grid_RowCol_GridSize_012.right - Grid_RowCol_GridSize_012.left).assertEqual(vp2px(100)); - expect(Grid_RowCol_GridSize_013.right - Grid_RowCol_GridSize_013.left).assertEqual(vp2px(100)); - expect(Grid_RowCol_GridSize_014.right - Grid_RowCol_GridSize_014.left).assertEqual(vp2px(100)); + expect(Math.round(Grid_RowCol_GridSize_011.right - Grid_RowCol_GridSize_011.left)).assertEqual(vp2px(100)); + expect(Math.round(Grid_RowCol_GridSize_012.right - Grid_RowCol_GridSize_012.left)).assertEqual(vp2px(100)); + expect(Math.round(Grid_RowCol_GridSize_013.right - Grid_RowCol_GridSize_013.left)).assertEqual(vp2px(100)); + expect(Math.round(Grid_RowCol_GridSize_014.right - Grid_RowCol_GridSize_014.left)).assertEqual(vp2px(100)); - expect(Grid_RowCol_GridSize_011.bottom - Grid_RowCol_GridSize_011.top).assertEqual(vp2px(150)); - expect(Grid_RowCol_GridSize_012.bottom - Grid_RowCol_GridSize_012.top).assertEqual(vp2px(150)); - expect(Grid_RowCol_GridSize_013.bottom - Grid_RowCol_GridSize_013.top).assertEqual(vp2px(150)); - expect(Grid_RowCol_GridSize_014.bottom - Grid_RowCol_GridSize_014.top).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_GridSize_011.bottom - Grid_RowCol_GridSize_011.top)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_GridSize_012.bottom - Grid_RowCol_GridSize_012.top)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_GridSize_013.bottom - Grid_RowCol_GridSize_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_GridSize_014.bottom - Grid_RowCol_GridSize_014.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_GRID_GRIDTEMPLATESALLSET_GRIDCHANGE_0200] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_LayoutDirection.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_LayoutDirection.test.ets index 75bebc93f984bdfd96befea52657ac7a3a8bc089..fcaf2419cb1eb762118a342cedda98b1505ce571 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_LayoutDirection.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_LayoutDirection.test.ets @@ -78,15 +78,21 @@ export default function Grid_RowCol_LayoutDirection() { expect(Grid_RowCol_LayoutDirection_013.bottom).assertEqual(Grid_RowCol_LayoutDirection_01.bottom); expect(Grid_RowCol_LayoutDirection_014.bottom).assertEqual(Grid_RowCol_LayoutDirection_01.bottom); - expect(Grid_RowCol_LayoutDirection_011.right - Grid_RowCol_LayoutDirection_011.left).assertEqual(vp2px(150)); - expect(Grid_RowCol_LayoutDirection_012.right - Grid_RowCol_LayoutDirection_012.left).assertEqual(vp2px(150)); - expect(Grid_RowCol_LayoutDirection_013.right - Grid_RowCol_LayoutDirection_013.left).assertEqual(vp2px(150)); - expect(Grid_RowCol_LayoutDirection_014.right - Grid_RowCol_LayoutDirection_014.left).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_LayoutDirection_011.right - Grid_RowCol_LayoutDirection_011.left)) + .assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_LayoutDirection_012.right - Grid_RowCol_LayoutDirection_012.left)) + .assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_LayoutDirection_013.right - Grid_RowCol_LayoutDirection_013.left)) + .assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_LayoutDirection_014.right - Grid_RowCol_LayoutDirection_014.left)) + .assertEqual(vp2px(150)); - expect(Grid_RowCol_LayoutDirection_011.bottom - Grid_RowCol_LayoutDirection_011.top).assertEqual(vp2px(150)); - expect(Grid_RowCol_LayoutDirection_012.bottom - Grid_RowCol_LayoutDirection_012.top).assertEqual(vp2px(150)); - expect(Grid_RowCol_LayoutDirection_013.bottom - Grid_RowCol_LayoutDirection_013.top).assertEqual(vp2px(150)); - expect(Grid_RowCol_LayoutDirection_014.bottom - Grid_RowCol_LayoutDirection_014.top).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_LayoutDirection_011.bottom - Grid_RowCol_LayoutDirection_011.top)) + .assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_LayoutDirection_013.bottom - Grid_RowCol_LayoutDirection_013.top)) + .assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_LayoutDirection_014.bottom - Grid_RowCol_LayoutDirection_014.top)) + .assertEqual(vp2px(150)); console.info('[SUB_ACE_GRID_GRIDTEMPLATESALLSET_GRIDCHANGE_0900] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_PadMar.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_PadMar.test.ets index 102bc4fcc628e21032c9560a32126efab13d2918..222d473ff103aa2bfd623d35bb7babef14123a46 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_PadMar.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_PadMar.test.ets @@ -60,34 +60,34 @@ export default function Grid_RowCol_PadMar() { let Grid_RowCol_PadMar_013 = CommonFunc.getComponentRect('Grid_RowCol_PadMar_013'); let Grid_RowCol_PadMar_014 = CommonFunc.getComponentRect('Grid_RowCol_PadMar_014'); let Grid_RowCol_PadMar_01 = CommonFunc.getComponentRect('Grid_RowCol_PadMar_01'); - expect(Grid_RowCol_PadMar_011.left - Grid_RowCol_PadMar_01.left).assertEqual(vp2px(10)); + expect(Math.round(Grid_RowCol_PadMar_011.left - Grid_RowCol_PadMar_01.left)).assertEqual(vp2px(10)); expect(Grid_RowCol_PadMar_013.left).assertEqual(Grid_RowCol_PadMar_011.left); expect(Grid_RowCol_PadMar_011.right).assertEqual(Grid_RowCol_PadMar_012.left); expect(Grid_RowCol_PadMar_013.right).assertEqual(Grid_RowCol_PadMar_014.left); - expect(Grid_RowCol_PadMar_01.right - Grid_RowCol_PadMar_012.right).assertEqual(vp2px(10)); + expect(Math.round(Grid_RowCol_PadMar_01.right - Grid_RowCol_PadMar_012.right)).assertEqual(vp2px(10)); expect(Grid_RowCol_PadMar_014.right).assertEqual(Grid_RowCol_PadMar_012.right); - expect(Grid_RowCol_PadMar_011.top - Grid_RowCol_PadMar_01.top).assertEqual(vp2px(10)); + expect(Math.round(Grid_RowCol_PadMar_011.top - Grid_RowCol_PadMar_01.top)).assertEqual(vp2px(10)); expect(Grid_RowCol_PadMar_012.top).assertEqual(Grid_RowCol_PadMar_011.top); expect(Grid_RowCol_PadMar_011.bottom).assertEqual(Grid_RowCol_PadMar_013.top); expect(Grid_RowCol_PadMar_012.bottom).assertEqual(Grid_RowCol_PadMar_014.top); - expect(Grid_RowCol_PadMar_01.bottom - Grid_RowCol_PadMar_013.bottom).assertEqual(vp2px(10)); + expect(Math.round(Grid_RowCol_PadMar_01.bottom - Grid_RowCol_PadMar_013.bottom)).assertEqual(vp2px(10)); expect(Grid_RowCol_PadMar_013.bottom).assertEqual(Grid_RowCol_PadMar_014.bottom); - expect(Grid_RowCol_PadMar_011.right - Grid_RowCol_PadMar_011.left).assertEqual(vp2px(140)); - expect(Grid_RowCol_PadMar_012.right - Grid_RowCol_PadMar_012.left).assertEqual(vp2px(140)); - expect(Grid_RowCol_PadMar_013.right - Grid_RowCol_PadMar_013.left).assertEqual(vp2px(140)); - expect(Grid_RowCol_PadMar_014.right - Grid_RowCol_PadMar_014.left).assertEqual(vp2px(140)); + expect(Math.round(Grid_RowCol_PadMar_011.right - Grid_RowCol_PadMar_011.left)).assertEqual(vp2px(140)); + expect(Math.round(Grid_RowCol_PadMar_012.right - Grid_RowCol_PadMar_012.left)).assertEqual(vp2px(140)); + expect(Math.round(Grid_RowCol_PadMar_013.right - Grid_RowCol_PadMar_013.left)).assertEqual(vp2px(140)); + expect(Math.round(Grid_RowCol_PadMar_014.right - Grid_RowCol_PadMar_014.left)).assertEqual(vp2px(140)); - expect(Grid_RowCol_PadMar_011.bottom - Grid_RowCol_PadMar_011.top).assertEqual(vp2px(140)); - expect(Grid_RowCol_PadMar_012.bottom - Grid_RowCol_PadMar_012.top).assertEqual(vp2px(140)); - expect(Grid_RowCol_PadMar_013.bottom - Grid_RowCol_PadMar_013.top).assertEqual(vp2px(140)); - expect(Grid_RowCol_PadMar_014.bottom - Grid_RowCol_PadMar_014.top).assertEqual(vp2px(140)); + expect(Math.round(Grid_RowCol_PadMar_011.bottom - Grid_RowCol_PadMar_011.top)).assertEqual(vp2px(140)); + expect(Math.round(Grid_RowCol_PadMar_012.bottom - Grid_RowCol_PadMar_012.top)).assertEqual(vp2px(140)); + expect(Math.round(Grid_RowCol_PadMar_013.bottom - Grid_RowCol_PadMar_013.top)).assertEqual(vp2px(140)); + expect(Math.round(Grid_RowCol_PadMar_014.bottom - Grid_RowCol_PadMar_014.top)).assertEqual(vp2px(140)); console.info('[SUB_ACE_GRID_GRIDTEMPLATESALLSET_GRIDCHANGE_0300] END'); done(); }); @@ -128,20 +128,20 @@ export default function Grid_RowCol_PadMar() { expect(Grid_RowCol_PadMar_01.bottom).assertEqual(Grid_RowCol_PadMar_013.bottom); expect(Grid_RowCol_PadMar_013.bottom).assertEqual(Grid_RowCol_PadMar_014.bottom); - expect(Grid_RowCol_PadMar_01.left - Grid_RowCol_PadMar_Box_01.left).assertEqual(vp2px(10)); - expect(Grid_RowCol_PadMar_01.top - Grid_RowCol_PadMar_Box_01.top).assertEqual(vp2px(10)); - expect(Grid_RowCol_PadMar_Box_01.right - Grid_RowCol_PadMar_01.right).assertEqual(vp2px(10)); - expect(Grid_RowCol_PadMar_Box_01.bottom - Grid_RowCol_PadMar_01.bottom).assertEqual(vp2px(10)); + expect(Math.round(Grid_RowCol_PadMar_01.left - Grid_RowCol_PadMar_Box_01.left)).assertEqual(vp2px(10)); + expect(Math.round(Grid_RowCol_PadMar_01.top - Grid_RowCol_PadMar_Box_01.top)).assertEqual(vp2px(10)); + expect(Math.round(Grid_RowCol_PadMar_Box_01.right - Grid_RowCol_PadMar_01.right)).assertEqual(vp2px(10)); + expect(Math.round(Grid_RowCol_PadMar_Box_01.bottom - Grid_RowCol_PadMar_01.bottom)).assertEqual(vp2px(10)); - expect(Grid_RowCol_PadMar_011.right - Grid_RowCol_PadMar_011.left).assertEqual(vp2px(150)); - expect(Grid_RowCol_PadMar_012.right - Grid_RowCol_PadMar_012.left).assertEqual(vp2px(150)); - expect(Grid_RowCol_PadMar_013.right - Grid_RowCol_PadMar_013.left).assertEqual(vp2px(150)); - expect(Grid_RowCol_PadMar_014.right - Grid_RowCol_PadMar_014.left).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_PadMar_011.right - Grid_RowCol_PadMar_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_PadMar_012.right - Grid_RowCol_PadMar_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_PadMar_013.right - Grid_RowCol_PadMar_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_PadMar_014.right - Grid_RowCol_PadMar_014.left)).assertEqual(vp2px(150)); - expect(Grid_RowCol_PadMar_011.bottom - Grid_RowCol_PadMar_011.top).assertEqual(vp2px(150)); - expect(Grid_RowCol_PadMar_012.bottom - Grid_RowCol_PadMar_012.top).assertEqual(vp2px(150)); - expect(Grid_RowCol_PadMar_013.bottom - Grid_RowCol_PadMar_013.top).assertEqual(vp2px(150)); - expect(Grid_RowCol_PadMar_014.bottom - Grid_RowCol_PadMar_014.top).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_PadMar_011.bottom - Grid_RowCol_PadMar_011.top)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_PadMar_012.bottom - Grid_RowCol_PadMar_012.top)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_PadMar_013.bottom - Grid_RowCol_PadMar_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_PadMar_014.bottom - Grid_RowCol_PadMar_014.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_GRID_GRIDTEMPLATESALLSET_GRIDCHANGE_0400] END'); done(); }); @@ -164,39 +164,39 @@ export default function Grid_RowCol_PadMar() { let Grid_RowCol_PadMar_014 = CommonFunc.getComponentRect('Grid_RowCol_PadMar_014'); let Grid_RowCol_PadMar_01 = CommonFunc.getComponentRect('Grid_RowCol_PadMar_01'); let Grid_RowCol_PadMar_Box_01 = CommonFunc.getComponentRect('Grid_RowCol_PadMar_Box_01'); - expect(Grid_RowCol_PadMar_011.left - Grid_RowCol_PadMar_01.left).assertEqual(vp2px(10)); + expect(Math.round(Grid_RowCol_PadMar_011.left - Grid_RowCol_PadMar_01.left)).assertEqual(vp2px(10)); expect(Grid_RowCol_PadMar_013.left).assertEqual(Grid_RowCol_PadMar_011.left); expect(Grid_RowCol_PadMar_011.right).assertEqual(Grid_RowCol_PadMar_012.left); expect(Grid_RowCol_PadMar_013.right).assertEqual(Grid_RowCol_PadMar_014.left); - expect(Grid_RowCol_PadMar_01.right - Grid_RowCol_PadMar_012.right).assertEqual(vp2px(10)); + expect(Math.round(Grid_RowCol_PadMar_01.right - Grid_RowCol_PadMar_012.right)).assertEqual(vp2px(10)); expect(Grid_RowCol_PadMar_014.right).assertEqual(Grid_RowCol_PadMar_012.right); - expect(Grid_RowCol_PadMar_011.top - Grid_RowCol_PadMar_01.top).assertEqual(vp2px(10)); + expect(Math.round(Grid_RowCol_PadMar_011.top - Grid_RowCol_PadMar_01.top)).assertEqual(vp2px(10)); expect(Grid_RowCol_PadMar_012.top).assertEqual(Grid_RowCol_PadMar_011.top); expect(Grid_RowCol_PadMar_011.bottom).assertEqual(Grid_RowCol_PadMar_013.top); expect(Grid_RowCol_PadMar_012.bottom).assertEqual(Grid_RowCol_PadMar_014.top); - expect(Grid_RowCol_PadMar_01.bottom - Grid_RowCol_PadMar_013.bottom).assertEqual(vp2px(10)); + expect(Math.round(Grid_RowCol_PadMar_01.bottom - Grid_RowCol_PadMar_013.bottom)).assertEqual(vp2px(10)); expect(Grid_RowCol_PadMar_013.bottom).assertEqual(Grid_RowCol_PadMar_014.bottom); - expect(Grid_RowCol_PadMar_01.left - Grid_RowCol_PadMar_Box_01.left).assertEqual(vp2px(10)); - expect(Grid_RowCol_PadMar_01.top - Grid_RowCol_PadMar_Box_01.top).assertEqual(vp2px(10)); - expect(Grid_RowCol_PadMar_Box_01.right - Grid_RowCol_PadMar_01.right).assertEqual(vp2px(10)); - expect(Grid_RowCol_PadMar_Box_01.bottom - Grid_RowCol_PadMar_01.bottom).assertEqual(vp2px(10)); + expect(Math.round(Grid_RowCol_PadMar_01.left - Grid_RowCol_PadMar_Box_01.left)).assertEqual(vp2px(10)); + expect(Math.round(Grid_RowCol_PadMar_01.top - Grid_RowCol_PadMar_Box_01.top)).assertEqual(vp2px(10)); + expect(Math.round(Grid_RowCol_PadMar_Box_01.right - Grid_RowCol_PadMar_01.right)).assertEqual(vp2px(10)); + expect(Math.round(Grid_RowCol_PadMar_Box_01.bottom - Grid_RowCol_PadMar_01.bottom)).assertEqual(vp2px(10)); - expect(Grid_RowCol_PadMar_011.right - Grid_RowCol_PadMar_011.left).assertEqual(vp2px(140)); - expect(Grid_RowCol_PadMar_012.right - Grid_RowCol_PadMar_012.left).assertEqual(vp2px(140)); - expect(Grid_RowCol_PadMar_013.right - Grid_RowCol_PadMar_013.left).assertEqual(vp2px(140)); - expect(Grid_RowCol_PadMar_014.right - Grid_RowCol_PadMar_014.left).assertEqual(vp2px(140)); + expect(Math.round(Grid_RowCol_PadMar_011.right - Grid_RowCol_PadMar_011.left)).assertEqual(vp2px(140)); + expect(Math.round(Grid_RowCol_PadMar_012.right - Grid_RowCol_PadMar_012.left)).assertEqual(vp2px(140)); + expect(Math.round(Grid_RowCol_PadMar_013.right - Grid_RowCol_PadMar_013.left)).assertEqual(vp2px(140)); + expect(Math.round(Grid_RowCol_PadMar_014.right - Grid_RowCol_PadMar_014.left)).assertEqual(vp2px(140)); - expect(Grid_RowCol_PadMar_011.bottom - Grid_RowCol_PadMar_011.top).assertEqual(vp2px(140)); - expect(Grid_RowCol_PadMar_012.bottom - Grid_RowCol_PadMar_012.top).assertEqual(vp2px(140)); - expect(Grid_RowCol_PadMar_013.bottom - Grid_RowCol_PadMar_013.top).assertEqual(vp2px(140)); - expect(Grid_RowCol_PadMar_014.bottom - Grid_RowCol_PadMar_014.top).assertEqual(vp2px(140)); + expect(Math.round(Grid_RowCol_PadMar_011.bottom - Grid_RowCol_PadMar_011.top)).assertEqual(vp2px(140)); + expect(Math.round(Grid_RowCol_PadMar_012.bottom - Grid_RowCol_PadMar_012.top)).assertEqual(vp2px(140)); + expect(Math.round(Grid_RowCol_PadMar_013.bottom - Grid_RowCol_PadMar_013.top)).assertEqual(vp2px(140)); + expect(Math.round(Grid_RowCol_PadMar_014.bottom - Grid_RowCol_PadMar_014.top)).assertEqual(vp2px(140)); console.info('[SUB_ACE_GRID_GRIDTEMPLATESALLSET_GRIDCHANGE_0500] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_cellLength.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_cellLength.test.ets index 7e8c82fcde38b9fc520f1f8b0a654f5e34d3648a..095740e66b48d3fc0e442271ae6b4dda95cacadb 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_cellLength.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_cellLength.test.ets @@ -79,15 +79,15 @@ export default function Grid_RowCol_cellLength() { expect(Grid_RowCol_cellLength_014.bottom).assertEqual(Grid_RowCol_cellLength_01.bottom); - expect(Grid_RowCol_cellLength_011.right - Grid_RowCol_cellLength_011.left).assertEqual(vp2px(150)); - expect(Grid_RowCol_cellLength_012.right - Grid_RowCol_cellLength_012.left).assertEqual(vp2px(150)); - expect(Grid_RowCol_cellLength_013.right - Grid_RowCol_cellLength_013.left).assertEqual(vp2px(150)); - expect(Grid_RowCol_cellLength_014.right - Grid_RowCol_cellLength_014.left).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_cellLength_011.right - Grid_RowCol_cellLength_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_cellLength_012.right - Grid_RowCol_cellLength_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_cellLength_013.right - Grid_RowCol_cellLength_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_cellLength_014.right - Grid_RowCol_cellLength_014.left)).assertEqual(vp2px(150)); - expect(Grid_RowCol_cellLength_011.bottom - Grid_RowCol_cellLength_011.top).assertEqual(vp2px(150)); - expect(Grid_RowCol_cellLength_012.bottom - Grid_RowCol_cellLength_012.top).assertEqual(vp2px(150)); - expect(Grid_RowCol_cellLength_013.bottom - Grid_RowCol_cellLength_013.top).assertEqual(vp2px(150)); - expect(Grid_RowCol_cellLength_014.bottom - Grid_RowCol_cellLength_014.top).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_cellLength_011.bottom - Grid_RowCol_cellLength_011.top)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_cellLength_012.bottom - Grid_RowCol_cellLength_012.top)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_cellLength_013.bottom - Grid_RowCol_cellLength_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_cellLength_014.bottom - Grid_RowCol_cellLength_014.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_GRID_GRIDTEMPLATESALLSET_GRIDCHANGE_1100] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_maxCount.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_maxCount.test.ets index f5b407e075306d4e486f50354ace3119a766629d..9a44010b453f0ac008c9a7a8f9129ac5377fff90 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_maxCount.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_maxCount.test.ets @@ -79,15 +79,15 @@ export default function Grid_RowCol_maxCount() { expect(Grid_RowCol_maxCount_014.bottom).assertEqual(Grid_RowCol_maxCount_01.bottom); - expect(Grid_RowCol_maxCount_011.right - Grid_RowCol_maxCount_011.left).assertEqual(vp2px(150)); - expect(Grid_RowCol_maxCount_012.right - Grid_RowCol_maxCount_012.left).assertEqual(vp2px(150)); - expect(Grid_RowCol_maxCount_013.right - Grid_RowCol_maxCount_013.left).assertEqual(vp2px(150)); - expect(Grid_RowCol_maxCount_014.right - Grid_RowCol_maxCount_014.left).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_maxCount_011.right - Grid_RowCol_maxCount_011.left)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_maxCount_012.right - Grid_RowCol_maxCount_012.left)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_maxCount_013.right - Grid_RowCol_maxCount_013.left)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_maxCount_014.right - Grid_RowCol_maxCount_014.left)).assertEqual(vp2px(150)); - expect(Grid_RowCol_maxCount_011.bottom - Grid_RowCol_maxCount_011.top).assertEqual(vp2px(150)); - expect(Grid_RowCol_maxCount_012.bottom - Grid_RowCol_maxCount_012.top).assertEqual(vp2px(150)); - expect(Grid_RowCol_maxCount_013.bottom - Grid_RowCol_maxCount_013.top).assertEqual(vp2px(150)); - expect(Grid_RowCol_maxCount_014.bottom - Grid_RowCol_maxCount_014.top).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_maxCount_011.bottom - Grid_RowCol_maxCount_011.top)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_maxCount_012.bottom - Grid_RowCol_maxCount_012.top)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_maxCount_013.bottom - Grid_RowCol_maxCount_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Grid_RowCol_maxCount_014.bottom - Grid_RowCol_maxCount_014.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_GRID_GRIDTEMPLATESALLSET_GRIDCHANGE_1000] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridTemplateChange/Grid_RowCol_TemplateChange.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridTemplateChange/Grid_RowCol_TemplateChange.test.ets index cc9c951ff5d04134185932e3652e0d1ade851007..3f33f8e8663ed85e8c22abb36519d8e18e04d346 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridTemplateChange/Grid_RowCol_TemplateChange.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/GridTemplatesAllSet/GridTemplateChange/Grid_RowCol_TemplateChange.test.ets @@ -79,15 +79,15 @@ export default function Grid_RowCol_TemplateChange() { expect(GridTemplateChange_Grid_014.bottom).assertEqual(GridTemplateChange_Grid_01.bottom); - expect(GridTemplateChange_Grid_011.right - GridTemplateChange_Grid_011.left).assertEqual(vp2px(150)); - expect(GridTemplateChange_Grid_012.right - GridTemplateChange_Grid_012.left).assertEqual(vp2px(150)); - expect(GridTemplateChange_Grid_013.right - GridTemplateChange_Grid_013.left).assertEqual(vp2px(150)); - expect(GridTemplateChange_Grid_014.right - GridTemplateChange_Grid_014.left).assertEqual(vp2px(150)); + expect(Math.round(GridTemplateChange_Grid_011.right - GridTemplateChange_Grid_011.left)).assertEqual(vp2px(150)); + expect(Math.round(GridTemplateChange_Grid_012.right - GridTemplateChange_Grid_012.left)).assertEqual(vp2px(150)); + expect(Math.round(GridTemplateChange_Grid_013.right - GridTemplateChange_Grid_013.left)).assertEqual(vp2px(150)); + expect(Math.round(GridTemplateChange_Grid_014.right - GridTemplateChange_Grid_014.left)).assertEqual(vp2px(150)); - expect(GridTemplateChange_Grid_011.bottom - GridTemplateChange_Grid_011.top).assertEqual(vp2px(150)); - expect(GridTemplateChange_Grid_012.bottom - GridTemplateChange_Grid_012.top).assertEqual(vp2px(150)); - expect(GridTemplateChange_Grid_013.bottom - GridTemplateChange_Grid_013.top).assertEqual(vp2px(150)); - expect(GridTemplateChange_Grid_014.bottom - GridTemplateChange_Grid_014.top).assertEqual(vp2px(150)); + expect(Math.round(GridTemplateChange_Grid_011.bottom - GridTemplateChange_Grid_011.top)).assertEqual(vp2px(150)); + expect(Math.round(GridTemplateChange_Grid_012.bottom - GridTemplateChange_Grid_012.top)).assertEqual(vp2px(150)); + expect(Math.round(GridTemplateChange_Grid_013.bottom - GridTemplateChange_Grid_013.top)).assertEqual(vp2px(150)); + expect(Math.round(GridTemplateChange_Grid_014.bottom - GridTemplateChange_Grid_014.top)).assertEqual(vp2px(150)); console.info('[SUB_ACE_GRID_GRIDTEMPLATESALLSET_GRIDTEMPLATECHANGE_0100] END'); done(); }); @@ -125,15 +125,15 @@ export default function Grid_RowCol_TemplateChange() { expect(GridTemplateChange_Grid_011.bottom).assertEqual(GridTemplateChange_Grid_012.bottom); expect(GridTemplateChange_Grid_011.bottom).assertEqual(GridTemplateChange_Grid_013.bottom); - expect(GridTemplateChange_Grid_011.right - GridTemplateChange_Grid_011.left).assertEqual(vp2px(100)); - expect(GridTemplateChange_Grid_012.right - GridTemplateChange_Grid_012.left).assertEqual(vp2px(100)); - expect(GridTemplateChange_Grid_013.right - GridTemplateChange_Grid_013.left).assertEqual(vp2px(100)); - expect(GridTemplateChange_Grid_014.right - GridTemplateChange_Grid_014.left).assertEqual(vp2px(100)); + expect(Math.round(GridTemplateChange_Grid_011.right - GridTemplateChange_Grid_011.left)).assertEqual(vp2px(100)); + expect(Math.round(GridTemplateChange_Grid_012.right - GridTemplateChange_Grid_012.left)).assertEqual(vp2px(100)); + expect(Math.round(GridTemplateChange_Grid_013.right - GridTemplateChange_Grid_013.left)).assertEqual(vp2px(100)); + expect(Math.round(GridTemplateChange_Grid_014.right - GridTemplateChange_Grid_014.left)).assertEqual(vp2px(100)); - expect(GridTemplateChange_Grid_011.bottom - GridTemplateChange_Grid_011.top).assertEqual(vp2px(100)); - expect(GridTemplateChange_Grid_012.bottom - GridTemplateChange_Grid_012.top).assertEqual(vp2px(100)); - expect(GridTemplateChange_Grid_013.bottom - GridTemplateChange_Grid_013.top).assertEqual(vp2px(100)); - expect(GridTemplateChange_Grid_014.bottom - GridTemplateChange_Grid_014.top).assertEqual(vp2px(100)); + expect(Math.round(GridTemplateChange_Grid_011.bottom - GridTemplateChange_Grid_011.top)).assertEqual(vp2px(100)); + expect(Math.round(GridTemplateChange_Grid_012.bottom - GridTemplateChange_Grid_012.top)).assertEqual(vp2px(100)); + expect(Math.round(GridTemplateChange_Grid_013.bottom - GridTemplateChange_Grid_013.top)).assertEqual(vp2px(100)); + expect(Math.round(GridTemplateChange_Grid_014.bottom - GridTemplateChange_Grid_014.top)).assertEqual(vp2px(100)); console.info('[SUB_ACE_GRID_GRIDTEMPLATESALLSET_GRIDTEMPLATECHANGE_0200] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Row/spaceChanged/Row_Space.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Row/spaceChanged/Row_Space.test.ets index 9f7be0fb11a9023d959c3007e5514d4fd7027b1c..75f55708943d363e102a2cd165e0e1ad230e5a4b 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Row/spaceChanged/Row_Space.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Row/spaceChanged/Row_Space.test.ets @@ -57,19 +57,23 @@ export default function Row_Space() { let Row_Space_012 = CommonFunc.getComponentRect('Row_Space_012'); let Row_Space_013 = CommonFunc.getComponentRect('Row_Space_013'); let Row_Space_01 = CommonFunc.getComponentRect('Row_Space_01'); - expect(Row_Space_011.top - Row_Space_01.top).assertEqual(Row_Space_01.bottom - Row_Space_011.bottom); - expect(Row_Space_012.top - Row_Space_01.top).assertEqual(Row_Space_01.bottom - Row_Space_012.bottom); - expect(Row_Space_013.top - Row_Space_01.top).assertEqual(Row_Space_01.bottom - Row_Space_013.bottom); - expect(Row_Space_012.left - Row_Space_011.right).assertEqual(Row_Space_013.left - Row_Space_012.right); - expect(Row_Space_012.left - Row_Space_011.right).assertEqual(vp2px(10)) + expect(Math.round(Row_Space_011.top - Row_Space_01.top)). + assertEqual(Math.round(Row_Space_01.bottom - Row_Space_011.bottom)); + expect(Math.round(Row_Space_012.top - Row_Space_01.top)). + assertEqual(Math.round(Row_Space_01.bottom - Row_Space_012.bottom)); + expect(Math.round(Row_Space_013.top - Row_Space_01.top)). + assertEqual(Math.round(Row_Space_01.bottom - Row_Space_013.bottom)); + expect(Math.round(Row_Space_012.left - Row_Space_011.right)). + assertEqual(Math.round(Row_Space_013.left - Row_Space_012.right)); + expect(Math.round(Row_Space_012.left - Row_Space_011.right)).assertEqual(vp2px(10)) expect(Row_Space_01.left).assertEqual(Row_Space_011.left); expect(Row_Space_013.right).assertLess(Row_Space_01.right); - expect(Row_Space_011.bottom - Row_Space_011.top).assertEqual(vp2px(50)); - expect(Row_Space_012.bottom - Row_Space_012.top).assertEqual(vp2px(100)); - expect(Row_Space_013.bottom - Row_Space_013.top).assertEqual(vp2px(150)); - expect(Row_Space_011.right - Row_Space_011.left).assertEqual(vp2px(100)); - expect(Row_Space_012.right - Row_Space_012.left).assertEqual(vp2px(100)); - expect(Row_Space_013.right - Row_Space_013.left).assertEqual(vp2px(100)); + expect(Math.round(Row_Space_011.bottom - Row_Space_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Row_Space_012.bottom - Row_Space_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Row_Space_013.bottom - Row_Space_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Row_Space_011.right - Row_Space_011.left)).assertEqual(vp2px(100)); + expect(Math.round(Row_Space_012.right - Row_Space_012.left)).assertEqual(vp2px(100)); + expect(Math.round(Row_Space_013.right - Row_Space_013.left)).assertEqual(vp2px(100)); console.info('[SUB_ACE_ROW_SPACE_TEST_0100] END'); done(); }); @@ -86,19 +90,23 @@ export default function Row_Space() { let Row_Space_012 = CommonFunc.getComponentRect('Row_Space_012'); let Row_Space_013 = CommonFunc.getComponentRect('Row_Space_013'); let Row_Space_01 = CommonFunc.getComponentRect('Row_Space_01'); - expect(Row_Space_011.top - Row_Space_01.top).assertEqual(Row_Space_01.bottom - Row_Space_011.bottom); - expect(Row_Space_012.top - Row_Space_01.top).assertEqual(Row_Space_01.bottom - Row_Space_012.bottom); - expect(Row_Space_013.top - Row_Space_01.top).assertEqual(Row_Space_01.bottom - Row_Space_013.bottom); - expect(Row_Space_012.left - Row_Space_011.right).assertEqual(Row_Space_013.left - Row_Space_012.right); - expect(Row_Space_012.left - Row_Space_011.right).assertEqual(vp2px(25)); + expect(Math.round(Row_Space_011.top - Row_Space_01.top)) + .assertEqual(Math.round(Row_Space_01.bottom - Row_Space_011.bottom)); + expect(Math.round(Row_Space_012.top - Row_Space_01.top)) + .assertEqual(Math.round(Row_Space_01.bottom - Row_Space_012.bottom)); + expect(Math.round(Row_Space_013.top - Row_Space_01.top)) + .assertEqual(Math.round(Row_Space_01.bottom - Row_Space_013.bottom)); + expect(Math.round(Row_Space_012.left - Row_Space_011.right)) + .assertEqual(Math.round(Row_Space_013.left - Row_Space_012.right)); + expect(Math.round((Row_Space_012.left - Row_Space_011.right)*10)/10).assertEqual(Math.round(vp2px(25)*10)/10); expect(Row_Space_01.left).assertEqual(Row_Space_011.left); expect(Row_Space_013.right).assertEqual(Row_Space_01.right); - expect(Row_Space_011.bottom - Row_Space_011.top).assertEqual(vp2px(50)); - expect(Row_Space_012.bottom - Row_Space_012.top).assertEqual(vp2px(100)); - expect(Row_Space_013.bottom - Row_Space_013.top).assertEqual(vp2px(150)); - expect(Row_Space_011.right - Row_Space_011.left).assertEqual(vp2px(100)); - expect(Row_Space_012.right - Row_Space_012.left).assertEqual(vp2px(100)); - expect(Row_Space_013.right - Row_Space_013.left).assertEqual(vp2px(100)); + expect(Math.round(Row_Space_011.bottom - Row_Space_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Row_Space_012.bottom - Row_Space_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Row_Space_013.bottom - Row_Space_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Row_Space_011.right - Row_Space_011.left)).assertEqual(vp2px(100)); + expect(Math.round(Row_Space_012.right - Row_Space_012.left)).assertEqual(vp2px(100)); + expect(Math.round(Row_Space_013.right - Row_Space_013.left)).assertEqual(vp2px(100)); console.info('[SUB_ACE_ROW_SPACE_TEST_0200] END'); done(); }); @@ -115,19 +123,23 @@ export default function Row_Space() { let Row_Space_012 = CommonFunc.getComponentRect('Row_Space_012'); let Row_Space_013 = CommonFunc.getComponentRect('Row_Space_013'); let Row_Space_01 = CommonFunc.getComponentRect('Row_Space_01'); - expect(Row_Space_011.top - Row_Space_01.top).assertEqual(Row_Space_01.bottom - Row_Space_011.bottom); - expect(Row_Space_012.top - Row_Space_01.top).assertEqual(Row_Space_01.bottom - Row_Space_012.bottom); - expect(Row_Space_013.top - Row_Space_01.top).assertEqual(Row_Space_01.bottom - Row_Space_013.bottom); - expect(Row_Space_012.left - Row_Space_011.right).assertEqual(Row_Space_013.left - Row_Space_012.right); - expect(Row_Space_012.left - Row_Space_011.right).assertEqual(vp2px(30)) + expect(Math.round(Row_Space_011.top - Row_Space_01.top)) + .assertEqual(Math.round(Row_Space_01.bottom - Row_Space_011.bottom)); + expect(Math.round(Row_Space_012.top - Row_Space_01.top)) + .assertEqual(Math.round(Row_Space_01.bottom - Row_Space_012.bottom)); + expect(Math.round(Row_Space_013.top - Row_Space_01.top)) + .assertEqual(Math.round(Row_Space_01.bottom - Row_Space_013.bottom)); + expect(Math.round(Row_Space_012.left - Row_Space_011.right)) + .assertEqual(Math.round(Row_Space_013.left - Row_Space_012.right)); + expect(Math.round(Row_Space_012.left - Row_Space_011.right)).assertEqual(vp2px(30)) expect(Row_Space_01.left).assertEqual(Row_Space_011.left); expect(Row_Space_013.right).assertLarger(Row_Space_01.right); - expect(Row_Space_011.bottom - Row_Space_011.top).assertEqual(vp2px(50)); - expect(Row_Space_012.bottom - Row_Space_012.top).assertEqual(vp2px(100)); - expect(Row_Space_013.bottom - Row_Space_013.top).assertEqual(vp2px(150)); - expect(Row_Space_011.right - Row_Space_011.left).assertEqual(vp2px(100)); - expect(Row_Space_012.right - Row_Space_012.left).assertEqual(vp2px(100)); - expect(Row_Space_013.right - Row_Space_013.left).assertEqual(vp2px(100)); + expect(Math.round(Row_Space_011.bottom - Row_Space_011.top)).assertEqual(vp2px(50)); + expect(Math.round(Row_Space_012.bottom - Row_Space_012.top)).assertEqual(vp2px(100)); + expect(Math.round(Row_Space_013.bottom - Row_Space_013.top)).assertEqual(vp2px(150)); + expect(Math.round(Row_Space_011.right - Row_Space_011.left)).assertEqual(vp2px(100)); + expect(Math.round(Row_Space_012.right - Row_Space_012.left)).assertEqual(vp2px(100)); + expect(Math.round(Row_Space_013.right - Row_Space_013.left)).assertEqual(vp2px(100)); console.info('[SUB_ACE_ROW_SPACE_TEST_0300] END'); done(); });