You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "pkarashchenko (via GitHub)" <gi...@apache.org> on 2023/08/28 14:49:31 UTC

[GitHub] [nuttx-apps] pkarashchenko commented on a diff in pull request #2010: regulator:add testcase for regualtor register

pkarashchenko commented on code in PR #2010:
URL: https://github.com/apache/nuttx-apps/pull/2010#discussion_r1307529825


##########
testing/drivertest/drivertest_regulator.c:
##########
@@ -194,6 +194,22 @@ static int test_regulator_resume(FAR struct regulator_dev_s *rdev)
   return 0;
 }
 
+static void test_regulator_register(FAR void **state)
+{
+  FAR struct regulator_dev_s * test = NULL;

Review Comment:
   ```suggestion
     FAR struct regulator_dev_s *test = NULL;
   ```



##########
testing/drivertest/drivertest_regulator.c:
##########
@@ -194,6 +194,22 @@ static int test_regulator_resume(FAR struct regulator_dev_s *rdev)
   return 0;
 }
 
+static void test_regulator_register(FAR void **state)
+{
+  FAR struct regulator_dev_s * test = NULL;
+
+  g_fake_regulator.rdev = regulator_register(&g_fake_regulator_desc,
+                                             &g_fake_regulator_ops,
+                                             &g_fake_regulator);
+  assert_false(NULL == g_fake_regulator.rdev);
+  test = regulator_register(&g_fake_regulator_desc,
+                            &g_fake_regulator_ops,
+                            &g_fake_regulator);
+  assert_true(NULL == test);
+  regulator_unregister(g_fake_regulator.rdev);
+  return;

Review Comment:
   ```suggestion
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org