Re: [PATCH v2] kunit: Device wrappers should also manage driver name

2024-08-20 Thread Ivan Orlov
onst struct device_driver *driver = to_kunit_device(dev)->driver; > > kunit_release_action(test, device_unregister_wrapper, dev); > - if (driver) > + if (driver) { > + const char *driver_name = driver->name; Also a minor nit (and I haven't found anything in the kernel code style regarding it), but probably the declaration should be moved into beginning of the function (as it is done in the rest of the file) Thanks! -- Kind regards, Ivan Orlov

[PATCH v5 4/4] selftests: ALSA: Cover userspace-driven timers with test

2024-08-13 Thread Ivan Orlov
ation showing userspace-driven ALSA timers API. Also, the timer test includes a test case which tries to create a timer with invalid resolution (=0), and NULL as a timer info structure. Signed-off-by: Ivan Orlov --- V1 -> V2: - Return NULL in the pthreaded function (ticking_func) - Process TIMER_

[PATCH v5 3/4] ALSA: timer: Introduce virtual userspace-driven timers

2024-08-13 Thread Ivan Orlov
ticks available for the timer is 1 for the sake of simplicity of the userspace API. 'start', 'stop', 'open' and 'close' callbacks for the userspace-driven timers are empty since we don't really do any hardware initialization here. Suggested-by: Axel Holzing

[PATCH v5 2/4] Docs/sound: Add documentation for userspace-driven ALSA timers

2024-08-13 Thread Ivan Orlov
the timers can be used as a timer sources for snd-aloop module Suggested-by: Axel Holzinger Signed-off-by: Ivan Orlov --- V1 -> V2: - No changes V2 -> V3: - No changes V3 -> V4: - Update the userspace-driver ALSA timer structure name and fields in correspondence with the latest changes (r

[PATCH v5 1/4] ALSA: aloop: Allow using global timers

2024-08-13 Thread Ivan Orlov
Allow using global timers as a timer source when card id is equal to -1 in the timer_source parameter. Signed-off-by: Ivan Orlov --- V1 -> V2: - No changes V2 -> V3: - No changes V3 -> V4: - No changes V4 -> V5: - No changes sound/drivers/aloop.c | 2 ++ 1 file changed, 2 inserti

[PATCH v5 0/4] Introduce userspace-driven ALSA timers

2024-08-13 Thread Ivan Orlov
an error code. Please, find the patch-specific changelog in the following patches. Ivan Orlov (4): ALSA: aloop: Allow using global timers Docs/sound: Add documentation for userspace-driven ALSA timers ALSA: timer: Introduce virtual userspace-driven timers selftests: ALSA: Cover userspace-driven

Re: [PATCH v4 3/4] ALSA: timer: Introduce virtual userspace-driven timers

2024-08-13 Thread Ivan Orlov
On 8/13/24 07:02, Takashi Iwai wrote: On Sun, 11 Aug 2024 22:23:36 +0200, Ivan Orlov wrote: +static int snd_utimer_ioctl_create(struct file *file, + struct snd_timer_uinfo __user *_utimer_info) +{ + struct snd_utimer *utimer; + struct snd_timer_uinfo

[PATCH v4 4/4] selftests: ALSA: Cover userspace-driven timers with test

2024-08-11 Thread Ivan Orlov
ation showing userspace-driven ALSA timers API. Also, the timer test includes a test case which tries to create a timer with invalid resolution (=0), and NULL as a timer info structure. Signed-off-by: Ivan Orlov --- V1 -> V2: - Return NULL in the pthreaded function (ticking_func) - Process TIMER_

[PATCH v4 3/4] ALSA: timer: Introduce virtual userspace-driven timers

2024-08-11 Thread Ivan Orlov
ke of simplicity of the userspace API. 'start', 'stop', 'open' and 'close' callbacks for the userspace-driven timers are empty since we don't really do any hardware initialization here. Suggested-by: Axel Holzinger Signed-off-by: Ivan Orlov --- V1

[PATCH v4 1/4] ALSA: aloop: Allow using global timers

2024-08-11 Thread Ivan Orlov
Allow using global timers as a timer source when card id is equal to -1 in the timer_source parameter. Signed-off-by: Ivan Orlov --- V1 -> V2: - No changes V2 -> V3: - No changes V3 -> V4: - No changes sound/drivers/aloop.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/soun

[PATCH v4 2/4] Docs/sound: Add documentation for userspace-driven ALSA timers

2024-08-11 Thread Ivan Orlov
the timers can be used as a timer sources for snd-aloop module Suggested-by: Axel Holzinger Signed-off-by: Ivan Orlov --- V1 -> V2: - No changes V2 -> V3: - No changes V3 -> V4: - Update the userspace-driver ALSA timer structure name and fields in correspondence with the latest changes (r

[PATCH v4 0/4] Introduce userspace-driven ALSA timers

2024-08-11 Thread Ivan Orlov
comments from Jaroslav Kysela and Mark Brown Please, find the patch-specific changelog in the following patches. Ivan Orlov (4): ALSA: aloop: Allow using global timers Docs/sound: Add documentation for userspace-driven ALSA timers ALSA: timer: Introduce virtual userspace-driven timers self

Re: [PATCH v3 4/4] selftests: ALSA: Cover userspace-driven timers with test

2024-08-06 Thread Ivan Orlov
On 8/6/24 14:04, Mark Brown wrote: On Tue, Aug 06, 2024 at 01:52:43PM +0100, Ivan Orlov wrote: -TEST_GEN_PROGS := mixer-test pcm-test test-pcmtest-driver +TEST_GEN_PROGS := mixer-test pcm-test utimer-test test-pcmtest-driver global-timer This is adding the timer timer tests as standard

Re: [PATCH v3 3/4] ALSA: timer: Introduce virtual userspace-driven timers

2024-08-06 Thread Ivan Orlov
On 8/6/24 14:11, Jaroslav Kysela wrote: On 06. 08. 24 14:52, Ivan Orlov wrote: Implement two ioctl calls in order to support virtual userspace-driven ALSA timers. ... Hi Jaroslav, +struct snd_utimer_info { +    /* + * To pretend being a normal timer, we need to know the frame rate

[PATCH v3 4/4] selftests: ALSA: Cover userspace-driven timers with test

2024-08-06 Thread Ivan Orlov
ation showing userspace-driven ALSA timers API. Signed-off-by: Ivan Orlov --- V1 -> V2: - Return NULL in the pthreaded function (ticking_func) - Process TIMER_NO_EVENT enum in the timer app output processing loop V2 -> V3: - Add new test case to cover invalid period sizes and frame rates for th

[PATCH v3 3/4] ALSA: timer: Introduce virtual userspace-driven timers

2024-08-06 Thread Ivan Orlov
ke of simplification of the userspace API. 'start', 'stop', 'open' and 'close' callbacks for the userspace-driven timers are empty since we don't really do any hardware initialization here. Suggested-by: Axel Holzinger Signed-off-by: Ivan Orlov --- V1

[PATCH v3 2/4] Docs/sound: Add documentation for userspace-driven ALSA timers

2024-08-06 Thread Ivan Orlov
the timers can be used as a timer sources for snd-aloop module Suggested-by: Axel Holzinger Signed-off-by: Ivan Orlov --- V1 -> V2: - No changes V2 -> V3: - No changes Documentation/sound/index.rst | 1 + Documentation/sound/utimers.rst | 120 2 files c

[PATCH v3 1/4] ALSA: aloop: Allow using global timers

2024-08-06 Thread Ivan Orlov
Allow using global timers as a timer source when card id is equal to -1 in the timer_source parameter. Signed-off-by: Ivan Orlov --- V1 -> V2: - No changes V2 -> V3: - No changes sound/drivers/aloop.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/drivers/aloop.c b/sound/d

[PATCH v3 0/4] Introduce userspace-driven ALSA timers

2024-08-06 Thread Ivan Orlov
patch-specific changelog in the following patches. Ivan Orlov (4): ALSA: aloop: Allow using global timers Docs/sound: Add documentation for userspace-driven ALSA timers ALSA: timer: Introduce virtual userspace-driven timers selftests: ALSA: Cover userspace-driven timers with test

Re: [PATCH v2 3/4] ALSA: timer: Introduce virtual userspace-driven timers

2024-07-29 Thread Ivan Orlov
On 7/29/24 15:02, Takashi Iwai wrote: On Mon, 29 Jul 2024 10:59:04 +0200, Ivan Orlov wrote: --- a/include/uapi/sound/asound.h +++ b/include/uapi/sound/asound.h (snip) Hi Takashi, Thank you so much for the review. +/* + * This structure describes the userspace-driven timer. Such timers are

[PATCH v2 4/4] selftests: ALSA: Cover userspace-driven timers with test

2024-07-29 Thread Ivan Orlov
ation showing userspace-driven ALSA timers API. Signed-off-by: Ivan Orlov --- - Return NULL in the pthreaded function (ticking_func) - Process TIMER_NO_EVENT enum in the timer app output processing loop tools/testing/selftests/alsa/Makefile | 2 +- tools/testing/selftests/alsa/global-timer.c

[PATCH v2 3/4] ALSA: timer: Introduce virtual userspace-driven timers

2024-07-29 Thread Ivan Orlov
ke of simplification of the userspace API. 'start', 'stop', 'open' and 'close' callbacks for the userspace-driven timers are empty since we don't really do any hardware initialization here. Suggested-by: Axel Holzinger Signed-off-by: Ivan Orlov --- V1

[PATCH v2 2/4] Docs/sound: Add documentation for userspace-driven ALSA timers

2024-07-29 Thread Ivan Orlov
the timers can be used as a timer sources for snd-aloop module Suggested-by: Axel Holzinger Signed-off-by: Ivan Orlov --- V1 -> V2: - No changes Documentation/sound/index.rst | 1 + Documentation/sound/utimers.rst | 120 2 files changed, 121 inserti

[PATCH v2 1/4] ALSA: aloop: Allow using global timers

2024-07-29 Thread Ivan Orlov
Allow using global timers as a timer source when card id is equal to -1 in the timer_source parameter. Signed-off-by: Ivan Orlov --- V1 -> V2: - No changes sound/drivers/aloop.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c in

[PATCH v2 0/4] Introduce userspace-driven ALSA timers

2024-07-29 Thread Ivan Orlov
eries also updates the snd-aloop module so the global timers can be used as a timer_source for it (it allows using userspace-driven timers as timer source). V2 of this patch series fixes some problems found by Christophe Jaillet . Please, find the patch-specific changelog in the following patches. Iva

Re: [PATCH 3/4] ALSA: timer: Introduce virtual userspace-driven timers

2024-07-28 Thread Ivan Orlov
rnel has a generic ID allocator and now I finally know it does :) ). Thank you! -- Kind regards, Ivan Orlov

Re: [PATCH 3/4] ALSA: timer: Introduce virtual userspace-driven timers

2024-07-28 Thread Ivan Orlov
On 7/28/24 10:30, Christophe JAILLET wrote: Le 28/07/2024 à 10:51, Ivan Orlov a écrit : On 7/28/24 07:59, Christophe JAILLET wrote: Le 26/07/2024 à 09:47, Ivan Orlov a écrit : Implement two ioctl calls in order to support virtual userspace-driven ALSA timers. The first ioctl is

Re: [PATCH 3/4] ALSA: timer: Introduce virtual userspace-driven timers

2024-07-28 Thread Ivan Orlov
On 7/28/24 07:59, Christophe JAILLET wrote: Le 26/07/2024 à 09:47, Ivan Orlov a écrit : Implement two ioctl calls in order to support virtual userspace-driven ALSA timers. The first ioctl is SNDRV_TIMER_IOCTL_CREATE, which gets the snd_utimer_info struct as a parameter and returns a file

Re: [PATCH 3/4] ALSA: timer: Introduce virtual userspace-driven timers

2024-07-28 Thread Ivan Orlov
mall, we could even save a few bytes of memory. Wow, cool, I haven't heard of kasprintf but now I'll use it here in V2. Thanks! -- Kind regards, Ivan Orlov

[PATCH 4/4] selftests: ALSA: Cover userspace-driven timers with test

2024-07-26 Thread Ivan Orlov
ation showing userspace-driven ALSA timers API. Signed-off-by: Ivan Orlov --- tools/testing/selftests/alsa/Makefile | 2 +- tools/testing/selftests/alsa/global-timer.c | 87 + tools/testing/selftests/alsa/utimer-test.c | 133 3 files changed, 221 insertions(

[PATCH 3/4] ALSA: timer: Introduce virtual userspace-driven timers

2024-07-26 Thread Ivan Orlov
ke of simplification of the userspace API. 'start', 'stop', 'open' and 'close' callbacks for the userspace-driven timers are empty since we don't really do any hardware initialization here. Suggested-by: Axel Holzinger Signed-off-by: Ivan Orlov --- include

[PATCH 2/4] Docs/sound: Add documentation for userspace-driven ALSA timers

2024-07-26 Thread Ivan Orlov
the timers can be used as a timer sources for snd-aloop module Suggested-by: Axel Holzinger Signed-off-by: Ivan Orlov --- Documentation/sound/index.rst | 1 + Documentation/sound/utimers.rst | 120 2 files changed, 121 insertions(+) create mode 100644

[PATCH 1/4] ALSA: aloop: Allow using global timers

2024-07-26 Thread Ivan Orlov
Allow using global timers as a timer source when card id is equal to -1 in the timer_source parameter. Signed-off-by: Ivan Orlov --- sound/drivers/aloop.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c index d6dd4b8c750a..a1e5e7fe9c72 100644

[PATCH 0/4] Introduce userspace-driven ALSA timers

2024-07-26 Thread Ivan Orlov
eries also updates the snd-aloop module so the global timers can be used as a timer_source for it (it allows using userspace-driven timers as timer source). Ivan Orlov (4): ALSA: aloop: Allow using global timers Docs/sound: Add documentation for userspace-driven ALSA timers ALSA: timer: Introduc

Re: [PATCH v2 3/5] kunit: string-stream-test: Make it a separate module

2024-06-27 Thread Ivan Orlov
On 6/21/24 22:07, 'Rae Moar' via KUnit Development wrote: On Tue, Jun 18, 2024 at 1:03 PM Ivan Orlov wrote: Currently, the only way to build string-stream-test is by setting CONFIG_KUNIT_TEST=y. However, CONFIG_KUNIT_TEST is a config option for a different test (`kunit-test.c`). I

Re: [PATCH v2 3/5] kunit: string-stream-test: Make it a separate module

2024-06-27 Thread Ivan Orlov
On 6/19/24 19:09, Jeff Johnson wrote: On 6/18/24 10:03, Ivan Orlov wrote: Currently, the only way to build string-stream-test is by setting CONFIG_KUNIT_TEST=y. However, CONFIG_KUNIT_TEST is a config option for a different test (`kunit-test.c`). Introduce a new Kconfig entry in order to be

Re: [PATCH v2 5/5] kunit: Merge assertion test into kunit-test.c

2024-06-27 Thread Ivan Orlov
On 6/21/24 22:38, Rae Moar wrote: On Tue, Jun 18, 2024 at 1:03 PM Ivan Orlov wrote: Since assert_test covers the part of the KUnit core (the assertion formatting functions), I believe it would be better to have it merged into kunit-test (as it is done for other tests for the KUnit core

[PATCH v2 5/5] kunit: Merge assertion test into kunit-test.c

2024-06-18 Thread Ivan Orlov
Since assert_test covers the part of the KUnit core (the assertion formatting functions), I believe it would be better to have it merged into kunit-test (as it is done for other tests for the KUnit core). Signed-off-by: Ivan Orlov --- V1 -> V2: - Update considering the changes in the previ

[PATCH v2 4/5] kunit: assert_test: Prepare to be merged into kunit-test.c

2024-06-18 Thread Ivan Orlov
n the tests (and cover them as well). Signed-off-by: Ivan Orlov --- V1 -> V2: - Besides exporting the non-static functions from assert.c into the KUnit namespace, rename some of them as well (add kunit_assert_ prefix to make their names less ambiguous). include/kunit/assert.h | 4 +

[PATCH v2 3/5] kunit: string-stream-test: Make it a separate module

2024-06-18 Thread Ivan Orlov
namespace in the test so we could have string-stream functions accessible. Reviewed-by: David Gow Signed-off-by: Ivan Orlov --- V1 -> V2: - No changes lib/kunit/Kconfig | 8 lib/kunit/Makefile | 2 +- lib/kunit/string-stream-test.c | 2 ++ 3 files changed,

[PATCH v2 2/5] kunit: kunit-test: Remove stub for log tests

2024-06-18 Thread Ivan Orlov
-by: Ivan Orlov --- V1 -> V2: - No changes lib/kunit/kunit-test.c | 18 +- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/lib/kunit/kunit-test.c b/lib/kunit/kunit-test.c index 37e02be1e710..d86f7cb3b3e4 100644 --- a/lib/kunit/kunit-test.c +++ b/lib/kunit/kunit-tes

[PATCH v2 1/5] kunit: string-stream: export non-static functions

2024-06-18 Thread Ivan Orlov
Export non-static functions from the string-stream.c file into the KUnit namespace in order to be able to access them from the KUnit core tests (when they are loaded as modules). Reviewed-by: David Gow Signed-off-by: Ivan Orlov --- V1 -> V2: - No changes lib/kunit/string-stream.c |

[PATCH v2 0/5] Reorganize string-stream and assert tests

2024-06-18 Thread Ivan Orlov
ged into kunit-test.c - Also, David Gow suggested merging 4th and 5th patches together, but since now the 4th patch does more than it used to do, I send it separately Ivan Orlov (5): kunit: string-stream: export non-static functions kunit: kunit-test: Remove stub for log tests kunit: str

Re: [PATCH 5/5] kunit: Merge assertion test into kunit-test.c

2024-06-11 Thread Ivan Orlov
On 6/8/24 10:20, David Gow wrote: On Tue, 4 Jun 2024 at 20:32, Ivan Orlov wrote: Since assert_test covers the part of the KUnit core (the assertion formatting functions), I believe it would be better to have it merged into kunit-test (as it is done for other tests for the KUnit core). Signed

Re: [PATCH 4/5] kunit: assert: export non-static functions

2024-06-09 Thread Ivan Orlov
uf1[i]); } } +EXPORT_SYMBOL_IF_KUNIT(kunit_assert_hexdump); void kunit_mem_assert_format(const struct kunit_assert *assert, const struct va_format *message, -- 2.34.1 -- Kind regards, Ivan Orlov

Re: [PATCH 1/5] kunit: string-stream: export non-static functions

2024-06-09 Thread Ivan Orlov
On 6/8/24 10:20, David Gow wrote: On Tue, 4 Jun 2024 at 20:32, Ivan Orlov wrote: Export non-static functions from the string-stream.c file into the KUnit namespace in order to be able to access them from the KUnit core tests (when they are loaded as modules). Signed-off-by: Ivan Orlov

[PATCH 5/5] kunit: Merge assertion test into kunit-test.c

2024-06-04 Thread Ivan Orlov
Since assert_test covers the part of the KUnit core (the assertion formatting functions), I believe it would be better to have it merged into kunit-test (as it is done for other tests for the KUnit core). Signed-off-by: Ivan Orlov --- lib/kunit/Makefile | 5 - lib/kunit/assert_test.c

[PATCH 4/5] kunit: assert: export non-static functions

2024-06-04 Thread Ivan Orlov
Export non-static functions from the assert.c file into the KUnit namespace in order to be able to access them from the tests if they are compiled as modules. Signed-off-by: Ivan Orlov --- lib/kunit/assert.c | 4 1 file changed, 4 insertions(+) diff --git a/lib/kunit/assert.c b/lib/kunit

[PATCH 3/5] kunit: string-stream-test: Make it a separate module

2024-06-04 Thread Ivan Orlov
namespace in the test so we could have string-stream functions accessible. Signed-off-by: Ivan Orlov --- lib/kunit/Kconfig | 8 lib/kunit/Makefile | 2 +- lib/kunit/string-stream-test.c | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib

[PATCH 2/5] kunit: kunit-test: Remove stub for log tests

2024-06-04 Thread Ivan Orlov
Since now we are exporting string-stream functions into the KUnit namespace, we can safely use them in kunit-test when it is compiled as a module as well. So, remove the stubs used when kunit-test is compiled as a module. Import the KUnit namespace in the test. Signed-off-by: Ivan Orlov --- lib

[PATCH 1/5] kunit: string-stream: export non-static functions

2024-06-04 Thread Ivan Orlov
Export non-static functions from the string-stream.c file into the KUnit namespace in order to be able to access them from the KUnit core tests (when they are loaded as modules). Signed-off-by: Ivan Orlov --- lib/kunit/string-stream.c | 12 +++- 1 file changed, 11 insertions(+), 1

[PATCH 0/5] Reorganize string-stream and assert tests

2024-06-04 Thread Ivan Orlov
patch series merges the assertion test suite into the kunit-test, since assert.c (and all of the assertion formatting functions in it) is a part of the KUnit core. Ivan Orlov (5): kunit: string-stream: export non-static functions kunit: kunit-test: Remove stub for log tests kunit: string

Re: [PATCH v5] kunit: Cover 'assert.c' with tests

2024-05-29 Thread Ivan Orlov
On 5/20/24 22:12, Rae Moar wrote: On Thu, May 16, 2024 at 11:17 PM Ivan Orlov wrote: There are multiple assertion formatting functions in the `assert.c` file, which are not covered with tests yet. Implement the KUnit test for these functions. The test consists of 11 test cases for the

Re: [PATCH 2/2] usercopy: Convert test_user_copy to KUnit test

2024-05-29 Thread Ivan Orlov
MAP_ANONYMOUS | MAP_PRIVATE, 0); + KUNIT_ASSERT_LT_MSG(test, user_addr, (unsigned long)TASK_SIZE, + "Failed to allocate user memory"); + priv->umem = (char __user *)user_addr; -static void __exit test_user_copy_exit(void) -{ - pr_info("unloaded.\n"); + return 0; } -module_exit(test_user_copy_exit); - +static struct kunit_case usercopy_test_cases[] = { + KUNIT_CASE(usercopy_test_valid), + KUNIT_CASE(usercopy_test_invalid), + KUNIT_CASE(usercopy_test_check_nonzero_user), + KUNIT_CASE(usercopy_test_copy_struct_from_user), + {} +}; + +static struct kunit_suite usercopy_test_suite = { + .name = "usercopy", + .init = usercopy_test_init, + .test_cases = usercopy_test_cases, +}; + +kunit_test_suites(&usercopy_test_suite); MODULE_AUTHOR("Kees Cook "); MODULE_LICENSE("GPL"); Other than that, Tested-by: Ivan Orlov -- Kind regards, Ivan Orlov

[PATCH v5] kunit: Cover 'assert.c' with tests

2024-05-16 Thread Ivan Orlov
sert.c` as 'VISIBLE_IF_KUNIT' and conditionally export them with EXPORT_SYMBOL_IF_KUNIT. Add the corresponding definitions to `assert.h`. Build the assert test when CONFIG_KUNIT_TEST is enabled, similar to how it is done for the string stream test. Signed-off-by: Ivan Orlov --- V1 -> V2: -

Re: [PATCH v4] kunit: Cover 'assert.c' with tests

2024-05-16 Thread Ivan Orlov
On 5/16/24 19:57, Rae Moar wrote: On Wed, May 15, 2024 at 10:20 AM Ivan Orlov wrote: There are multiple assertion formatting functions in the `assert.c` file, which are not covered with tests yet. Implement the KUnit test for these functions. The test consists of 11 test cases for the

[PATCH v4] kunit: Cover 'assert.c' with tests

2024-05-15 Thread Ivan Orlov
sert.c` as 'VISIBLE_IF_KUNIT' and conditionally export them with EXPORT_SYMBOL_IF_KUNIT. Add the corresponding definitions to `assert.h`. Build the assert test when CONFIG_KUNIT_TEST is enabled, similar to how it is done for the string stream test. Signed-off-by: Ivan Orlov --- V1 -> V2: -

Re: [PATCH v3] kunit: Cover 'assert.c' with tests

2024-05-14 Thread Ivan Orlov
On 5/14/24 20:55, 'Rae Moar' via KUnit Development wrote: Thank you once again, -- Kind regards, Ivan Orlov Hello! This sounds like a great approach! Happy to review the new patch series when it comes in. Thanks, Rae Awesome, thank you! -- Kind regards, Ivan Orlov

Re: [PATCH v3] kunit: Cover 'assert.c' with tests

2024-05-14 Thread Ivan Orlov
On 5/14/24 01:17, Rae Moar wrote: On Thu, May 9, 2024 at 5:05 AM Ivan Orlov wrote: There are multiple assertion formatting functions in the `assert.c` file, which are not covered with tests yet. Implement the KUnit test for these functions. The test consists of 11 test cases for the

[PATCH] KVM: selftests: Check API version when creating VM

2024-05-09 Thread Ivan Orlov
version of the KVM API before creating a VM. Signed-off-by: Ivan Orlov --- .../testing/selftests/kvm/include/kvm_util_base.h | 2 ++ tools/testing/selftests/kvm/lib/kvm_util.c | 14 ++ 2 files changed, 16 insertions(+) diff --git a/tools/testing/selftests/kvm/include

[PATCH v3] kunit: Cover 'assert.c' with tests

2024-05-09 Thread Ivan Orlov
sert.c` as 'VISIBLE_IF_KUNIT' and conditionally export them with EXPORT_SYMBOL_IF_KUNIT. Add the corresponding definitions to `assert.h`. Build the assert test when CONFIG_KUNIT_TEST is enabled, similar to how it is done for the string stream test. Signed-off-by: Ivan Orlov --- V1 -> V2: -

[PATCH v2] kunit: Cover 'assert.c' with tests

2024-05-08 Thread Ivan Orlov
sert.c` as 'VISIBLE_IF_KUNIT' and conditionally export them with EXPORT_SYMBOL_IF_KUNIT. Add the corresponding definitions to `assert.h`. Build the assert test when CONFIG_KUNIT_TEST is enabled, similar to how it is done for the string stream test. Signed-off-by: Ivan Orlov --- V1 -> V2: -

Re: [PATCH] kunit: Cover 'assert.c' with tests

2024-05-04 Thread Ivan Orlov
On 5/3/24 12:10, Ivan Orlov wrote: On 5/2/24 00:20, Rae Moar wrote: On Sat, Apr 27, 2024 at 6:04 PM Ivan Orlov wrote: There are multiple assertion formatting functions in the `assert.c` file, which are not covered with tests yet. Implement the KUnit test for these functions. The test

Re: [PATCH] kunit: Cover 'assert.c' with tests

2024-05-03 Thread Ivan Orlov
On 5/3/24 12:10, Ivan Orlov wrote: On 5/2/24 00:20, Rae Moar wrote: On Sat, Apr 27, 2024 at 6:04 PM Ivan Orlov wrote: There are multiple assertion formatting functions in the `assert.c` file, which are not covered with tests yet. Implement the KUnit test for these functions. The test

Re: [PATCH] kunit: Cover 'assert.c' with tests

2024-05-03 Thread Ivan Orlov
On 5/2/24 00:20, Rae Moar wrote: On Sat, Apr 27, 2024 at 6:04 PM Ivan Orlov wrote: There are multiple assertion formatting functions in the `assert.c` file, which are not covered with tests yet. Implement the KUnit test for these functions. The test consists of 11 test cases for the

Re: [PATCH] kunit: Cover 'assert.c' with tests

2024-04-30 Thread Ivan Orlov
On 4/29/24 22:26, Rae Moar wrote: On Sat, Apr 27, 2024 at 6:04 PM Ivan Orlov wrote: There are multiple assertion formatting functions in the `assert.c` file, which are not covered with tests yet. Implement the KUnit test for these functions. The test consists of 11 test cases for the

[PATCH] kunit: Cover 'assert.c' with tests

2024-04-27 Thread Ivan Orlov
rt_format' 10) 'kunit_assert_hexdump' 11) 'kunit_mem_assert_format' The test aims at maximizing the branch coverage for the assertion formatting functions. As you can see, it covers some of the static helper functions as well, so we have to import the test source in

[PATCH] kunit: string-stream-test: use KUNIT_DEFINE_ACTION_WRAPPER

2024-04-23 Thread Ivan Orlov
Use KUNIT_DEFINE_ACTION_WRAPPER macro to define the 'kfree' and 'string_stream_destroy' wrappers for kunit_add_action. Signed-off-by: Ivan Orlov --- lib/kunit/string-stream-test.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/kunit/st

Re: [PATCH] selftests: ALSA: fix warnings in 'test-pcmtest-driver'

2023-09-16 Thread Ivan Orlov
On 9/16/23 22:25, Javier Carrasco wrote: Removing an unused variable is actually removing a blank line from a logical point of view. Is an extra patch not overkill considering that it cannot affect the code behavior? Well, no, it is not, as the line is not blank (nothing except removing a blan

Re: [PATCH] selftests: ALSA: fix warnings in 'test-pcmtest-driver'

2023-09-16 Thread Ivan Orlov
is test could be enhanced in lots of ways, so I look forward to seeing new patches related to it from you :) -- Kind regards, Ivan Orlov