Skip to content

Commit

Permalink
Remove the dependency on WTL from win32_image_util_test.cc
Browse files Browse the repository at this point in the history
This commit updates

  win32_image_util_test.cc

with WIL so as not to depend on WTL (#861).

This is a mechanical code change. There must be no observable behavior
change.

#codehealth

PiperOrigin-RevId: 599396406
  • Loading branch information
yukawa authored and hiroyuki-komatsu committed Jan 18, 2024
1 parent 8c3e41c commit 0c7ed79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
3 changes: 1 addition & 2 deletions src/renderer/win32/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ mozc_cc_test(
mozc_cc_test(
name = "win32_image_util_test",
srcs = ["win32_image_util_test.cc"],
copts = copts_wtl(),
data = [
"//data/test/renderer/win32",
],
Expand All @@ -319,7 +318,7 @@ mozc_cc_test(
"//data/test/renderer/win32:test_spec_cc_proto",
"//testing:gunit_main",
"//testing:mozctest",
"//third_party/wtl",
"@com_google_absl//absl/strings",
"@com_microsoft_wil//:wil",
],
)
16 changes: 5 additions & 11 deletions src/renderer/win32/win32_image_util_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@

#include "renderer/win32/win32_image_util.h"

// clang-format off
#include <atlbase.h>
#include <atltypes.h>
#include <atlapp.h>
#include <atlgdi.h>
#include <atlmisc.h>
// clang-format on
#include <wil/resource.h>

#undef StrCat

Expand Down Expand Up @@ -77,8 +73,6 @@ using ::mozc::renderer::win32::internal::TextLabel;
using ::mozc::win32::Utf8ToWide;
using ::mozc::win32::WideToUtf8;

using ::WTL::CBitmap;

using BalloonImageInfo = BalloonImage::BalloonImageInfo;
using SubdivisionalPixelIterator =
SubdivisionalPixel::SubdivisionalPixelIterator;
Expand Down Expand Up @@ -115,8 +109,8 @@ class BalloonImageTest : public ::testing::Test,
CPoint tail_offset;
CSize size;
std::vector<ARGBColor> buffer;
CBitmap dib = TestableBalloonImage::CreateInternal(info, &tail_offset,
&size, &buffer);
wil::unique_hbitmap dib(TestableBalloonImage::CreateInternal(
info, &tail_offset, &size, &buffer));

TestSpec spec = TestSpec();
BalloonInfoToTextProto(info, &spec);
Expand Down Expand Up @@ -335,8 +329,8 @@ TEST_P(BalloonImageTest, TestImpl) {
CPoint actual_tail_offset;
CSize actual_size;
std::vector<ARGBColor> actual_buffer;
CBitmap dib = TestableBalloonImage::CreateInternal(
info, &actual_tail_offset, &actual_size, &actual_buffer);
wil::unique_hbitmap dib(TestableBalloonImage::CreateInternal(
info, &actual_tail_offset, &actual_size, &actual_buffer));

EXPECT_EQ(actual_tail_offset.x, spec.output().tail_offset_x());
EXPECT_EQ(actual_tail_offset.y, spec.output().tail_offset_y());
Expand Down

0 comments on commit 0c7ed79

Please sign in to comment.