Use enum : bool in commandline test
authorejjordan <ejjordan@kth.se>
Tue, 4 May 2021 10:05:57 +0000 (12:05 +0200)
committerJoe Jordan <ejjordan12@gmail.com>
Tue, 4 May 2021 12:54:18 +0000 (12:54 +0000)
Demonstrates that t_pargs works with enum class : bool.

src/gromacs/commandline/tests/pargs.cpp

index eeefe76ec3aa0927008747fe67f20a2445a85a47..f11b5def85823bb67d93a24d54f455515cc3a1d0 100644 (file)
@@ -193,10 +193,10 @@ TEST_F(ParseCommonArgsTest, ParsesBooleanArgs)
 
 TEST_F(ParseCommonArgsTest, ParsesBooleanArgsToValuesOfSuitableEnum)
 {
-    enum class LikeBool
+    enum class LikeBool : bool
     {
-        No  = 0,
-        Yes = 1
+        No  = false,
+        Yes = true
     };
     // Set up the default values
     LikeBool value1 = LikeBool::No;