[email protected] | 8d80d2d6 | 2010-07-08 03:19:08 | [diff] [blame^] | 1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "base/env_var.h" |
| 6 | #include "base/scoped_ptr.h" |
| 7 | #include "testing/gtest/include/gtest/gtest.h" |
| 8 | #include "testing/platform_test.h" |
| 9 | |
| 10 | typedef PlatformTest EnvVarTest; |
| 11 | |
| 12 | TEST_F(EnvVarTest, GetEnvVar) { |
| 13 | // Every setup should have non-empty PATH... |
| 14 | scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create()); |
| 15 | std::string env_value; |
| 16 | EXPECT_TRUE(env->GetEnv("PATH", &env_value)); |
| 17 | EXPECT_NE(env_value, ""); |
| 18 | } |
| 19 | |
| 20 | TEST_F(EnvVarTest, HasEnvVar) { |
| 21 | // Every setup should have PATH... |
| 22 | scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create()); |
| 23 | EXPECT_TRUE(env->HasEnv("PATH")); |
| 24 | } |