1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29

ash / components / arc / session / arc_stop_reason_unittest.cc [blame]

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <sstream>

#include "ash/components/arc/session/arc_stop_reason.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace arc {
namespace {

std::string ConvertToString(ArcStopReason reason) {
  std::stringstream ss;
  ss << reason;
  return ss.str();
}

// Tests "<<" operator for ArcStopReason type.
TEST(ArcStopReasonTest, Default) {
  EXPECT_EQ(ConvertToString(ArcStopReason::SHUTDOWN), "SHUTDOWN");
  EXPECT_EQ(ConvertToString(ArcStopReason::GENERIC_BOOT_FAILURE),
            "GENERIC_BOOT_FAILURE");
  EXPECT_EQ(ConvertToString(ArcStopReason::LOW_DISK_SPACE), "LOW_DISK_SPACE");
  EXPECT_EQ(ConvertToString(ArcStopReason::CRASH), "CRASH");
}

}  // namespace
}  // namespace arc