OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "blimp/helium/result.h" | 5 #include "blimp/helium/result.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace blimp { | 10 namespace blimp { |
11 namespace helium { | 11 namespace helium { |
12 namespace { | 12 namespace { |
13 | 13 |
14 class ResultTest : public testing::Test { | 14 class ResultTest : public testing::Test { |
15 public: | 15 public: |
16 ResultTest() {} | 16 ResultTest() {} |
17 ~ResultTest() override {} | 17 ~ResultTest() override {} |
18 }; | 18 }; |
19 | 19 |
20 TEST_F(ResultTest, ResultToStringWorks) { | 20 TEST_F(ResultTest, ResultToStringWorks) { |
21 // The exhaustive list of errors need not be specified here, but enough are | 21 // The exhaustive list of errors need not be specified here, but enough are |
22 // specified that we can verify that the switch/case mapping works as | 22 // specified that we can verify that the switch/case mapping works as |
23 // intended. | 23 // intended. |
24 EXPECT_STREQ("SUCCESS", ResultToString(Result::SUCCESS)); | 24 EXPECT_STREQ("SUCCESS", ResultToString(Result::SUCCESS)); |
25 EXPECT_STREQ("ERR_INTERNAL_ERROR", | |
26 ResultToString(Result::ERR_INTERNAL_ERROR)); | |
27 EXPECT_STREQ("ERR_DISCONNECTED", ResultToString(Result::ERR_DISCONNECTED)); | 25 EXPECT_STREQ("ERR_DISCONNECTED", ResultToString(Result::ERR_DISCONNECTED)); |
28 } | 26 } |
29 | 27 |
30 } // namespace | 28 } // namespace |
31 } // namespace helium | 29 } // namespace helium |
32 } // namespace blimp | 30 } // namespace blimp |
OLD | NEW |