Skip to content

Commit 9ccf9dd

Browse files
Fix the native Windows tests
1 parent f03eda8 commit 9ccf9dd

File tree

3 files changed

+30
-18
lines changed

3 files changed

+30
-18
lines changed

tracer/test/Datadog.Trace.ClrProfiler.Native.Tests/clr_helper_test.cpp

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ TEST_F(CLRHelperTest, FiltersIntegrationsByCaller) {
6969
{
7070
L"integration-1",
7171
{
72-
{L"Assembly.One", L"SomeType", L"SomeMethod", L"ReplaceTargetMethod", min_ver_, max_ver_, {}, empty_sig_type_},
72+
{L"Assembly.One", L"SomeType", L"SomeMethod", L"ReplaceTargetMethod", min_ver_, max_ver_, {}, empty_sig_type_, false, empty_load_args_},
7373
{},
7474
{}
7575
}
@@ -79,7 +79,7 @@ TEST_F(CLRHelperTest, FiltersIntegrationsByCaller) {
7979
{
8080
L"integration-2",
8181
{
82-
{L"Assembly.Two", L"SomeType", L"SomeMethod", L"ReplaceTargetMethod", min_ver_, max_ver_, {}, empty_sig_type_},
82+
{L"Assembly.Two", L"SomeType", L"SomeMethod", L"ReplaceTargetMethod", min_ver_, max_ver_, {}, empty_sig_type_, false, empty_load_args_},
8383
{},
8484
{}
8585
}
@@ -114,19 +114,21 @@ TEST_F(CLRHelperTest, FiltersIntegrationsByTarget) {
114114
min_ver_,
115115
max_ver_,
116116
{},
117-
empty_sig_type_},
117+
empty_sig_type_,
118+
false,
119+
empty_load_args_},
118120
{}}
119121
};
120122

121123
IntegrationMethod i2 = {
122124
L"integration-2",
123125
{{},
124-
{L"Assembly.Two", L"SomeType", L"SomeMethod", L"ReplaceTargetMethod", min_ver_, max_ver_, {}, empty_sig_type_},
126+
{L"Assembly.Two", L"SomeType", L"SomeMethod", L"ReplaceTargetMethod", min_ver_, max_ver_, {}, empty_sig_type_, false, empty_load_args_},
125127
{}}};
126128

127129
IntegrationMethod i3 = {
128130
L"integration-3",
129-
{{}, {L"System.Runtime", L"", L"", L"ReplaceTargetMethod", min_ver_, max_ver_, {}, empty_sig_type_}, {}}};
131+
{{}, {L"System.Runtime", L"", L"", L"ReplaceTargetMethod", min_ver_, max_ver_, {}, empty_sig_type_, false, empty_load_args_}, {}}};
130132

131133
std::vector<IntegrationMethod> all = {i1, i2, i3};
132134
std::vector<IntegrationMethod> expected = {i1, i3};
@@ -143,7 +145,9 @@ TEST_F(CLRHelperTest, FiltersFlattenedIntegrationMethodsByTargetAssembly) {
143145
min_ver_,
144146
max_ver_,
145147
{},
146-
empty_sig_type_},
148+
empty_sig_type_,
149+
false,
150+
empty_load_args_},
147151
{}};
148152

149153
MethodReplacement excluded_method = {{},
@@ -154,7 +158,9 @@ TEST_F(CLRHelperTest, FiltersFlattenedIntegrationMethodsByTargetAssembly) {
154158
min_ver_,
155159
max_ver_,
156160
{},
157-
empty_sig_type_},
161+
empty_sig_type_,
162+
false,
163+
empty_load_args_},
158164
{}};
159165

160166
IntegrationMethod included_integration = {L"integration-2", included_method};
@@ -184,7 +190,9 @@ TEST_F(CLRHelperTest, FiltersFlattenedIntegrationMethodsByTarget) {
184190
min_ver_,
185191
max_ver_,
186192
{},
187-
empty_sig_type_};
193+
empty_sig_type_,
194+
false,
195+
empty_load_args_};
188196

189197
MethodReference excluded = {L"Samples.ExampleLibrary",
190198
L"SomeType",
@@ -193,7 +201,9 @@ TEST_F(CLRHelperTest, FiltersFlattenedIntegrationMethodsByTarget) {
193201
Version(0, 0, 0, 0),
194202
Version(0, 1, 0, 0),
195203
{},
196-
empty_sig_type_};
204+
empty_sig_type_,
205+
false,
206+
empty_load_args_};
197207

198208
std::vector<IntegrationMethod> all =
199209
{

tracer/test/Datadog.Trace.ClrProfiler.Native.Tests/metadata_builder_test.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class MetadataBuilderTest : public ::testing::Test {
1111
MetadataBuilder* metadata_builder_ = nullptr;
1212
IMetaDataDispenser* metadata_dispenser_ = nullptr;
1313
std::vector<WSTRING> empty_sig_type_;
14+
std::vector<USHORT> empty_load_args_;
1415

1516
void SetUp() override {
1617
ICLRMetaHost* metahost = nullptr;
@@ -85,9 +86,9 @@ TEST_F(MetadataBuilderTest, StoresWrapperMemberRef) {
8586

8687
const auto min_ver = Version(0, 0, 0, 0);
8788
const auto max_ver = Version(USHRT_MAX, USHRT_MAX, USHRT_MAX, USHRT_MAX);
88-
const MethodReference ref1(L"", L"", L"", L"", min_ver, max_ver, {}, empty_sig_type_);
89-
const MethodReference ref2(L"Samples.ExampleLibrary", L"Class1", L"Add", L"", min_ver, max_ver, {}, empty_sig_type_);
90-
const MethodReference ref3(L"Samples.ExampleLibrary", L"Class1", L"Add", L"ReplaceTargetMethod", min_ver, max_ver, {}, empty_sig_type_);
89+
const MethodReference ref1(L"", L"", L"", L"", min_ver, max_ver, {}, empty_sig_type_, false, empty_load_args_);
90+
const MethodReference ref2(L"Samples.ExampleLibrary", L"Class1", L"Add", L"", min_ver, max_ver, {}, empty_sig_type_, false, empty_load_args_);
91+
const MethodReference ref3(L"Samples.ExampleLibrary", L"Class1", L"Add", L"ReplaceTargetMethod", min_ver, max_ver, {}, empty_sig_type_, false, empty_load_args_);
9192
const MethodReplacement mr1(ref1, ref2, ref3);
9293
auto hr = metadata_builder_->StoreWrapperMethodRef(mr1);
9394
ASSERT_EQ(S_OK, hr);
@@ -115,10 +116,10 @@ TEST_F(MetadataBuilderTest, StoresWrapperMemberRefForSeparateAssembly) {
115116
const auto min_ver = Version(0, 0, 0, 0);
116117
const auto max_ver = Version(USHRT_MAX, USHRT_MAX, USHRT_MAX, USHRT_MAX);
117118
const MethodReference ref1(L"", L"", L"", L"", min_ver, max_ver, {},
118-
empty_sig_type_);
119-
const MethodReference ref2(L"Samples.ExampleLibrary", L"Class1", L"Add", L"", min_ver, max_ver, {}, empty_sig_type_);
119+
empty_sig_type_, false, empty_load_args_);
120+
const MethodReference ref2(L"Samples.ExampleLibrary", L"Class1", L"Add", L"", min_ver, max_ver, {}, empty_sig_type_, false, empty_load_args_);
120121
const MethodReference ref3(L"Samples.ExampleLibraryTracer", L"Class1", L"Add", L"ReplaceTargetMethod",
121-
min_ver, max_ver, {}, empty_sig_type_);
122+
min_ver, max_ver, {}, empty_sig_type_, false, empty_load_args_);
122123
const MethodReplacement mr1(ref1, ref2, ref3);
123124
auto hr = metadata_builder_->StoreWrapperMethodRef(mr1);
124125
ASSERT_EQ(S_OK, hr);
@@ -136,10 +137,10 @@ TEST_F(MetadataBuilderTest, StoresWrapperMemberRefRecordsFailure) {
136137
const auto min_ver = Version(0, 0, 0, 0);
137138
const auto max_ver = Version(USHRT_MAX, USHRT_MAX, USHRT_MAX, USHRT_MAX);
138139
const MethodReference ref1(L"", L"", L"", L"", min_ver, max_ver, {},
139-
empty_sig_type_);
140-
const MethodReference ref2(L"Samples.ExampleLibrary", L"Class1", L"Add", L"", min_ver, max_ver, {}, empty_sig_type_);
140+
empty_sig_type_, false, empty_load_args_);
141+
const MethodReference ref2(L"Samples.ExampleLibrary", L"Class1", L"Add", L"", min_ver, max_ver, {}, empty_sig_type_, false, empty_load_args_);
141142
const MethodReference ref3(L"Samples.ExampleLibraryTracer.AssemblyDoesNotExist", L"Class1", L"Add", L"ReplaceTargetMethod",
142-
min_ver, max_ver, {}, empty_sig_type_);
143+
min_ver, max_ver, {}, empty_sig_type_, false, empty_load_args_);
143144
const MethodReplacement mr1(ref1, ref2, ref3);
144145
auto hr = metadata_builder_->StoreWrapperMethodRef(mr1);
145146
ASSERT_NE(S_OK, hr);

tracer/test/Datadog.Trace.ClrProfiler.Native.Tests/test_helpers.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class CLRHelperTestBase : public ::testing::Test {
1515
Version min_ver_ = Version(0, 0, 0, 0);
1616
Version max_ver_ = Version(USHRT_MAX, USHRT_MAX, USHRT_MAX, USHRT_MAX);
1717
std::vector<WSTRING> empty_sig_type_;
18+
std::vector<USHORT> empty_load_args_;
1819

1920
void LoadMetadataDependencies() {
2021
ICLRMetaHost* metahost = nullptr;

0 commit comments

Comments
 (0)