| Flutter iOS Embedder |

Functions
availability_version_check_unittests.cc File Reference
`#include <tuple>`
`#include "flutter/shell/platform/darwin/common/availability_version_check.h"`
`#include "gtest/gtest.h"`

Go to the source code of this file.

## Functions
| TEST (AvailabilityVersionCheck, CanDecodeSystemPlist)
static uint32_t | ConstructVersion (uint32_t major, uint32_t minor, uint32_t subminor)
| TEST (AvailabilityVersionCheck, CanParseAndCompareVersions)

## Function Documentation

## ◆ ConstructVersion()

static uint32_t ConstructVersion | ( | uint32_t | major,
|  | uint32_t | minor,
|  | uint32_t | subminor
| ) |  |
| inline static

Definition at line 20 of file availability_version_check_unittests.cc.

22 {
23 return ((major & 0xffff) << 16) | ((minor & 0xff) << 8) | (subminor & 0xff);
24 }

Referenced by TEST().

## ◆ TEST() [1/2]

TEST | ( | AvailabilityVersionCheck | ,
|  | CanDecodeSystemPlist |
| ) |  |

Definition at line 11 of file availability_version_check_unittests.cc.

11 {
12 auto maybe_product_version = flutter::ProductVersionFromSystemVersionPList();
13 ASSERT_TRUE(maybe_product_version.has_value());
14 if (maybe_product_version.has_value()) {
15 auto product_version = maybe_product_version.value();
16 ASSERT_GT(product_version, std::make_tuple(0, 0, 0));
17 }
18 }

References flutter::ProductVersionFromSystemVersionPList().

## ◆ TEST() [2/2]

TEST | ( | AvailabilityVersionCheck | ,
|  | CanParseAndCompareVersions |
| ) |  |

Definition at line 26 of file availability_version_check_unittests.cc.

26 {
27 auto rhs_version = std::make_tuple(17, 2, 0);
28 uint32_t encoded_lower_version = ConstructVersion(12, 3, 7);
29 ASSERT_TRUE(flutter::IsEncodedVersionLessThanOrSame(encoded_lower_version,
30 rhs_version));
31
32 uint32_t encoded_higher_version = ConstructVersion(42, 0, 1);
33 ASSERT_FALSE(flutter::IsEncodedVersionLessThanOrSame(encoded_higher_version,
34 rhs_version));
35 }

References ConstructVersion(), and flutter::IsEncodedVersionLessThanOrSame().

ConstructVersion
static uint32_t ConstructVersion(uint32_t major, uint32_t minor, uint32_t subminor)
Definition: availability_version_check_unittests.cc:20
flutter::ProductVersionFromSystemVersionPList
std::optional< ProductVersion > ProductVersionFromSystemVersionPList()
Definition: availability_version_check.cc:53
flutter::IsEncodedVersionLessThanOrSame
bool IsEncodedVersionLessThanOrSame(uint32_t encoded_lhs, ProductVersion rhs)
Definition: availability_version_check.cc:122