Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Linux] add GTest printer for FlValue #32652

Merged
merged 1 commit into from
Apr 13, 2022

Conversation

jpnurmi
Copy link
Member

@jpnurmi jpnurmi commented Apr 13, 2022

Improves test failure messages when matching FlValue arguments.

For example, before:

  Expected arg #2: has setting ("platformBrightness", 0x32f0980)
           Actual: 0x7f81ec005990, 0x32f0900

And after:

  Expected arg #2: has setting ("platformBrightness", dark)
           Actual: 0x27bded0, {textScaleFactor: 0.0, alwaysUse24HourFormat: false, platformBrightness: light}

This is a preparation step split off from #32618 that will eventually fix light
vs. dark theme detection on Linux (flutter/flutter#101438).

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

Improves test failure messages when matching FlValue arguments.

For example, before:

  Expected arg #2: has setting ("platformBrightness", 0x32f0980)
           Actual: 0x7f81ec005990, 0x32f0900

And after:

  Expected arg #2: has setting ("platformBrightness", dark)
           Actual: 0x27bded0, {textScaleFactor: 0.0, alwaysUse24HourFormat: false, platformBrightness: light}
Copy link
Contributor

@robert-ancell robert-ancell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@robert-ancell robert-ancell merged commit f502732 into flutter:main Apr 13, 2022
@jpnurmi jpnurmi deleted the fl-value-gtest-printer branch April 14, 2022 03:49
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 14, 2022
justinmc pushed a commit to justinmc/engine that referenced this pull request Apr 20, 2022
Improves test failure messages when matching FlValue arguments.

For example, before:

  Expected arg flutter#2: has setting ("platformBrightness", 0x32f0980)
           Actual: 0x7f81ec005990, 0x32f0900

And after:

  Expected arg flutter#2: has setting ("platformBrightness", dark)
           Actual: 0x27bded0, {textScaleFactor: 0.0, alwaysUse24HourFormat: false, platformBrightness: light}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants