1 : // Copyright 2012 Google Inc. All Rights Reserved.
2 : //
3 : // Licensed under the Apache License, Version 2.0 (the "License");
4 : // you may not use this file except in compliance with the License.
5 : // You may obtain a copy of the License at
6 : //
7 : // http://www.apache.org/licenses/LICENSE-2.0
8 : //
9 : // Unless required by applicable law or agreed to in writing, software
10 : // distributed under the License is distributed on an "AS IS" BASIS,
11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : // See the License for the specific language governing permissions and
13 : // limitations under the License.
14 :
15 : #include "syzygy/trace/protocol/call_trace_defs.h"
16 :
17 : #include "gtest/gtest.h"
18 :
19 : namespace trace {
20 :
21 E : TEST(CallTraceDefsTest, GetSyzygyCallTraceRpcProtocol) {
22 E : std::wstring protocol;
23 E : ::GetSyzygyCallTraceRpcProtocol(&protocol);
24 E : EXPECT_FALSE(protocol.empty());
25 E : }
26 :
27 E : TEST(CallTraceDefsTest, GetSyzygyCallTraceRpcEndpoint) {
28 E : std::wstring base_endpoint;
29 E : ::GetSyzygyCallTraceRpcEndpoint(L"", &base_endpoint);
30 E : EXPECT_FALSE(base_endpoint.empty());
31 :
32 E : std::wstring new_endpoint;
33 E : ::GetSyzygyCallTraceRpcEndpoint(L"foo", &new_endpoint);
34 E : EXPECT_FALSE(new_endpoint.empty());
35 E : EXPECT_EQ(base_endpoint + L"-foo", new_endpoint);
36 E : }
37 :
38 E : TEST(CallTraceDefsTest, GetSyzygyCallTraceRpcMutexName) {
39 E : std::wstring base_mutex_name;
40 E : ::GetSyzygyCallTraceRpcMutexName(L"", &base_mutex_name);
41 E : EXPECT_FALSE(base_mutex_name.empty());
42 :
43 E : std::wstring new_mutex_name;
44 E : ::GetSyzygyCallTraceRpcMutexName(L"bar", &new_mutex_name);
45 E : EXPECT_FALSE(new_mutex_name.empty());
46 E : EXPECT_EQ(base_mutex_name + L"-bar", new_mutex_name);
47 E : }
48 :
49 : } // namespace trace
|