OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This file contains unit tests for the sid class. | 5 // This file contains unit tests for the sid class. |
6 | 6 |
7 #define _ATL_NO_EXCEPTIONS | 7 #define _ATL_NO_EXCEPTIONS |
8 #include <atlbase.h> | 8 #include <atlbase.h> |
9 #include <atlsecurity.h> | 9 #include <atlsecurity.h> |
10 | 10 |
11 #include "sandbox/src/sid.h" | 11 #include "sandbox/win/src/sid.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 namespace sandbox { | 14 namespace sandbox { |
15 | 15 |
16 // Calls ::EqualSid. This function exists only to simplify the calls to | 16 // Calls ::EqualSid. This function exists only to simplify the calls to |
17 // ::EqualSid by removing the need to cast the input params. | 17 // ::EqualSid by removing the need to cast the input params. |
18 BOOL EqualSid(const SID *sid1, const SID *sid2) { | 18 BOOL EqualSid(const SID *sid1, const SID *sid2) { |
19 return ::EqualSid(const_cast<SID*>(sid1), const_cast<SID*>(sid2)); | 19 return ::EqualSid(const_cast<SID*>(sid1), const_cast<SID*>(sid2)); |
20 } | 20 } |
21 | 21 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 ATL::Sids::Users().GetPSID())); | 62 ATL::Sids::Users().GetPSID())); |
63 | 63 |
64 ASSERT_TRUE(EqualSid(Sid(::WinBuiltinGuestsSid).GetPSID(), | 64 ASSERT_TRUE(EqualSid(Sid(::WinBuiltinGuestsSid).GetPSID(), |
65 ATL::Sids::Guests().GetPSID())); | 65 ATL::Sids::Guests().GetPSID())); |
66 | 66 |
67 ASSERT_TRUE(EqualSid(Sid(::WinProxySid).GetPSID(), | 67 ASSERT_TRUE(EqualSid(Sid(::WinProxySid).GetPSID(), |
68 ATL::Sids::Proxy().GetPSID())); | 68 ATL::Sids::Proxy().GetPSID())); |
69 } | 69 } |
70 | 70 |
71 } // namespace sandbox | 71 } // namespace sandbox |
OLD | NEW |