Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean-up time conversions on the way to fix #30990 #31021

Merged
merged 3 commits into from
Dec 15, 2023

Conversation

tcarmelveilleux
Copy link
Contributor

  • Test conversions in Time Sync cluster were not in a unit-testable location.
  • TestTimeUtils was not using nl-unit-test
  • Time sync cluster server build rules were missing dependencies
  • Documentation for many time conversion methods was not accurate
  • secondsToMilliseconds did not match coding style
  • Cleaned-up cut and paste errors in some adjacent tests.

Issue #30990

Testing done:

- Test conversions in Time Sync cluster were not in a unit-testable
  location.
- TestTimeUtils was not using nl-unit-test
- Time sync cluster server build rules were missing dependencies
- Documentation for many time conversion methods was not accurate
- `secondsToMilliseconds` did not match coding style
- Cleaned-up cut and paste errors in some adjacent tests.

Issue project-chip#30990

Testing done:
- Unit tests and integration tests still pass.
- Started tests for edge conditions (which found project-chip#30990)
Copy link

github-actions bot commented Dec 14, 2023

PR #31021: Size comparison from ff5b64d to dd1c12a

Increases (2 builds for esp32)
platform target config section ff5b64d dd1c12a change % change
esp32 all-clusters-app c3devkit (read/write) 1671108 1671116 8 0.0
.flash.rodata 241392 241400 8 0.0
m5stack (read only) 1182639 1182667 28 0.0
.flash.text 1177255 1177283 28 0.0
Decreases (7 builds for cyw30739, efr32, esp32, nrfconnect, telink)
platform target config section ff5b64d dd1c12a change % change
cyw30739 switch cyw930739m2evb_01 (read/write) 557471 557431 -40 -0.0
.app_xip_area 445953 445913 -40 -0.0
efr32 lock-app BRD4161A+wf200 (read/write) 1114864 1114856 -8 -0.0
.text 923316 923308 -8 -0.0
esp32 all-clusters-app c3devkit (read only) 1137738 1137688 -50 -0.0
.flash.text 1137738 1137688 -50 -0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1062456 1062424 -32 -0.0
text 781088 781056 -32 -0.0
nrf7002dk_nrf5340_cpuapp (read/write) 1189032 1188984 -48 -0.0
text 778632 778592 -40 -0.0
telink all-clusters-app tlsr9518adk80d (read/write) 1080352 1080296 -56 -0.0
text 762374 762314 -60 -0.0
light-switch-app-ota-shell-factory-data tlsr9528a (read/write) 978672 978608 -64 -0.0
text 694312 694252 -60 -0.0
Full report (72 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
platform target config section ff5b64d dd1c12a change % change
bl602 lighting-app bl602 (read/write) 1417794 1417794 0 0.0
.bss 85160 85160 0 0.0
.data 9416 9416 0 0.0
.rodata 156912 156912 0 0.0
.text 1085662 1085662 0 0.0
bl602+mfd (read/write) 1432266 1432266 0 0.0
.bss 85328 85328 0 0.0
.data 9384 9384 0 0.0
.rodata 155872 155872 0 0.0
.text 1101030 1101030 0 0.0
bl602+rpc (read/write) 1465578 1465578 0 0.0
.bss 93192 93192 0 0.0
.data 9784 9784 0 0.0
.rodata 164536 164536 0 0.0
.text 1117406 1117406 0 0.0
bl702 lighting-app bl702 (read only) 3478 3478 0 0.0
(read/write) 1182807 1182807 0 0.0
.bss 11197 11197 0 0.0
.data 3584 3584 0 0.0
.rodata 106288 106288 0 0.0
.text 955364 955364 0 0.0
bl702+mfd (read only) 3478 3478 0 0.0
(read/write) 1193939 1193939 0 0.0
.bss 11373 11373 0 0.0
.data 3568 3568 0 0.0
.rodata 105228 105228 0 0.0
.text 967428 967428 0 0.0
bl702+rpc (read only) 3478 3478 0 0.0
(read/write) 1274823 1274823 0 0.0
.bss 19677 19677 0 0.0
.data 4144 4144 0 0.0
.rodata 121708 121708 0 0.0
.text 1030426 1030426 0 0.0
bl706-eth (read/write) 1002433 1002433 0 0.0
.bss 23772 23772 0 0.0
.data 3160 3160 0 0.0
.rodata 99620 99620 0 0.0
.text 748260 748260 0 0.0
bl706-wifi (read/write) 1240570 1240570 0 0.0
.bss 10641 10641 0 0.0
.data 3600 3600 0 0.0
.rodata 120600 120600 0 0.0
.text 975556 975556 0 0.0
bl702l lighting-app bl702l (read only) 512 512 0 0.0
(read/write) 1152516 1152516 0 0.0
.bss 16392 16392 0 0.0
.data 4952 4952 0 0.0
.rodata 100292 100292 0 0.0
.text 948490 948490 0 0.0
bl702l+mfd (read only) 512 512 0 0.0
(read/write) 1163968 1163968 0 0.0
.bss 16568 16568 0 0.0
.data 4928 4928 0 0.0
.rodata 99232 99232 0 0.0
.text 960866 960866 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 (read only) 771736 771736 0 0.0
(read/write) 168100 168100 0 0.0
.bss 90436 90436 0 0.0
.data 3460 3460 0 0.0
.rodata 89536 89536 0 0.0
.text 681932 681932 0 0.0
lock-ftd LP_EM_CC1354P10_6 (read only) 787816 787816 0 0.0
(read/write) 178328 178328 0 0.0
.bss 100612 100612 0 0.0
.data 3488 3488 0 0.0
.rodata 83792 83792 0 0.0
.text 703760 703760 0 0.0
lock-mtd LP_EM_CC1354P10_6 (read only) 776048 776048 0 0.0
(read/write) 172784 172784 0 0.0
.bss 95068 95068 0 0.0
.data 3488 3488 0 0.0
.rodata 110392 110392 0 0.0
.text 665392 665392 0 0.0
pump-app LP_EM_CC1354P10_6 (read only) 728664 728664 0 0.0
(read/write) 167096 167096 0 0.0
.bss 89208 89208 0 0.0
.data 3448 3448 0 0.0
.rodata 85112 85112 0 0.0
.text 643284 643284 0 0.0
pump-controller-app LP_EM_CC1354P10_6 (read only) 714200 714200 0 0.0
(read/write) 167276 167276 0 0.0
.bss 89392 89392 0 0.0
.data 3444 3444 0 0.0
.rodata 80944 80944 0 0.0
.text 632988 632988 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL (read only) 567010 567010 0 0.0
(read/write) 207652 207652 0 0.0
.bss 201116 201116 0 0.0
.data 1412 1412 0 0.0
.rodata 83938 83938 0 0.0
.text 480948 480948 0 0.0
lock CC3235SF_LAUNCHXL (read only) 620354 620354 0 0.0
(read/write) 208048 208048 0 0.0
.bss 201480 201480 0 0.0
.data 1448 1448 0 0.0
.rodata 105810 105810 0 0.0
.text 512420 512420 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 561031 561031 0 0.0
.app_xip_area 451281 451281 0 0.0
.bss 64664 64664 0 0.0
.data 660 660 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 543255 543255 0 0.0
.app_xip_area 428769 428769 0 0.0
.bss 69360 69360 0 0.0
.data 700 700 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 561999 561999 0 0.0
.app_xip_area 453705 453705 0 0.0
.bss 63280 63280 0 0.0
.data 588 588 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
switch cyw930739m2evb_01 (read/write) 557471 557431 -40 -0.0
.app_xip_area 445953 445913 -40 -0.0
.bss 66400 66400 0 0.0
.data 696 696 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A+rs9116 (read/write) 1017036 1017036 0 0.0
.bss 172600 172600 0 0.0
.data 2688 2688 0 0.0
.text 841728 841728 0 0.0
BRD4187C (read/write) 1100988 1100988 0 0.0
.bss 196204 196204 0 0.0
.data 3296 3296 0 0.0
.text 901468 901468 0 0.0
lock-app BRD4161A+wf200 (read/write) 1114864 1114856 -8 -0.0
.bss 188816 188816 0 0.0
.data 2712 2712 0 0.0
.text 923316 923308 -8 -0.0
window-app BRD4187C (read/write) 1135760 1135760 0 0.0
.bss 168236 168236 0 0.0
.data 3168 3168 0 0.0
.text 964336 964336 0 0.0
esp32 all-clusters-app c3devkit (read only) 1137738 1137688 -50 -0.0
(read/write) 1671108 1671116 8 0.0
.dram0.bss 72864 72864 0 0.0
.dram0.data 12988 12988 0 0.0
.flash.rodata 241392 241400 8 0.0
.flash.text 1137738 1137688 -50 -0.0
.iram0.text 75694 75694 0 0.0
m5stack (read only) 1182639 1182667 28 0.0
(read/write) 520308 520308 0 0.0
.dram0.bss 79512 79512 0 0.0
.dram0.data 34004 34004 0 0.0
.flash.rodata 272428 272428 0 0.0
.flash.text 1177255 1177283 28 0.0
.iram0.text 123907 123907 0 0.0
k32w contact k32w0+release (read only) 605224 605224 0 0.0
(read/write) 81896 81896 0 0.0
.bss 69744 69744 0 0.0
.data 2168 2168 0 0.0
.text 604688 604688 0 0.0
k32w1+release (read only) 1024 1024 0 0.0
(read/write) 690680 690680 0 0.0
.bss 67600 67600 0 0.0
.data 2716 2716 0 0.0
.text 576888 576888 0 0.0
light k32w0+release (read only) 594912 594912 0 0.0
(read/write) 79112 79112 0 0.0
.bss 67008 67008 0 0.0
.data 2120 2120 0 0.0
.text 594376 594376 0 0.0
k32w1+release (read only) 1024 1024 0 0.0
(read/write) 782500 782500 0 0.0
.bss 77276 77276 0 0.0
.data 1928 1928 0 0.0
.text 659840 659840 0 0.0
lock k32w0+release (read only) 576328 576328 0 0.0
(read/write) 79376 79376 0 0.0
.bss 67296 67296 0 0.0
.data 2096 2096 0 0.0
.text 575792 575792 0 0.0
linux air-purifier-app debug (read only) 2526245 2526245 0 0.0
(read/write) 127240 127240 0 0.0
.bss 46944 46944 0 0.0
.data 1472 1472 0 0.0
.data.rel.ro 72824 72824 0 0.0
.dynamic 608 608 0 0.0
.got 4568 4568 0 0.0
.init 27 27 0 0.0
.init_array 800 800 0 0.0
.rodata 179336 179336 0 0.0
.text 2171429 2171429 0 0.0
all-clusters-app debug (read only) 5381249 5381249 0 0.0
(read/write) 453704 453704 0 0.0
.bss 131600 131600 0 0.0
.data 3840 3840 0 0.0
.data.rel.ro 311032 311032 0 0.0
.dynamic 624 624 0 0.0
.got 5352 5352 0 0.0
.init 27 27 0 0.0
.init_array 1232 1232 0 0.0
.rodata 309916 309916 0 0.0
.text 4663891 4663891 0 0.0
all-clusters-minimal-app debug (read only) 4953313 4953313 0 0.0
(read/write) 234720 234720 0 0.0
.bss 127856 127856 0 0.0
.data 3776 3776 0 0.0
.data.rel.ro 95960 95960 0 0.0
.dynamic 624 624 0 0.0
.got 5312 5312 0 0.0
.init 27 27 0 0.0
.init_array 1160 1160 0 0.0
.rodata 272845 272845 0 0.0
.text 4447923 4447923 0 0.0
bridge-app debug (read only) 4417025 4417025 0 0.0
(read/write) 215960 215960 0 0.0
.bss 119224 119224 0 0.0
.data 4704 4704 0 0.0
.data.rel.ro 85280 85280 0 0.0
.dynamic 624 624 0 0.0
.got 5280 5280 0 0.0
.init 27 27 0 0.0
.init_array 824 824 0 0.0
.rodata 219157 219157 0 0.0
.text 3979219 3979219 0 0.0
chip-tool debug (read only) 11686489 11686489 0 0.0
(read/write) 504112 504112 0 0.0
.bss 94200 94200 0 0.0
.data 4994 4994 0 0.0
.data.rel.ro 397680 397680 0 0.0
.dynamic 624 624 0 0.0
.got 5784 5784 0 0.0
.init 27 27 0 0.0
.init_array 784 784 0 0.0
.rodata 424585 424585 0 0.0
.text 10571875 10571875 0 0.0
chip-tool-ipv6only arm64 (read only) 11413792 11413792 0 0.0
(read/write) 572888 572888 0 0.0
.bss 103448 103448 0 0.0
.data 4288 4288 0 0.0
.data.rel.ro 436504 436504 0 0.0
.dynamic 512 512 0 0.0
.got 19816 19816 0 0.0
.init 24 24 0 0.0
.init_array 248 248 0 0.0
.rodata 344952 344952 0 0.0
.text 10200744 10200744 0 0.0
lighting-app debug+rpc+ui (read only) 5302857 5302857 0 0.0
(read/write) 225032 225032 0 0.0
.bss 119360 119360 0 0.0
.data 4416 4416 0 0.0
.data.rel.ro 93696 93696 0 0.0
.dynamic 672 672 0 0.0
.got 5896 5896 0 0.0
.init 27 27 0 0.0
.init_array 960 960 0 0.0
.rodata 340372 340372 0 0.0
.text 4717619 4717619 0 0.0
lock-app debug (read only) 4502105 4502105 0 0.0
(read/write) 203648 203648 0 0.0
.bss 113760 113760 0 0.0
.data 3648 3648 0 0.0
.data.rel.ro 79512 79512 0 0.0
.dynamic 624 624 0 0.0
.got 5232 5232 0 0.0
.init 27 27 0 0.0
.init_array 856 856 0 0.0
.rodata 247029 247029 0 0.0
.text 4044963 4044963 0 0.0
ota-provider-app debug (read only) 4166233 4166233 0 0.0
(read/write) 192728 192728 0 0.0
.bss 113632 113632 0 0.0
.data 3904 3904 0 0.0
.data.rel.ro 69296 69296 0 0.0
.dynamic 624 624 0 0.0
.got 4544 4544 0 0.0
.init 27 27 0 0.0
.init_array 720 720 0 0.0
.rodata 201301 201301 0 0.0
.text 3772979 3772979 0 0.0
ota-requestor-app debug (read only) 4255721 4255721 0 0.0
(read/write) 197040 197040 0 0.0
.bss 114656 114656 0 0.0
.data 4176 4176 0 0.0
.data.rel.ro 72288 72288 0 0.0
.dynamic 624 624 0 0.0
.got 4480 4480 0 0.0
.init 27 27 0 0.0
.init_array 776 776 0 0.0
.rodata 205141 205141 0 0.0
.text 3854227 3854227 0 0.0
shell debug (read only) 2788289 2788289 0 0.0
(read/write) 151784 151784 0 0.0
.bss 62312 62312 0 0.0
.data 768 768 0 0.0
.data.rel.ro 82920 82920 0 0.0
.dynamic 592 592 0 0.0
.got 4104 4104 0 0.0
.init 27 27 0 0.0
.init_array 1080 1080 0 0.0
.rodata 181792 181792 0 0.0
.text 2435474 2435474 0 0.0
thermostat-no-ble arm64 (read only) 4405584 4405584 0 0.0
(read/write) 244912 244912 0 0.0
.bss 122232 122232 0 0.0
.data 2784 2784 0 0.0
.data.rel.ro 102352 102352 0 0.0
.dynamic 512 512 0 0.0
.got 12008 12008 0 0.0
.init 24 24 0 0.0
.init_array 424 424 0 0.0
.rodata 162332 162332 0 0.0
.text 3902808 3902808 0 0.0
tv-app debug (read only) 5386321 5386321 0 0.0
(read/write) 349120 349120 0 0.0
.bss 244544 244544 0 0.0
.data 4992 4992 0 0.0
.data.rel.ro 92280 92280 0 0.0
.dynamic 624 624 0 0.0
.got 5520 5520 0 0.0
.init 27 27 0 0.0
.init_array 1144 1144 0 0.0
.rodata 272981 272981 0 0.0
.text 4875411 4875411 0 0.0
tv-casting-app debug (read only) 9565769 9565769 0 0.0
(read/write) 338368 338368 0 0.0
.bss 156352 156352 0 0.0
.data 2464 2464 0 0.0
.data.rel.ro 172696 172696 0 0.0
.dynamic 624 624 0 0.0
.got 5064 5064 0 0.0
.init 27 27 0 0.0
.init_array 1144 1144 0 0.0
.rodata 362824 362824 0 0.0
.text 8739091 8739091 0 0.0
mbed lock-app-release cy8cproto_062_4343w (read only) 6224 6224 0 0.0
(read/write) 2526056 2526056 0 0.0
.bss 220216 220216 0 0.0
.data 5144 5144 0 0.0
.text 1488740 1488740 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1062456 1062424 -32 -0.0
bss 129375 129375 0 0.0
rodata 104408 104408 0 0.0
text 781088 781056 -32 -0.0
nrf7002dk_nrf5340_cpuapp (read only) 4 4 0 0.0
(read/write) 1189032 1188984 -48 -0.0
bss 121585 121585 0 0.0
rodata 138476 138476 0 0.0
text 778632 778592 -40 -0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1046728 1046728 0 0.0
bss 129348 129348 0 0.0
rodata 99448 99448 0 0.0
text 770304 770304 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 (read only) 835880 835880 0 0.0
(read/write) 1743484 1743484 0 0.0
.bss 194988 194988 0 0.0
.data 2472 2472 0 0.0
.text 1537636 1537636 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 (read only) 837912 837912 0 0.0
(read/write) 1705956 1705956 0 0.0
.bss 192956 192956 0 0.0
.data 2472 2472 0 0.0
.text 1502140 1502140 0 0.0
light cy8ckit_062s2_43012 (read only) 844600 844600 0 0.0
(read/write) 1630940 1630940 0 0.0
.bss 186380 186380 0 0.0
.data 2360 2360 0 0.0
.text 1433812 1433812 0 0.0
lock cy8ckit_062s2_43012 (read only) 817480 817480 0 0.0
(read/write) 1657844 1657844 0 0.0
.bss 213476 213476 0 0.0
.data 2384 2384 0 0.0
.text 1433596 1433596 0 0.0
qpg lighting-app qpg6105+debug (read/write) 1116604 1116604 0 0.0
.bss 101216 101216 0 0.0
.data 740 740 0 0.0
.text 628980 628980 0 0.0
lock-app qpg6105+debug (read/write) 1080588 1080588 0 0.0
.bss 97512 97512 0 0.0
.data 784 784 0 0.0
.text 592968 592968 0 0.0
telink air-quality-sensor-app tlsr9528a_retention (read only) 51774 51774 0 0.0
(read/write) 821286 821286 0 0.0
bss 55064 55064 0 0.0
text 613792 613792 0 0.0
all-clusters-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 1080352 1080296 -56 -0.0
bss 100388 100388 0 0.0
text 762374 762314 -60 -0.0
all-clusters-minimal-app tlsr9528a (read only) 4 4 0 0.0
(read/write) 1083944 1083944 0 0.0
bss 109764 109764 0 0.0
text 753424 753424 0 0.0
bridge-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 934576 934576 0 0.0
bss 94272 94272 0 0.0
text 646844 646844 0 0.0
contact-sensor-app tlsr9528a_retention (read only) 51774 51774 0 0.0
(read/write) 821522 821522 0 0.0
bss 55108 55108 0 0.0
text 614162 614162 0 0.0
light-switch-app-ota-shell-factory-data tlsr9528a (read only) 4 4 0 0.0
(read/write) 978672 978608 -64 -0.0
bss 79092 79092 0 0.0
text 694312 694252 -60 -0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 1092924 1092924 0 0.0
bss 99836 99836 0 0.0
text 769736 769736 0 0.0
lock-app-dfu tlsr9528a (read only) 4 4 0 0.0
(read/write) 965240 965240 0 0.0
bss 97356 97356 0 0.0
text 647928 647928 0 0.0
ota-requestor-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 948252 948252 0 0.0
bss 92380 92380 0 0.0
text 662952 662952 0 0.0
pump-app tlsr9528a (read only) 4 4 0 0.0
(read/write) 880320 880320 0 0.0
bss 69084 69084 0 0.0
text 622172 622172 0 0.0
pump-controller-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 820932 820932 0 0.0
bss 57320 57320 0 0.0
text 589048 589048 0 0.0
shell tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 705600 705600 0 0.0
bss 73588 73588 0 0.0
text 462094 462094 0 0.0
smoke_co_alarm-app tlsr9528a_retention (read only) 51774 51774 0 0.0
(read/write) 823258 823258 0 0.0
bss 55244 55244 0 0.0
text 616906 616906 0 0.0
temperature-measurement-app-mars-ota tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 878025 878025 0 0.0
bss 60796 60796 0 0.0
text 630788 630788 0 0.0
thermostat tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 845304 845304 0 0.0
bss 57616 57616 0 0.0
text 607514 607514 0 0.0
window-covering tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 839580 839580 0 0.0
bss 57968 57968 0 0.0
text 601548 601548 0 0.0

src/lib/support/TimeUtils.cpp Show resolved Hide resolved
@andy31415 andy31415 merged commit 93be827 into project-chip:master Dec 15, 2023
57 checks passed
thivya-amazon pushed a commit to thivya-amazon/connectedhomeip that referenced this pull request Dec 18, 2023
…ct-chip#31021)

* Clean-up time conversions locations

- Test conversions in Time Sync cluster were not in a unit-testable
  location.
- TestTimeUtils was not using nl-unit-test
- Time sync cluster server build rules were missing dependencies
- Documentation for many time conversion methods was not accurate
- `secondsToMilliseconds` did not match coding style
- Cleaned-up cut and paste errors in some adjacent tests.

Issue project-chip#30990

Testing done:
- Unit tests and integration tests still pass.
- Started tests for edge conditions (which found project-chip#30990)

* Restyled by clang-format

* Add backwards compatibility

---------

Co-authored-by: [email protected] <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants