Re: [PATCH V4 7/8] libgpiod: Add rust tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 27-07-22, 10:58, Kent Gibson wrote:
> > diff --git a/bindings/rust/tests/line_request.rs b/bindings/rust/tests/line_request.rs
> > +        #[test]
> > +        fn set_bias() {
> > +            let offsets = [3];
> > +            let mut config = TestConfig::new(NGPIO).unwrap();
> > +            config.rconfig(Some(&offsets));
> > +            config.lconfig(Some(Direction::Input), None, None, None, Some(Bias::PullUp));
> > +            config.request_lines().unwrap();
> > +            config.request();
> > +
> > +            // Set single value
> > +            assert_eq!(config.sim().val(3).unwrap(), GPIOSIM_VALUE_ACTIVE);
> > +        }
> > +    }
> 
> Test reconfigure() failure modes.

What are we specifically looking to test here ? I am not sure I understood which
failures modes I should target.

> Test you can reconfigure all values for all attributes (not all values
> for debounce obviously - just the flags).

This I have done now, with request.reconfigure_lines().

> Similarly for request_lines (ideally in chip.rs)

Isn't this same as the above one? I am not sure again what I should test here.

I have pushed my current changes here, if it helps:

git@xxxxxxxxxx:vireshk/libgpiod.git master

-- 
viresh



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux