blob: 490af5e4e810cd360b20d9fd4e783c8d7713c660 [file] [log] [blame]
Hardik Goyalb09d6b02019-08-13 16:15:50 -07001// Copyright 2019 The Chromium OS 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 "debugd/src/helper_utils.h"
6
Simon Glassb51cc132020-06-10 12:30:53 -06007#include <limits.h>
8
Hardik Goyalb09d6b02019-08-13 16:15:50 -07009#include <gtest/gtest.h>
10
11namespace debugd {
12
13TEST(SandboxedProcessTest, GetHelperPath) {
14 std::string full_path;
15
16 EXPECT_TRUE(GetHelperPath("", &full_path));
17 EXPECT_EQ("/usr/libexec/debugd/helpers/", full_path);
18
19 EXPECT_TRUE(GetHelperPath("test/me", &full_path));
20 EXPECT_EQ("/usr/libexec/debugd/helpers/test/me", full_path);
Simon Glassb51cc132020-06-10 12:30:53 -060021
22 std::string str(PATH_MAX, 'x');
23 EXPECT_FALSE(GetHelperPath(str, &full_path));
Hardik Goyalb09d6b02019-08-13 16:15:50 -070024}
25
26} // namespace debugd