From 48ae0addae6aa24d6d3e841adabb071be020c243 Mon Sep 17 00:00:00 2001 From: NikhitaR-IFX Date: Tue, 11 Jul 2023 18:58:26 +0530 Subject: [PATCH] tests/psoc6: Making tests to work right. Signed-off-by: NikhitaR-IFX --- tests/psoc6/adc.py | 15 ++++++--------- tests/psoc6/adc.py.exp | 5 ++--- tests/psoc6/adcblock.py.exp | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/tests/psoc6/adc.py b/tests/psoc6/adc.py index a78e11875ec85..46e4c5ab7c4a1 100644 --- a/tests/psoc6/adc.py +++ b/tests/psoc6/adc.py @@ -7,17 +7,14 @@ adc_pin = Pin("P10_0") adc_wrong_pin = Pin("P13_7") -adc = ADC(adc_pin) -print(adc) - -adc = ADC(adc_pin, sample_ns=1200) -print(adc) - -print(adc.read_uv() > 0) -print(adc.read_u16() > 0) - # Exceptions should be raised try: adc = ADC(adc_wrong_pin) except: print("Invalid ADC Pin") + +adc = ADC(adc_pin, sample_ns=1000) +print(adc) + +print(adc.read_u16() > 0) +print(adc.read_uv() > 0) diff --git a/tests/psoc6/adc.py.exp b/tests/psoc6/adc.py.exp index a4d8ce296edb3..7871f4ccc6022 100644 --- a/tests/psoc6/adc.py.exp +++ b/tests/psoc6/adc.py.exp @@ -1,5 +1,4 @@ +Invalid ADC Pin - -False True -Invalid ADC Pin +True diff --git a/tests/psoc6/adcblock.py.exp b/tests/psoc6/adcblock.py.exp index 1d474b83f7aba..dcb8531e876d4 100644 --- a/tests/psoc6/adcblock.py.exp +++ b/tests/psoc6/adcblock.py.exp @@ -1,4 +1,4 @@ TypeError: Specified ADC id not supported. Currently only block 0 is configured! TypeError: Invalid bits. Current ADC configuration supports only 12 bits resolution! TypeError: Wrong pin specified for the mentioned channel -False +True