Test cleanup: remove useless std::string constructor
authorDavid Neto <dneto@google.com>
Thu, 22 Oct 2015 17:24:41 +0000 (13:24 -0400)
committerDavid Neto <dneto@google.com>
Mon, 2 Nov 2015 18:51:48 +0000 (13:51 -0500)
test/BinaryToText.cpp
test/TextToBinary.ControlFlow.cpp

index c621019..296a02f 100644 (file)
@@ -396,33 +396,29 @@ INSTANTIATE_TEST_CASE_P(
 using MaskSorting = spvtest::TextToBinaryTest;
 
 TEST_F(MaskSorting, MasksAreSortedFromLSBToMSB) {
-  EXPECT_THAT(
-      EncodeAndDecodeSuccessfully(
-          "OpStore %1 %2 Nontemporal|Aligned|Volatile 32"),
-      Eq(std::string("OpStore %1 %2 Volatile|Aligned|Nontemporal 32\n")));
+  EXPECT_THAT(EncodeAndDecodeSuccessfully(
+                  "OpStore %1 %2 Nontemporal|Aligned|Volatile 32"),
+              Eq("OpStore %1 %2 Volatile|Aligned|Nontemporal 32\n"));
   EXPECT_THAT(
       EncodeAndDecodeSuccessfully(
           "OpDecorate %1 FPFastMathMode NotInf|Fast|AllowRecip|NotNaN|NSZ"),
-      Eq(std::string(
-          "OpDecorate %1 FPFastMathMode NotNaN|NotInf|NSZ|AllowRecip|Fast\n")));
+      Eq("OpDecorate %1 FPFastMathMode NotNaN|NotInf|NSZ|AllowRecip|Fast\n"));
   EXPECT_THAT(
       EncodeAndDecodeSuccessfully("OpLoopMerge %1 %2 DontUnroll|Unroll"),
-      Eq(std::string("OpLoopMerge %1 %2 Unroll|DontUnroll\n")));
+      Eq("OpLoopMerge %1 %2 Unroll|DontUnroll\n"));
   EXPECT_THAT(
       EncodeAndDecodeSuccessfully("OpSelectionMerge %1 DontFlatten|Flatten"),
-      Eq(std::string("OpSelectionMerge %1 Flatten|DontFlatten\n")));
-  EXPECT_THAT(
-      EncodeAndDecodeSuccessfully(
-          "%2 = OpFunction %1 DontInline|Const|Pure|Inline %3"),
-      Eq(std::string("%2 = OpFunction %1 Inline|DontInline|Pure|Const %3\n")));
+      Eq("OpSelectionMerge %1 Flatten|DontFlatten\n"));
+  EXPECT_THAT(EncodeAndDecodeSuccessfully(
+                  "%2 = OpFunction %1 DontInline|Const|Pure|Inline %3"),
+              Eq("%2 = OpFunction %1 Inline|DontInline|Pure|Const %3\n"));
   EXPECT_THAT(EncodeAndDecodeSuccessfully(
                   "%2 = OpImageFetch %1 %3 %4"
                   " MinLod|Sample|Offset|Lod|Grad|ConstOffsets|ConstOffset|Bias"
                   " %5 %6 %7 %8 %9 %10 %11 %12 %13\n"),
-              Eq(std::string(
-                  "%2 = OpImageFetch %1 %3 %4"
-                  " Bias|Lod|Grad|ConstOffset|Offset|ConstOffsets|Sample|MinLod"
-                  " %5 %6 %7 %8 %9 %10 %11 %12 %13\n")));
+              Eq("%2 = OpImageFetch %1 %3 %4"
+                 " Bias|Lod|Grad|ConstOffset|Offset|ConstOffsets|Sample|MinLod"
+                 " %5 %6 %7 %8 %9 %10 %11 %12 %13\n"));
 }
 
 }  // anonymous namespace
index 976bb1c..9802c34 100644 (file)
@@ -342,10 +342,10 @@ TEST_P(OpSwitchInvalidTypeTestCase, InvalidTypes) {
       "%3 = OpCopyObject %1 %2\n"  // We only care the type of the expression
       "%4 = OpSwitch %3 %default 32 %c\n";
   EXPECT_THAT(CompileFailure(input),
-              Eq(std::string(
-                  "The selector operand for OpSwitch must be the result of an "
-                  "instruction that generates an integer scalar")));
+              Eq("The selector operand for OpSwitch must be the result of an "
+                 "instruction that generates an integer scalar"));
 }
+
 // clang-format off
 INSTANTIATE_TEST_CASE_P(
     TextToBinaryOpSwitchInvalidTests, OpSwitchInvalidTypeTestCase,