From: Kent Gibson <warthog618@gmail.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Viresh Kumar <viresh.kumar@linaro.org>,
linux-gpio@vger.kernel.org
Subject: Re: [libgpiod v2][PATCH v2] bindings: cxx: tests: use the builder pattern for the GPIO simulator
Date: Thu, 15 Sep 2022 19:01:48 +0800 [thread overview]
Message-ID: <YyMGHEbFTs02HguJ@sol> (raw)
In-Reply-To: <YyL4AwaJIO9kim9s@sol>
On Thu, Sep 15, 2022 at 06:01:39PM +0800, Kent Gibson wrote:
> On Thu, Sep 15, 2022 at 10:47:23AM +0200, Bartosz Golaszewski wrote:
> > In order to make the interface more elegant use the Rust-like builder
> > pattern for the GPIO simulator class.
> >
> > Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
> > ---
>
> > - ::gpiosim::chip sim({{ property::NUM_LINES, 8 }, { property::LABEL, "foobar" }});
> > + auto sim = make_sim()
> > + .set_num_lines(8)
> > + .set_label("foobar")
> > + .build();
> > +
>
> You do this a few times, so perhaps add a helper to create a simple
> simulator with a given a number of lines?
>
> (I called the equivalent in my tests a Simpleton, borrowing LinusW's
> practice of naming things after yourself.
> Not that I'm suggesting you use that name.)
Good grief - I meant LinusT. See what I mean?
Cheers,
Kent.
next prev parent reply other threads:[~2022-09-15 11:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 8:47 [libgpiod v2][PATCH v2] bindings: cxx: tests: use the builder pattern for the GPIO simulator Bartosz Golaszewski
2022-09-15 10:01 ` Kent Gibson
2022-09-15 11:01 ` Kent Gibson [this message]
2022-09-16 7:10 ` Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YyMGHEbFTs02HguJ@sol \
--to=warthog618@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox