[PATCH 3/3] rtems: Provide nonzero argc required by gtest init

Martin Erik Werner martinerikwerner.aac at gmail.com
Sat Sep 30 16:31:30 UTC 2017


Signed-off-by: Martin Erik Werner <martin.werner at aacmicrotec.com>
---
 rtems/gtest-main.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/rtems/gtest-main.h b/rtems/gtest-main.h
index 81ec91e..797d12e 100644
--- a/rtems/gtest-main.h
+++ b/rtems/gtest-main.h
@@ -39,8 +39,9 @@
 extern "C" {
   void *POSIX_Init(void *)
   {
-    int argc = 0;
-    char **argv = NULL;
+    /* gtest requires nonzero arg count */
+    int argc = 1;
+    char *argv[] = { "dummy" };
     testing::InitGoogleTest(&argc, argv);
 
     int exit_status = RUN_ALL_TESTS();
-- 
2.11.0




More information about the devel mailing list