forked from qt-creator/qt-creator
UnitTests: Improve error messages
Adding the a property and field matcher string makes it easier to read the error messages. Change-Id: I0b9a4bf39d227eabd1342b3269ec70eca4e06d25 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -109,8 +109,8 @@ TEST_F(Storage, return_all_entries_with_the_name_which_starts_with_foo)
|
|||||||
|
|
||||||
auto entries = storage.entries("foo*");
|
auto entries = storage.entries("foo*");
|
||||||
|
|
||||||
ASSERT_THAT(entries, UnorderedElementsAre(IsEntry("foo", Field(&Entry::values), Contains(5)),
|
ASSERT_THAT(entries, UnorderedElementsAre(IsEntry("foo", Field("Entry::values)", &Entry::values, Contains(5)),
|
||||||
IsEntry("fooBar", Field(&Entry::values), IsSubset(42, 77))));
|
IsEntry("fooBar", Field("Entry::values", &Entry::values, IsSubset(42, 77))));
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ You can even make the matcher easier to read.
|
|||||||
template<typename Matcher>
|
template<typename Matcher>
|
||||||
auto FieldValues(const Matcher &matcher)
|
auto FieldValues(const Matcher &matcher)
|
||||||
{
|
{
|
||||||
return Field(&Entry::values, matcher);
|
return Field("Entry::values", &Entry::values, matcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(Storage, return_all_entries_with_the_name_which_starts_with_foo)
|
TEST_F(Storage, return_all_entries_with_the_name_which_starts_with_foo)
|
||||||
|
@@ -16,9 +16,9 @@ auto IsImport(const ModuleIdMatcher &moduleIdMatcher,
|
|||||||
const MajorVersionMatcher &majorVersionMatcher,
|
const MajorVersionMatcher &majorVersionMatcher,
|
||||||
const MinorVersionMatcher &minorVersionMatcher)
|
const MinorVersionMatcher &minorVersionMatcher)
|
||||||
{
|
{
|
||||||
return AllOf(Field(&QmlDesigner::Storage::Import::moduleId, moduleIdMatcher),
|
return AllOf(Field("QmlDesigner::Storage::Import::moduleId", &QmlDesigner::Storage::Import::moduleId, moduleIdMatcher),
|
||||||
Field(&QmlDesigner::Storage::Import::sourceId, sourceIdMatcher),
|
Field("QmlDesigner::Storage::Import::sourceId", &QmlDesigner::Storage::Import::sourceId, sourceIdMatcher),
|
||||||
Field(&QmlDesigner::Storage::Import::version,
|
Field("QmlDesigner::Storage::Import::version", &QmlDesigner::Storage::Import::version,
|
||||||
IsVersion(majorVersionMatcher, minorVersionMatcher)));
|
IsVersion(majorVersionMatcher, minorVersionMatcher)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ auto IsImport(const ModuleIdMatcher &moduleIdMatcher,
|
|||||||
const SourceIdMatcher &sourceIdMatcher,
|
const SourceIdMatcher &sourceIdMatcher,
|
||||||
const VersionMatcher &versionMatcher)
|
const VersionMatcher &versionMatcher)
|
||||||
{
|
{
|
||||||
return AllOf(Field(&QmlDesigner::Storage::Import::moduleId, moduleIdMatcher),
|
return AllOf(Field("QmlDesigner::Storage::Import::moduleId", &QmlDesigner::Storage::Import::moduleId, moduleIdMatcher),
|
||||||
Field(&QmlDesigner::Storage::Import::sourceId, sourceIdMatcher),
|
Field("QmlDesigner::Storage::Import::sourceId", &QmlDesigner::Storage::Import::sourceId, sourceIdMatcher),
|
||||||
Field(&QmlDesigner::Storage::Import::version, versionMatcher));
|
Field("QmlDesigner::Storage::Import::version", &QmlDesigner::Storage::Import::version, versionMatcher));
|
||||||
}
|
}
|
||||||
|
@@ -16,9 +16,9 @@ auto IsInfoExportTypeNames(const ModuleIdMatcher &moduleIdMatcher,
|
|||||||
const MajorVersionMatcher &majorVersionMatcher,
|
const MajorVersionMatcher &majorVersionMatcher,
|
||||||
const MinorVersionMatcher &minorVersionMatcher)
|
const MinorVersionMatcher &minorVersionMatcher)
|
||||||
{
|
{
|
||||||
return AllOf(Field(&QmlDesigner::Storage::Info::ExportedTypeName::moduleId, moduleIdMatcher),
|
return AllOf(Field("QmlDesigner::Storage::Info::ExportedTypeName::moduleId", &QmlDesigner::Storage::Info::ExportedTypeName::moduleId, moduleIdMatcher),
|
||||||
Field(&QmlDesigner::Storage::Info::ExportedTypeName::name, nameMatcher),
|
Field("QmlDesigner::Storage::Info::ExportedTypeName::name", &QmlDesigner::Storage::Info::ExportedTypeName::name, nameMatcher),
|
||||||
Field(&QmlDesigner::Storage::Info::ExportedTypeName::version,
|
Field("QmlDesigner::Storage::Info::ExportedTypeName::version", &QmlDesigner::Storage::Info::ExportedTypeName::version,
|
||||||
IsVersion(majorVersionMatcher, minorVersionMatcher)));
|
IsVersion(majorVersionMatcher, minorVersionMatcher)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ auto IsInfoExportTypeNames(const ModuleIdMatcher &moduleIdMatcher,
|
|||||||
const NameMatcher &nameMatcher,
|
const NameMatcher &nameMatcher,
|
||||||
const VersionMatcher &versionMatcher)
|
const VersionMatcher &versionMatcher)
|
||||||
{
|
{
|
||||||
return AllOf(Field(&QmlDesigner::Storage::Info::ExportedTypeName::moduleId, moduleIdMatcher),
|
return AllOf(Field("QmlDesigner::Storage::Info::ExportedTypeName::moduleId", &QmlDesigner::Storage::Info::ExportedTypeName::moduleId, moduleIdMatcher),
|
||||||
Field(&QmlDesigner::Storage::Info::ExportedTypeName::name, nameMatcher),
|
Field("QmlDesigner::Storage::Info::ExportedTypeName::name", &QmlDesigner::Storage::Info::ExportedTypeName::name, nameMatcher),
|
||||||
Field(&QmlDesigner::Storage::Info::ExportedTypeName::version, versionMatcher));
|
Field("QmlDesigner::Storage::Info::ExportedTypeName::version", &QmlDesigner::Storage::Info::ExportedTypeName::version, versionMatcher));
|
||||||
}
|
}
|
||||||
|
@@ -34,11 +34,12 @@ testing::Matcher<QVariant> IsQVariantType()
|
|||||||
template<typename Type, typename Matcher>
|
template<typename Type, typename Matcher>
|
||||||
auto IsQVariant(const Matcher &matcher)
|
auto IsQVariant(const Matcher &matcher)
|
||||||
{
|
{
|
||||||
return AllOf(IsQVariantType<Type>(), Property(&QVariant::value<Type>, matcher));
|
return AllOf(IsQVariantType<Type>(),
|
||||||
|
Property("QVariant::value<Type>", &QVariant::value<Type>, matcher));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Matcher>
|
template<typename Matcher>
|
||||||
auto QVariantIsValid(const Matcher &matcher)
|
auto QVariantIsValid(const Matcher &matcher)
|
||||||
{
|
{
|
||||||
return Property(&QVariant::isValid, matcher);
|
return Property("QVariant::isValid", &QVariant::isValid, matcher);
|
||||||
}
|
}
|
||||||
|
@@ -11,19 +11,19 @@
|
|||||||
template<typename Matcher>
|
template<typename Matcher>
|
||||||
auto IsVersionNumber(const Matcher &matcher)
|
auto IsVersionNumber(const Matcher &matcher)
|
||||||
{
|
{
|
||||||
return Field(&QmlDesigner::Storage::VersionNumber::value, matcher);
|
return Field("QmlDesigner::Storage::VersionNumber::value", &QmlDesigner::Storage::VersionNumber::value, matcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Matcher>
|
template<typename Matcher>
|
||||||
auto IsMinorVersion(const Matcher &matcher)
|
auto IsMinorVersion(const Matcher &matcher)
|
||||||
{
|
{
|
||||||
return Field(&QmlDesigner::Storage::Version::minor, matcher);
|
return Field("QmlDesigner::Storage::Version::minor", &QmlDesigner::Storage::Version::minor, matcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Matcher>
|
template<typename Matcher>
|
||||||
auto IsMajorVersion(const Matcher &matcher)
|
auto IsMajorVersion(const Matcher &matcher)
|
||||||
{
|
{
|
||||||
return Field(&QmlDesigner::Storage::Version::major, matcher);
|
return Field("QmlDesigner::Storage::Version::major", &QmlDesigner::Storage::Version::major, matcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename MajorMatcher, typename MinorMatcher>
|
template<typename MajorMatcher, typename MinorMatcher>
|
||||||
|
@@ -36,13 +36,15 @@ using ComplexProperty = QmlDesigner::PropertyComponentGenerator::ComplexProperty
|
|||||||
template<typename Matcher>
|
template<typename Matcher>
|
||||||
auto IsBasicProperty(const Matcher &matcher)
|
auto IsBasicProperty(const Matcher &matcher)
|
||||||
{
|
{
|
||||||
return VariantWith<BasicProperty>(Field(&BasicProperty::component, matcher));
|
return VariantWith<BasicProperty>(
|
||||||
|
Field("BasicProperty::component", &BasicProperty::component, matcher));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Matcher>
|
template<typename Matcher>
|
||||||
auto IsComplexProperty(const Matcher &matcher)
|
auto IsComplexProperty(const Matcher &matcher)
|
||||||
{
|
{
|
||||||
return VariantWith<ComplexProperty>(Field(&ComplexProperty::component, matcher));
|
return VariantWith<ComplexProperty>(
|
||||||
|
Field("ComplexProperty::component", &ComplexProperty::component, matcher));
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr Utils::SmallStringView sourcesPath = UNITTEST_DIR
|
constexpr Utils::SmallStringView sourcesPath = UNITTEST_DIR
|
||||||
|
@@ -97,7 +97,7 @@ TEST(DesignSystemManagerTest, remove_theme)
|
|||||||
mgr.removeTheme(*themeId);
|
mgr.removeTheme(*themeId);
|
||||||
|
|
||||||
// assert
|
// assert
|
||||||
ASSERT_THAT(mgr, Property(&DSThemeManager::themeCount, 0));
|
ASSERT_THAT(mgr, Property("DSThemeManager::themeCount", &DSThemeManager::themeCount, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(DesignSystemManagerTest, remove_theme_with_properties)
|
TEST(DesignSystemManagerTest, remove_theme_with_properties)
|
||||||
@@ -113,7 +113,7 @@ TEST(DesignSystemManagerTest, remove_theme_with_properties)
|
|||||||
|
|
||||||
// assert
|
// assert
|
||||||
ASSERT_THAT(mgr,
|
ASSERT_THAT(mgr,
|
||||||
AllOf(Property(&DSThemeManager::themeCount, 0),
|
AllOf(Property("DSThemeManager::themeCount", &DSThemeManager::themeCount, 0),
|
||||||
Not(HasProperty(*themeId, GroupType::Colors, testProp))));
|
Not(HasProperty(*themeId, GroupType::Colors, testProp))));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ TEST_P(DesignSystemManagerTest, add_property_without_theme)
|
|||||||
mgr.addProperty(groupType, testProp);
|
mgr.addProperty(groupType, testProp);
|
||||||
|
|
||||||
//assert
|
//assert
|
||||||
ASSERT_THAT(mgr, Property(&DSThemeManager::themeCount, 0));
|
ASSERT_THAT(mgr, Property("DSThemeManager::themeCount", &DSThemeManager::themeCount, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(DesignSystemManagerTest, add_property)
|
TEST_P(DesignSystemManagerTest, add_property)
|
||||||
@@ -140,7 +140,7 @@ TEST_P(DesignSystemManagerTest, add_property)
|
|||||||
|
|
||||||
// assert
|
// assert
|
||||||
ASSERT_THAT(mgr,
|
ASSERT_THAT(mgr,
|
||||||
AllOf(Property(&DSThemeManager::themeCount, 1),
|
AllOf(Property("DSThemeManager::themeCount", &DSThemeManager::themeCount, 1),
|
||||||
HasProperty(*themeId, groupType, testProp)));
|
HasProperty(*themeId, groupType, testProp)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ TEST_P(DesignSystemManagerTest, adding_invalid_property_fails)
|
|||||||
// assert
|
// assert
|
||||||
ASSERT_FALSE(result);
|
ASSERT_FALSE(result);
|
||||||
ASSERT_THAT(mgr,
|
ASSERT_THAT(mgr,
|
||||||
AllOf(Property(&DSThemeManager::themeCount, 1),
|
AllOf(Property("DSThemeManager::themeCount", &DSThemeManager::themeCount, 1),
|
||||||
Not(HasProperty(*themeId, groupType, testProp))));
|
Not(HasProperty(*themeId, groupType, testProp))));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,7 +172,7 @@ TEST_P(DesignSystemManagerTest, adding_property_adds_property_to_all_themes)
|
|||||||
|
|
||||||
// assert
|
// assert
|
||||||
ASSERT_THAT(mgr,
|
ASSERT_THAT(mgr,
|
||||||
AllOf(Property(&DSThemeManager::themeCount, 2),
|
AllOf(Property("DSThemeManager::themeCount", &DSThemeManager::themeCount, 2),
|
||||||
HasProperty(*themeIdDark, groupType, testProp),
|
HasProperty(*themeIdDark, groupType, testProp),
|
||||||
HasProperty(*themeIdLight, groupType, testProp)));
|
HasProperty(*themeIdLight, groupType, testProp)));
|
||||||
}
|
}
|
||||||
@@ -190,7 +190,7 @@ TEST_P(DesignSystemManagerTest, update_property_value)
|
|||||||
|
|
||||||
// assert
|
// assert
|
||||||
ASSERT_THAT(mgr,
|
ASSERT_THAT(mgr,
|
||||||
AllOf(Property(&DSThemeManager::themeCount, 1),
|
AllOf(Property("DSThemeManager::themeCount", &DSThemeManager::themeCount, 1),
|
||||||
HasProperty(*themeId, groupType, testPropUpdated)));
|
HasProperty(*themeId, groupType, testPropUpdated)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,7 +207,7 @@ TEST_P(DesignSystemManagerTest, update_property_name)
|
|||||||
|
|
||||||
// assert
|
// assert
|
||||||
ASSERT_THAT(mgr,
|
ASSERT_THAT(mgr,
|
||||||
AllOf(Property(&DSThemeManager::themeCount, 1),
|
AllOf(Property("DSThemeManager::themeCount", &DSThemeManager::themeCount, 1),
|
||||||
HasProperty(*themeId, groupType, testPropUpdated)));
|
HasProperty(*themeId, groupType, testPropUpdated)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,7 +224,7 @@ TEST_P(DesignSystemManagerTest, updating_invalid_property_fails)
|
|||||||
|
|
||||||
// assert
|
// assert
|
||||||
ASSERT_THAT(mgr,
|
ASSERT_THAT(mgr,
|
||||||
AllOf(Property(&DSThemeManager::themeCount, 1),
|
AllOf(Property("DSThemeManager::themeCount", &DSThemeManager::themeCount, 1),
|
||||||
HasProperty(*themeId, groupType, testProp)));
|
HasProperty(*themeId, groupType, testProp)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,7 +240,7 @@ TEST_P(DesignSystemManagerTest, remove_property)
|
|||||||
|
|
||||||
// assert
|
// assert
|
||||||
ASSERT_THAT(mgr,
|
ASSERT_THAT(mgr,
|
||||||
AllOf(Property(&DSThemeManager::themeCount, 1),
|
AllOf(Property("DSThemeManager::themeCount", &DSThemeManager::themeCount, 1),
|
||||||
Not(HasProperty(*themeId, groupType, testProp))));
|
Not(HasProperty(*themeId, groupType, testProp))));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,7 +256,7 @@ TEST_P(DesignSystemManagerTest, remove_absent_property_fails)
|
|||||||
|
|
||||||
// assert
|
// assert
|
||||||
ASSERT_THAT(mgr,
|
ASSERT_THAT(mgr,
|
||||||
AllOf(Property(&DSThemeManager::themeCount, 1),
|
AllOf(Property("DSThemeManager::themeCount", &DSThemeManager::themeCount, 1),
|
||||||
HasProperty(*themeId, groupType, testProp)));
|
HasProperty(*themeId, groupType, testProp)));
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -134,7 +134,7 @@ TEST_P(DesignSystemQmlTest, group_aliase_properties_are_generated)
|
|||||||
|
|
||||||
// assert
|
// assert
|
||||||
ASSERT_THAT(rootNode,
|
ASSERT_THAT(rootNode,
|
||||||
AllOf(Property(&ModelNode::type, Eq("QtObject")),
|
AllOf(Property("ModelNode::type", &ModelNode::type, Eq("QtObject")),
|
||||||
HasBindingProperty(groupName, binding),
|
HasBindingProperty(groupName, binding),
|
||||||
HasBindingProperty("currentTheme", darkThemeName),
|
HasBindingProperty("currentTheme", darkThemeName),
|
||||||
HasNodeProperty(darkThemeName, "QtObject")));
|
HasNodeProperty(darkThemeName, "QtObject")));
|
||||||
@@ -152,7 +152,7 @@ TEST_P(DesignSystemQmlTest, empty_groups_generate_no_group_aliase_properties)
|
|||||||
|
|
||||||
// assert
|
// assert
|
||||||
ASSERT_THAT(rootNode,
|
ASSERT_THAT(rootNode,
|
||||||
AllOf(Property(&ModelNode::type, Eq("QtObject")),
|
AllOf(Property("ModelNode::type", &ModelNode::type, Eq("QtObject")),
|
||||||
Not(HasBindingProperty(groupName, binding)),
|
Not(HasBindingProperty(groupName, binding)),
|
||||||
Not(HasBindingProperty("currentTheme", darkThemeName)),
|
Not(HasBindingProperty("currentTheme", darkThemeName)),
|
||||||
Not(HasNodeProperty(darkThemeName, "QtObject"))));
|
Not(HasNodeProperty(darkThemeName, "QtObject"))));
|
||||||
|
@@ -519,9 +519,9 @@ TEST_F(AsynchronousImageCache, request_image_with_auxiliary_data_request_image_f
|
|||||||
_,
|
_,
|
||||||
_,
|
_,
|
||||||
VariantWith<FontCollectorSizesAuxiliaryData>(
|
VariantWith<FontCollectorSizesAuxiliaryData>(
|
||||||
AllOf(Field(&FontCollectorSizesAuxiliaryData::sizes,
|
AllOf(Field("FontCollectorSizesAuxiliaryData::sizes", &FontCollectorSizesAuxiliaryData::sizes,
|
||||||
ElementsAre(QSize{20, 11})),
|
ElementsAre(QSize{20, 11})),
|
||||||
Field(&FontCollectorSizesAuxiliaryData::colorName,
|
Field("FontCollectorSizesAuxiliaryData::colorName", &FontCollectorSizesAuxiliaryData::colorName,
|
||||||
Eq(u"color")))),
|
Eq(u"color")))),
|
||||||
_))
|
_))
|
||||||
.WillRepeatedly([&](auto, auto, auto, auto &&, auto, auto, auto) { notification.notify(); });
|
.WillRepeatedly([&](auto, auto, auto, auto &&, auto, auto, auto) { notification.notify(); });
|
||||||
@@ -548,9 +548,9 @@ TEST_F(AsynchronousImageCache, request_mid_size_image_with_auxiliary_data_reques
|
|||||||
_,
|
_,
|
||||||
_,
|
_,
|
||||||
VariantWith<FontCollectorSizesAuxiliaryData>(
|
VariantWith<FontCollectorSizesAuxiliaryData>(
|
||||||
AllOf(Field(&FontCollectorSizesAuxiliaryData::sizes,
|
AllOf(Field("FontCollectorSizesAuxiliaryData::sizes", &FontCollectorSizesAuxiliaryData::sizes,
|
||||||
ElementsAre(QSize{20, 11})),
|
ElementsAre(QSize{20, 11})),
|
||||||
Field(&FontCollectorSizesAuxiliaryData::colorName,
|
Field("FontCollectorSizesAuxiliaryData::colorName", &FontCollectorSizesAuxiliaryData::colorName,
|
||||||
Eq(u"color")))),
|
Eq(u"color")))),
|
||||||
_))
|
_))
|
||||||
.WillRepeatedly([&](auto, auto, auto, auto &&, auto, auto, auto) { notification.notify(); });
|
.WillRepeatedly([&](auto, auto, auto, auto &&, auto, auto, auto) { notification.notify(); });
|
||||||
@@ -577,9 +577,9 @@ TEST_F(AsynchronousImageCache, request_small_image_with_auxiliary_data_request_i
|
|||||||
_,
|
_,
|
||||||
_,
|
_,
|
||||||
VariantWith<FontCollectorSizesAuxiliaryData>(
|
VariantWith<FontCollectorSizesAuxiliaryData>(
|
||||||
AllOf(Field(&FontCollectorSizesAuxiliaryData::sizes,
|
AllOf(Field("FontCollectorSizesAuxiliaryData::sizes", &FontCollectorSizesAuxiliaryData::sizes,
|
||||||
ElementsAre(QSize{20, 11})),
|
ElementsAre(QSize{20, 11})),
|
||||||
Field(&FontCollectorSizesAuxiliaryData::colorName,
|
Field("FontCollectorSizesAuxiliaryData::colorName", &FontCollectorSizesAuxiliaryData::colorName,
|
||||||
Eq(u"color")))),
|
Eq(u"color")))),
|
||||||
_))
|
_))
|
||||||
.WillRepeatedly([&](auto, auto, auto, auto &&, auto, auto, auto) { notification.notify(); });
|
.WillRepeatedly([&](auto, auto, auto, auto &&, auto, auto, auto) { notification.notify(); });
|
||||||
|
@@ -74,10 +74,10 @@ TEST_F(AsynchronousImageFactory, request_image_with_auxiliary_data_request_image
|
|||||||
start(Eq("/path/to/Component.qml"),
|
start(Eq("/path/to/Component.qml"),
|
||||||
Eq("foo"),
|
Eq("foo"),
|
||||||
VariantWith<FontCollectorSizesAuxiliaryData>(
|
VariantWith<FontCollectorSizesAuxiliaryData>(
|
||||||
AllOf(Field(&FontCollectorSizesAuxiliaryData::sizes,
|
AllOf(Field("FontCollectorSizesAuxiliaryData::sizes", &FontCollectorSizesAuxiliaryData::sizes,
|
||||||
ElementsAre(QSize{20, 11})),
|
ElementsAre(QSize{20, 11})),
|
||||||
Field(&FontCollectorSizesAuxiliaryData::colorName, Eq(u"color")),
|
Field("FontCollectorSizesAuxiliaryData::colorName", &FontCollectorSizesAuxiliaryData::colorName, Eq(u"color")),
|
||||||
Field(&FontCollectorSizesAuxiliaryData::text, Eq(u"some text")))),
|
Field("FontCollectorSizesAuxiliaryData::text", &FontCollectorSizesAuxiliaryData::text, Eq(u"some text")))),
|
||||||
_,
|
_,
|
||||||
_,
|
_,
|
||||||
_))
|
_))
|
||||||
|
@@ -90,9 +90,9 @@ TEST_F(ImageCacheDispatchCollector, call_qml_collector_start)
|
|||||||
start(Eq("foo.qml"),
|
start(Eq("foo.qml"),
|
||||||
Eq("state"),
|
Eq("state"),
|
||||||
VariantWith<FontCollectorSizesAuxiliaryData>(
|
VariantWith<FontCollectorSizesAuxiliaryData>(
|
||||||
AllOf(Field(&FontCollectorSizesAuxiliaryData::sizes,
|
AllOf(Field("FontCollectorSizesAuxiliaryData::sizes", &FontCollectorSizesAuxiliaryData::sizes,
|
||||||
ElementsAre(QSize{20, 11})),
|
ElementsAre(QSize{20, 11})),
|
||||||
Field(&FontCollectorSizesAuxiliaryData::colorName, Eq(u"color")))),
|
Field("FontCollectorSizesAuxiliaryData::colorName", &FontCollectorSizesAuxiliaryData::colorName, Eq(u"color")))),
|
||||||
_,
|
_,
|
||||||
_,
|
_,
|
||||||
_))
|
_))
|
||||||
@@ -128,9 +128,9 @@ TEST_F(ImageCacheDispatchCollector, call_ui_file_collector_start)
|
|||||||
start(Eq("foo.ui.qml"),
|
start(Eq("foo.ui.qml"),
|
||||||
Eq("state"),
|
Eq("state"),
|
||||||
VariantWith<FontCollectorSizesAuxiliaryData>(
|
VariantWith<FontCollectorSizesAuxiliaryData>(
|
||||||
AllOf(Field(&FontCollectorSizesAuxiliaryData::sizes,
|
AllOf(Field("FontCollectorSizesAuxiliaryData::sizes", &FontCollectorSizesAuxiliaryData::sizes,
|
||||||
ElementsAre(QSize{20, 11})),
|
ElementsAre(QSize{20, 11})),
|
||||||
Field(&FontCollectorSizesAuxiliaryData::colorName, Eq(u"color")))),
|
Field("FontCollectorSizesAuxiliaryData::colorName", &FontCollectorSizesAuxiliaryData::colorName, Eq(u"color")))),
|
||||||
_,
|
_,
|
||||||
_,
|
_,
|
||||||
_))
|
_))
|
||||||
@@ -206,9 +206,9 @@ TEST_F(ImageCacheDispatchCollector, first_collector_create_icon_calls)
|
|||||||
createIcon(Eq("foo.ui.qml"),
|
createIcon(Eq("foo.ui.qml"),
|
||||||
Eq("state"),
|
Eq("state"),
|
||||||
VariantWith<FontCollectorSizesAuxiliaryData>(
|
VariantWith<FontCollectorSizesAuxiliaryData>(
|
||||||
AllOf(Field(&FontCollectorSizesAuxiliaryData::sizes,
|
AllOf(Field("FontCollectorSizesAuxiliaryData::sizes", &FontCollectorSizesAuxiliaryData::sizes,
|
||||||
ElementsAre(QSize{20, 11})),
|
ElementsAre(QSize{20, 11})),
|
||||||
Field(&FontCollectorSizesAuxiliaryData::colorName,
|
Field("FontCollectorSizesAuxiliaryData::colorName", &FontCollectorSizesAuxiliaryData::colorName,
|
||||||
Eq(u"color"))))));
|
Eq(u"color"))))));
|
||||||
EXPECT_CALL(collectorMock2, createIcon(_, _, _)).Times(0);
|
EXPECT_CALL(collectorMock2, createIcon(_, _, _)).Times(0);
|
||||||
|
|
||||||
@@ -252,9 +252,9 @@ TEST_F(ImageCacheDispatchCollector, second_collector_create_icon_calls)
|
|||||||
createIcon(Eq("foo.qml"),
|
createIcon(Eq("foo.qml"),
|
||||||
Eq("state"),
|
Eq("state"),
|
||||||
VariantWith<FontCollectorSizesAuxiliaryData>(
|
VariantWith<FontCollectorSizesAuxiliaryData>(
|
||||||
AllOf(Field(&FontCollectorSizesAuxiliaryData::sizes,
|
AllOf(Field("FontCollectorSizesAuxiliaryData::sizes", &FontCollectorSizesAuxiliaryData::sizes,
|
||||||
ElementsAre(QSize{20, 11})),
|
ElementsAre(QSize{20, 11})),
|
||||||
Field(&FontCollectorSizesAuxiliaryData::colorName,
|
Field("FontCollectorSizesAuxiliaryData::colorName", &FontCollectorSizesAuxiliaryData::colorName,
|
||||||
Eq(u"color"))))));
|
Eq(u"color"))))));
|
||||||
EXPECT_CALL(collectorMock1, createIcon(_, _, _)).Times(0);
|
EXPECT_CALL(collectorMock1, createIcon(_, _, _)).Times(0);
|
||||||
|
|
||||||
@@ -317,9 +317,9 @@ TEST_F(ImageCacheDispatchCollector, first_collector_create_image_calls)
|
|||||||
createImage(Eq("foo.ui.qml"),
|
createImage(Eq("foo.ui.qml"),
|
||||||
Eq("state"),
|
Eq("state"),
|
||||||
VariantWith<FontCollectorSizesAuxiliaryData>(
|
VariantWith<FontCollectorSizesAuxiliaryData>(
|
||||||
AllOf(Field(&FontCollectorSizesAuxiliaryData::sizes,
|
AllOf(Field("FontCollectorSizesAuxiliaryData::sizes", &FontCollectorSizesAuxiliaryData::sizes,
|
||||||
ElementsAre(QSize{20, 11})),
|
ElementsAre(QSize{20, 11})),
|
||||||
Field(&FontCollectorSizesAuxiliaryData::colorName,
|
Field("FontCollectorSizesAuxiliaryData::colorName", &FontCollectorSizesAuxiliaryData::colorName,
|
||||||
Eq(u"color"))))));
|
Eq(u"color"))))));
|
||||||
EXPECT_CALL(collectorMock2, createImage(_, _, _)).Times(0);
|
EXPECT_CALL(collectorMock2, createImage(_, _, _)).Times(0);
|
||||||
|
|
||||||
@@ -363,9 +363,9 @@ TEST_F(ImageCacheDispatchCollector, second_collector_create_image_calls)
|
|||||||
createImage(Eq("foo.qml"),
|
createImage(Eq("foo.qml"),
|
||||||
Eq("state"),
|
Eq("state"),
|
||||||
VariantWith<FontCollectorSizesAuxiliaryData>(
|
VariantWith<FontCollectorSizesAuxiliaryData>(
|
||||||
AllOf(Field(&FontCollectorSizesAuxiliaryData::sizes,
|
AllOf(Field("FontCollectorSizesAuxiliaryData::sizes", &FontCollectorSizesAuxiliaryData::sizes,
|
||||||
ElementsAre(QSize{20, 11})),
|
ElementsAre(QSize{20, 11})),
|
||||||
Field(&FontCollectorSizesAuxiliaryData::colorName,
|
Field("FontCollectorSizesAuxiliaryData::colorName", &FontCollectorSizesAuxiliaryData::colorName,
|
||||||
Eq(u"color"))))));
|
Eq(u"color"))))));
|
||||||
EXPECT_CALL(collectorMock1, createImage(_, _, _)).Times(0);
|
EXPECT_CALL(collectorMock1, createImage(_, _, _)).Times(0);
|
||||||
|
|
||||||
|
@@ -421,9 +421,9 @@ TEST_F(ImageCacheGenerator, calls_collector_with_auxiliary_data)
|
|||||||
start(Eq("name"),
|
start(Eq("name"),
|
||||||
_,
|
_,
|
||||||
VariantWith<FontCollectorSizesAuxiliaryData>(
|
VariantWith<FontCollectorSizesAuxiliaryData>(
|
||||||
AllOf(Field(&FontCollectorSizesAuxiliaryData::sizes,
|
AllOf(Field("FontCollectorSizesAuxiliaryData::sizes", &FontCollectorSizesAuxiliaryData::sizes,
|
||||||
ElementsAre(QSize{20, 11})),
|
ElementsAre(QSize{20, 11})),
|
||||||
Field(&FontCollectorSizesAuxiliaryData::colorName, Eq(u"color")))),
|
Field("FontCollectorSizesAuxiliaryData::colorName", &FontCollectorSizesAuxiliaryData::colorName, Eq(u"color")))),
|
||||||
_,
|
_,
|
||||||
_,
|
_,
|
||||||
_))
|
_))
|
||||||
|
@@ -240,9 +240,9 @@ TEST_F(SynchronousImageCache, icon_calls_collector_with_auxiliary_data)
|
|||||||
createIcon(Eq("/path/to/Component.qml"),
|
createIcon(Eq("/path/to/Component.qml"),
|
||||||
Eq("extraId1"),
|
Eq("extraId1"),
|
||||||
VariantWith<FontCollectorSizesAuxiliaryData>(
|
VariantWith<FontCollectorSizesAuxiliaryData>(
|
||||||
AllOf(Field(&FontCollectorSizesAuxiliaryData::sizes,
|
AllOf(Field("FontCollectorSizesAuxiliaryData::sizes", &FontCollectorSizesAuxiliaryData::sizes,
|
||||||
ElementsAre(QSize{20, 11})),
|
ElementsAre(QSize{20, 11})),
|
||||||
Field(&FontCollectorSizesAuxiliaryData::colorName,
|
Field("FontCollectorSizesAuxiliaryData::colorName", &FontCollectorSizesAuxiliaryData::colorName,
|
||||||
Eq(u"color"))))));
|
Eq(u"color"))))));
|
||||||
|
|
||||||
auto icon = cache.icon("/path/to/Component.qml",
|
auto icon = cache.icon("/path/to/Component.qml",
|
||||||
@@ -261,9 +261,9 @@ TEST_F(SynchronousImageCache, image_calls_collector_with_auxiliary_data)
|
|||||||
createImage(Eq("/path/to/Component.qml"),
|
createImage(Eq("/path/to/Component.qml"),
|
||||||
Eq("extraId1"),
|
Eq("extraId1"),
|
||||||
VariantWith<FontCollectorSizesAuxiliaryData>(
|
VariantWith<FontCollectorSizesAuxiliaryData>(
|
||||||
AllOf(Field(&FontCollectorSizesAuxiliaryData::sizes,
|
AllOf(Field("FontCollectorSizesAuxiliaryData::sizes", &FontCollectorSizesAuxiliaryData::sizes,
|
||||||
ElementsAre(QSize{20, 11})),
|
ElementsAre(QSize{20, 11})),
|
||||||
Field(&FontCollectorSizesAuxiliaryData::colorName,
|
Field("FontCollectorSizesAuxiliaryData::colorName", &FontCollectorSizesAuxiliaryData::colorName,
|
||||||
Eq(u"color"))))));
|
Eq(u"color"))))));
|
||||||
|
|
||||||
auto icon = cache.image("/path/to/Component.qml",
|
auto icon = cache.image("/path/to/Component.qml",
|
||||||
@@ -282,9 +282,9 @@ TEST_F(SynchronousImageCache, small_image_calls_collector_with_auxiliary_data)
|
|||||||
createImage(Eq("/path/to/Component.qml"),
|
createImage(Eq("/path/to/Component.qml"),
|
||||||
Eq("extraId1"),
|
Eq("extraId1"),
|
||||||
VariantWith<FontCollectorSizesAuxiliaryData>(
|
VariantWith<FontCollectorSizesAuxiliaryData>(
|
||||||
AllOf(Field(&FontCollectorSizesAuxiliaryData::sizes,
|
AllOf(Field("FontCollectorSizesAuxiliaryData::sizes", &FontCollectorSizesAuxiliaryData::sizes,
|
||||||
ElementsAre(QSize{20, 11})),
|
ElementsAre(QSize{20, 11})),
|
||||||
Field(&FontCollectorSizesAuxiliaryData::colorName,
|
Field("FontCollectorSizesAuxiliaryData::colorName", &FontCollectorSizesAuxiliaryData::colorName,
|
||||||
Eq(u"color"))))));
|
Eq(u"color"))))));
|
||||||
|
|
||||||
auto icon = cache.smallImage("/path/to/Component.qml",
|
auto icon = cache.smallImage("/path/to/Component.qml",
|
||||||
|
@@ -21,7 +21,7 @@ struct Task
|
|||||||
template<typename Matcher>
|
template<typename Matcher>
|
||||||
auto IsTask(Matcher matcher)
|
auto IsTask(Matcher matcher)
|
||||||
{
|
{
|
||||||
return Field(&Task::i, matcher);
|
return Field("Task::i", &Task::i, matcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
class TaskQueue : public testing::Test
|
class TaskQueue : public testing::Test
|
||||||
|
@@ -303,10 +303,10 @@ TEST_F(ListModelEditor, add_row_creates_new_model_node_and_reparents)
|
|||||||
{
|
{
|
||||||
model.setListModel(listModelNode);
|
model.setListModel(listModelNode);
|
||||||
|
|
||||||
EXPECT_CALL(mockView, nodeCreated(Property(&ModelNode::type, Eq("ListElement"))));
|
EXPECT_CALL(mockView, nodeCreated(Property("ModelNode::type", &ModelNode::type, Eq("ListElement"))));
|
||||||
EXPECT_CALL(mockView,
|
EXPECT_CALL(mockView,
|
||||||
nodeReparented(Property(&ModelNode::type, Eq("ListElement")),
|
nodeReparented(Property("ModelNode::type", &ModelNode::type, Eq("ListElement")),
|
||||||
Property(&AbstractProperty::parentModelNode, Eq(listModelNode)),
|
Property("AbstractProperty::parentModelNode", &AbstractProperty::parentModelNode, Eq(listModelNode)),
|
||||||
_,
|
_,
|
||||||
_));
|
_));
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@ using QmlDesigner::Storage::TypeTraitsKind;
|
|||||||
template<typename Matcher>
|
template<typename Matcher>
|
||||||
auto PropertyId(const Matcher &matcher)
|
auto PropertyId(const Matcher &matcher)
|
||||||
{
|
{
|
||||||
return Property(&QmlDesigner::PropertyMetaInfo::id, matcher);
|
return Property("QmlDesigner::PropertyMetaInfo::id", &QmlDesigner::PropertyMetaInfo::id, matcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename PropertyMatcher, typename ParentPropertyMatcher, typename NameMatcher>
|
template<typename PropertyMatcher, typename ParentPropertyMatcher, typename NameMatcher>
|
||||||
@@ -32,9 +32,15 @@ auto CompoundProperty(const PropertyMatcher &propertyMatcher,
|
|||||||
const ParentPropertyMatcher &parentPropertyMatcher,
|
const ParentPropertyMatcher &parentPropertyMatcher,
|
||||||
const NameMatcher &nameMatcher)
|
const NameMatcher &nameMatcher)
|
||||||
{
|
{
|
||||||
return AllOf(Field(&QmlDesigner::CompoundPropertyMetaInfo::property, propertyMatcher),
|
return AllOf(Field("QmlDesigner::CompoundPropertyMetaInfo::property",
|
||||||
Field(&QmlDesigner::CompoundPropertyMetaInfo::parent, parentPropertyMatcher),
|
&QmlDesigner::CompoundPropertyMetaInfo::property,
|
||||||
Property(&QmlDesigner::CompoundPropertyMetaInfo::name, nameMatcher));
|
propertyMatcher),
|
||||||
|
Field("QmlDesigner::CompoundPropertyMetaInfo::parent",
|
||||||
|
&QmlDesigner::CompoundPropertyMetaInfo::parent,
|
||||||
|
parentPropertyMatcher),
|
||||||
|
Property("QmlDesigner::CompoundPropertyMetaInfo::name",
|
||||||
|
&QmlDesigner::CompoundPropertyMetaInfo::name,
|
||||||
|
nameMatcher));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename PropertyIdMatcher, typename ParentPropertyIdMatcher, typename NameMatcher>
|
template<typename PropertyIdMatcher, typename ParentPropertyIdMatcher, typename NameMatcher>
|
||||||
|
@@ -19,8 +19,8 @@ using QmlDesigner::ModelNode;
|
|||||||
template<typename NameMatcher>
|
template<typename NameMatcher>
|
||||||
auto AuxiliaryProperty(AuxiliaryDataType type, const NameMatcher &nameMatcher, const QVariant &value)
|
auto AuxiliaryProperty(AuxiliaryDataType type, const NameMatcher &nameMatcher, const QVariant &value)
|
||||||
{
|
{
|
||||||
return Pair(AllOf(Field(&AuxiliaryDataKey::type, type),
|
return Pair(AllOf(Field("AuxiliaryDataKey::type", &AuxiliaryDataKey::type, type),
|
||||||
Field(&AuxiliaryDataKey::name, nameMatcher)),
|
Field("AuxiliaryDataKey::name", &AuxiliaryDataKey::name, nameMatcher)),
|
||||||
value);
|
value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,13 +15,13 @@ QLatin1String qmlModulesPath(UNITTEST_DIR "/projectstorage/data/qml");
|
|||||||
template<typename Matcher>
|
template<typename Matcher>
|
||||||
auto UrlProperty(const Matcher &matcher)
|
auto UrlProperty(const Matcher &matcher)
|
||||||
{
|
{
|
||||||
return Property(&QmlDesigner::Import::url, matcher);
|
return Property("QmlDesigner::Import::url", &QmlDesigner::Import::url, matcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Matcher>
|
template<typename Matcher>
|
||||||
auto VersionProperty(const Matcher &matcher)
|
auto VersionProperty(const Matcher &matcher)
|
||||||
{
|
{
|
||||||
return Property(&QmlDesigner::Import::version, matcher);
|
return Property("QmlDesigner::Import::version", &QmlDesigner::Import::version, matcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Matcher>
|
template<typename Matcher>
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -313,9 +313,9 @@ TEST_F(QmlDocumentParser, functions)
|
|||||||
ASSERT_THAT(type.functionDeclarations,
|
ASSERT_THAT(type.functionDeclarations,
|
||||||
UnorderedElementsAre(
|
UnorderedElementsAre(
|
||||||
AllOf(IsFunctionDeclaration("otherFunction", ""),
|
AllOf(IsFunctionDeclaration("otherFunction", ""),
|
||||||
Field(&Synchronization::FunctionDeclaration::parameters, IsEmpty())),
|
Field("Synchronization::FunctionDeclaration::parameters", &Synchronization::FunctionDeclaration::parameters, IsEmpty())),
|
||||||
AllOf(IsFunctionDeclaration("someScript", ""),
|
AllOf(IsFunctionDeclaration("someScript", ""),
|
||||||
Field(&Synchronization::FunctionDeclaration::parameters,
|
Field("Synchronization::FunctionDeclaration::parameters", &Synchronization::FunctionDeclaration::parameters,
|
||||||
ElementsAre(IsParameter("x", ""), IsParameter("y", ""))))));
|
ElementsAre(IsParameter("x", ""), IsParameter("y", ""))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,10 +331,10 @@ TEST_F(QmlDocumentParser, signals)
|
|||||||
ASSERT_THAT(type.signalDeclarations,
|
ASSERT_THAT(type.signalDeclarations,
|
||||||
UnorderedElementsAre(
|
UnorderedElementsAre(
|
||||||
AllOf(IsSignalDeclaration("someSignal"),
|
AllOf(IsSignalDeclaration("someSignal"),
|
||||||
Field(&Synchronization::SignalDeclaration::parameters,
|
Field("Synchronization::SignalDeclaration::parameters", &Synchronization::SignalDeclaration::parameters,
|
||||||
ElementsAre(IsParameter("x", "int"), IsParameter("y", "real")))),
|
ElementsAre(IsParameter("x", "int"), IsParameter("y", "real")))),
|
||||||
AllOf(IsSignalDeclaration("signal2"),
|
AllOf(IsSignalDeclaration("signal2"),
|
||||||
Field(&Synchronization::SignalDeclaration::parameters, IsEmpty()))));
|
Field("Synchronization::SignalDeclaration::parameters", &Synchronization::SignalDeclaration::parameters, IsEmpty()))));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(QmlDocumentParser, enumeration)
|
TEST_F(QmlDocumentParser, enumeration)
|
||||||
@@ -348,13 +348,13 @@ TEST_F(QmlDocumentParser, enumeration)
|
|||||||
ASSERT_THAT(type.enumerationDeclarations,
|
ASSERT_THAT(type.enumerationDeclarations,
|
||||||
UnorderedElementsAre(
|
UnorderedElementsAre(
|
||||||
AllOf(IsEnumeration("Color"),
|
AllOf(IsEnumeration("Color"),
|
||||||
Field(&Synchronization::EnumerationDeclaration::enumeratorDeclarations,
|
Field("Synchronization::EnumerationDeclaration::enumeratorDeclarations", &Synchronization::EnumerationDeclaration::enumeratorDeclarations,
|
||||||
ElementsAre(IsEnumerator("red", 0),
|
ElementsAre(IsEnumerator("red", 0),
|
||||||
IsEnumerator("green", 1),
|
IsEnumerator("green", 1),
|
||||||
IsEnumerator("blue", 10),
|
IsEnumerator("blue", 10),
|
||||||
IsEnumerator("white", 11)))),
|
IsEnumerator("white", 11)))),
|
||||||
AllOf(IsEnumeration("State"),
|
AllOf(IsEnumeration("State"),
|
||||||
Field(&Synchronization::EnumerationDeclaration::enumeratorDeclarations,
|
Field("Synchronization::EnumerationDeclaration::enumeratorDeclarations", &Synchronization::EnumerationDeclaration::enumeratorDeclarations,
|
||||||
ElementsAre(IsEnumerator("On", 0), IsEnumerator("Off", 1))))));
|
ElementsAre(IsEnumerator("On", 0), IsEnumerator("Off", 1))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -80,7 +80,7 @@ MATCHER_P(IsSingleton, value, std::string(negation ? "isn't singleton " : "is si
|
|||||||
template<typename Matcher>
|
template<typename Matcher>
|
||||||
auto IsTypeTrait(const Matcher &matcher)
|
auto IsTypeTrait(const Matcher &matcher)
|
||||||
{
|
{
|
||||||
return Field(&Synchronization::Type::traits, matcher);
|
return Field("Synchronization::Type::traits", &Synchronization::Type::traits, matcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
MATCHER_P3(IsPropertyDeclaration,
|
MATCHER_P3(IsPropertyDeclaration,
|
||||||
@@ -382,7 +382,7 @@ TEST_F(QmlTypesParser, properties_with_qualified_types)
|
|||||||
|
|
||||||
ASSERT_THAT(types,
|
ASSERT_THAT(types,
|
||||||
Contains(
|
Contains(
|
||||||
Field(&Synchronization::Type::propertyDeclarations,
|
Field("Synchronization::Type::propertyDeclarations", &Synchronization::Type::propertyDeclarations,
|
||||||
UnorderedElementsAre(
|
UnorderedElementsAre(
|
||||||
IsPropertyDeclaration("values",
|
IsPropertyDeclaration("values",
|
||||||
Synchronization::ImportedType{"Qt::Vector"},
|
Synchronization::ImportedType{"Qt::Vector"},
|
||||||
@@ -408,7 +408,7 @@ TEST_F(QmlTypesParser, properties_without_type)
|
|||||||
|
|
||||||
ASSERT_THAT(types,
|
ASSERT_THAT(types,
|
||||||
ElementsAre(
|
ElementsAre(
|
||||||
Field(&Synchronization::Type::propertyDeclarations,
|
Field("Synchronization::Type::propertyDeclarations", &Synchronization::Type::propertyDeclarations,
|
||||||
UnorderedElementsAre(
|
UnorderedElementsAre(
|
||||||
IsPropertyDeclaration("target",
|
IsPropertyDeclaration("target",
|
||||||
Synchronization::ImportedType{"QObject"},
|
Synchronization::ImportedType{"QObject"},
|
||||||
@@ -444,17 +444,17 @@ TEST_F(QmlTypesParser, functions)
|
|||||||
&Synchronization::Type::functionDeclarations,
|
&Synchronization::Type::functionDeclarations,
|
||||||
UnorderedElementsAre(
|
UnorderedElementsAre(
|
||||||
AllOf(IsFunctionDeclaration("advance", ""),
|
AllOf(IsFunctionDeclaration("advance", ""),
|
||||||
Field(&Synchronization::FunctionDeclaration::parameters,
|
Field("Synchronization::FunctionDeclaration::parameters", &Synchronization::FunctionDeclaration::parameters,
|
||||||
UnorderedElementsAre(IsParameter("frames", "int"),
|
UnorderedElementsAre(IsParameter("frames", "int"),
|
||||||
IsParameter("fps", "double")))),
|
IsParameter("fps", "double")))),
|
||||||
AllOf(IsFunctionDeclaration("isImageLoading", "bool"),
|
AllOf(IsFunctionDeclaration("isImageLoading", "bool"),
|
||||||
Field(&Synchronization::FunctionDeclaration::parameters,
|
Field("Synchronization::FunctionDeclaration::parameters", &Synchronization::FunctionDeclaration::parameters,
|
||||||
UnorderedElementsAre(IsParameter("url", "QUrl")))),
|
UnorderedElementsAre(IsParameter("url", "QUrl")))),
|
||||||
AllOf(IsFunctionDeclaration("getContext", ""),
|
AllOf(IsFunctionDeclaration("getContext", ""),
|
||||||
Field(&Synchronization::FunctionDeclaration::parameters,
|
Field("Synchronization::FunctionDeclaration::parameters", &Synchronization::FunctionDeclaration::parameters,
|
||||||
UnorderedElementsAre(IsParameter("args", "QQmlV4Function")))),
|
UnorderedElementsAre(IsParameter("args", "QQmlV4Function")))),
|
||||||
AllOf(IsFunctionDeclaration("movieUpdate", ""),
|
AllOf(IsFunctionDeclaration("movieUpdate", ""),
|
||||||
Field(&Synchronization::FunctionDeclaration::parameters, IsEmpty()))))));
|
Field("Synchronization::FunctionDeclaration::parameters", &Synchronization::FunctionDeclaration::parameters, IsEmpty()))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(QmlTypesParser, skip_java_script_functions)
|
TEST_F(QmlTypesParser, skip_java_script_functions)
|
||||||
@@ -470,7 +470,7 @@ TEST_F(QmlTypesParser, skip_java_script_functions)
|
|||||||
|
|
||||||
parser.parse(source, imports, types, directoryInfo);
|
parser.parse(source, imports, types, directoryInfo);
|
||||||
|
|
||||||
ASSERT_THAT(types, ElementsAre(Field(&Synchronization::Type::functionDeclarations, IsEmpty())));
|
ASSERT_THAT(types, ElementsAre(Field("Synchronization::Type::functionDeclarations", &Synchronization::Type::functionDeclarations, IsEmpty())));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(QmlTypesParser, functions_with_qualified_types)
|
TEST_F(QmlTypesParser, functions_with_qualified_types)
|
||||||
@@ -492,10 +492,10 @@ TEST_F(QmlTypesParser, functions_with_qualified_types)
|
|||||||
|
|
||||||
ASSERT_THAT(types,
|
ASSERT_THAT(types,
|
||||||
Contains(
|
Contains(
|
||||||
Field(&Synchronization::Type::functionDeclarations,
|
Field("Synchronization::Type::functionDeclarations", &Synchronization::Type::functionDeclarations,
|
||||||
UnorderedElementsAre(AllOf(
|
UnorderedElementsAre(AllOf(
|
||||||
IsFunctionDeclaration("values", ""),
|
IsFunctionDeclaration("values", ""),
|
||||||
Field(&Synchronization::FunctionDeclaration::parameters,
|
Field("Synchronization::FunctionDeclaration::parameters", &Synchronization::FunctionDeclaration::parameters,
|
||||||
UnorderedElementsAre(IsParameter("values", "Qt::Vector"),
|
UnorderedElementsAre(IsParameter("values", "Qt::Vector"),
|
||||||
IsParameter("items", "Qt::List"),
|
IsParameter("items", "Qt::List"),
|
||||||
IsParameter("values2", "Qt::Vector"))))))));
|
IsParameter("values2", "Qt::Vector"))))))));
|
||||||
@@ -526,17 +526,17 @@ TEST_F(QmlTypesParser, signals)
|
|||||||
parser.parse(source, imports, types, directoryInfo);
|
parser.parse(source, imports, types, directoryInfo);
|
||||||
|
|
||||||
ASSERT_THAT(types,
|
ASSERT_THAT(types,
|
||||||
ElementsAre(Field(&Synchronization::Type::signalDeclarations,
|
ElementsAre(Field("Synchronization::Type::signalDeclarations", &Synchronization::Type::signalDeclarations,
|
||||||
UnorderedElementsAre(
|
UnorderedElementsAre(
|
||||||
AllOf(IsSignalDeclaration("advance"),
|
AllOf(IsSignalDeclaration("advance"),
|
||||||
Field(&Synchronization::SignalDeclaration::parameters,
|
Field("Synchronization::SignalDeclaration::parameters", &Synchronization::SignalDeclaration::parameters,
|
||||||
UnorderedElementsAre(IsParameter("frames", "int"),
|
UnorderedElementsAre(IsParameter("frames", "int"),
|
||||||
IsParameter("fps", "double")))),
|
IsParameter("fps", "double")))),
|
||||||
AllOf(IsSignalDeclaration("isImageLoading"),
|
AllOf(IsSignalDeclaration("isImageLoading"),
|
||||||
Field(&Synchronization::SignalDeclaration::parameters,
|
Field("Synchronization::SignalDeclaration::parameters", &Synchronization::SignalDeclaration::parameters,
|
||||||
UnorderedElementsAre(IsParameter("url", "QUrl")))),
|
UnorderedElementsAre(IsParameter("url", "QUrl")))),
|
||||||
AllOf(IsSignalDeclaration("getContext"),
|
AllOf(IsSignalDeclaration("getContext"),
|
||||||
Field(&Synchronization::SignalDeclaration::parameters,
|
Field("Synchronization::SignalDeclaration::parameters", &Synchronization::SignalDeclaration::parameters,
|
||||||
UnorderedElementsAre(
|
UnorderedElementsAre(
|
||||||
IsParameter("args", "QQmlV4Function"))))))));
|
IsParameter("args", "QQmlV4Function"))))))));
|
||||||
}
|
}
|
||||||
@@ -560,10 +560,10 @@ TEST_F(QmlTypesParser, signals_with_qualified_types)
|
|||||||
|
|
||||||
ASSERT_THAT(types,
|
ASSERT_THAT(types,
|
||||||
Contains(
|
Contains(
|
||||||
Field(&Synchronization::Type::signalDeclarations,
|
Field("Synchronization::Type::signalDeclarations", &Synchronization::Type::signalDeclarations,
|
||||||
UnorderedElementsAre(AllOf(
|
UnorderedElementsAre(AllOf(
|
||||||
IsSignalDeclaration("values"),
|
IsSignalDeclaration("values"),
|
||||||
Field(&Synchronization::SignalDeclaration::parameters,
|
Field("Synchronization::SignalDeclaration::parameters", &Synchronization::SignalDeclaration::parameters,
|
||||||
UnorderedElementsAre(IsParameter("values", "Qt::Vector"),
|
UnorderedElementsAre(IsParameter("values", "Qt::Vector"),
|
||||||
IsParameter("items", "Qt::List"),
|
IsParameter("items", "Qt::List"),
|
||||||
IsParameter("values2", "Qt::Vector"))))))));
|
IsParameter("values2", "Qt::Vector"))))))));
|
||||||
@@ -596,13 +596,13 @@ TEST_F(QmlTypesParser, enumerations)
|
|||||||
&Synchronization::Type::enumerationDeclarations,
|
&Synchronization::Type::enumerationDeclarations,
|
||||||
UnorderedElementsAre(
|
UnorderedElementsAre(
|
||||||
AllOf(IsEnumeration("NamedColorSpace"),
|
AllOf(IsEnumeration("NamedColorSpace"),
|
||||||
Field(&Synchronization::EnumerationDeclaration::enumeratorDeclarations,
|
Field("Synchronization::EnumerationDeclaration::enumeratorDeclarations", &Synchronization::EnumerationDeclaration::enumeratorDeclarations,
|
||||||
UnorderedElementsAre(IsEnumerator("Unknown"),
|
UnorderedElementsAre(IsEnumerator("Unknown"),
|
||||||
IsEnumerator("SRgb"),
|
IsEnumerator("SRgb"),
|
||||||
IsEnumerator("AdobeRgb"),
|
IsEnumerator("AdobeRgb"),
|
||||||
IsEnumerator("DisplayP3")))),
|
IsEnumerator("DisplayP3")))),
|
||||||
AllOf(IsEnumeration("VerticalLayoutDirection"),
|
AllOf(IsEnumeration("VerticalLayoutDirection"),
|
||||||
Field(&Synchronization::EnumerationDeclaration::enumeratorDeclarations,
|
Field("Synchronization::EnumerationDeclaration::enumeratorDeclarations", &Synchronization::EnumerationDeclaration::enumeratorDeclarations,
|
||||||
UnorderedElementsAre(IsEnumerator("TopToBottom"),
|
UnorderedElementsAre(IsEnumerator("TopToBottom"),
|
||||||
IsEnumerator("BottomToTop"))))))));
|
IsEnumerator("BottomToTop"))))))));
|
||||||
}
|
}
|
||||||
@@ -640,7 +640,7 @@ TEST_F(QmlTypesParser, enumeration_is_exported_as_type)
|
|||||||
Synchronization::ImportedType{},
|
Synchronization::ImportedType{},
|
||||||
traits,
|
traits,
|
||||||
qmltypesFileSourceId),
|
qmltypesFileSourceId),
|
||||||
Field(&Synchronization::Type::exportedTypes,
|
Field("Synchronization::Type::exportedTypes", &Synchronization::Type::exportedTypes,
|
||||||
UnorderedElementsAre(IsExportedType(qtQmlNativeModuleId,
|
UnorderedElementsAre(IsExportedType(qtQmlNativeModuleId,
|
||||||
"QObject::NamedColorSpace",
|
"QObject::NamedColorSpace",
|
||||||
QmlDesigner::Storage::Version{})))),
|
QmlDesigner::Storage::Version{})))),
|
||||||
@@ -649,7 +649,7 @@ TEST_F(QmlTypesParser, enumeration_is_exported_as_type)
|
|||||||
Synchronization::ImportedType{},
|
Synchronization::ImportedType{},
|
||||||
traits,
|
traits,
|
||||||
qmltypesFileSourceId),
|
qmltypesFileSourceId),
|
||||||
Field(&Synchronization::Type::exportedTypes,
|
Field("Synchronization::Type::exportedTypes", &Synchronization::Type::exportedTypes,
|
||||||
UnorderedElementsAre(IsExportedType(qtQmlNativeModuleId,
|
UnorderedElementsAre(IsExportedType(qtQmlNativeModuleId,
|
||||||
"QObject::VerticalLayoutDirection",
|
"QObject::VerticalLayoutDirection",
|
||||||
QmlDesigner::Storage::Version{})))),
|
QmlDesigner::Storage::Version{})))),
|
||||||
@@ -685,7 +685,7 @@ TEST_F(QmlTypesParser, enumeration_is_exported_as_type_with_alias)
|
|||||||
Synchronization::ImportedType{},
|
Synchronization::ImportedType{},
|
||||||
traits,
|
traits,
|
||||||
qmltypesFileSourceId),
|
qmltypesFileSourceId),
|
||||||
Field(&Synchronization::Type::exportedTypes,
|
Field("Synchronization::Type::exportedTypes", &Synchronization::Type::exportedTypes,
|
||||||
UnorderedElementsAre(IsExportedType(qtQmlNativeModuleId,
|
UnorderedElementsAre(IsExportedType(qtQmlNativeModuleId,
|
||||||
"QObject::NamedColorSpace",
|
"QObject::NamedColorSpace",
|
||||||
QmlDesigner::Storage::Version{}),
|
QmlDesigner::Storage::Version{}),
|
||||||
@@ -733,7 +733,7 @@ TEST_F(QmlTypesParser, enumeration_is_exported_as_type_with_alias_too)
|
|||||||
Synchronization::ImportedType{},
|
Synchronization::ImportedType{},
|
||||||
traits,
|
traits,
|
||||||
qmltypesFileSourceId),
|
qmltypesFileSourceId),
|
||||||
Field(&Synchronization::Type::exportedTypes,
|
Field("Synchronization::Type::exportedTypes", &Synchronization::Type::exportedTypes,
|
||||||
UnorderedElementsAre(IsExportedType(qtQmlNativeModuleId,
|
UnorderedElementsAre(IsExportedType(qtQmlNativeModuleId,
|
||||||
"QObject::NamedColorSpace",
|
"QObject::NamedColorSpace",
|
||||||
QmlDesigner::Storage::Version{}),
|
QmlDesigner::Storage::Version{}),
|
||||||
@@ -763,7 +763,7 @@ TEST_F(QmlTypesParser, enumeration_is_referenced_by_qualified_name)
|
|||||||
parser.parse(source, imports, types, directoryInfo);
|
parser.parse(source, imports, types, directoryInfo);
|
||||||
|
|
||||||
ASSERT_THAT(types,
|
ASSERT_THAT(types,
|
||||||
Contains(Field(&Synchronization::Type::propertyDeclarations,
|
Contains(Field("Synchronization::Type::propertyDeclarations", &Synchronization::Type::propertyDeclarations,
|
||||||
ElementsAre(IsPropertyDeclaration(
|
ElementsAre(IsPropertyDeclaration(
|
||||||
"colorSpace",
|
"colorSpace",
|
||||||
Synchronization::ImportedType{"QObject::NamedColorSpace"},
|
Synchronization::ImportedType{"QObject::NamedColorSpace"},
|
||||||
@@ -791,7 +791,7 @@ TEST_F(QmlTypesParser, alias_enumeration_is_referenced_by_qualified_name)
|
|||||||
parser.parse(source, imports, types, directoryInfo);
|
parser.parse(source, imports, types, directoryInfo);
|
||||||
|
|
||||||
ASSERT_THAT(types,
|
ASSERT_THAT(types,
|
||||||
Contains(Field(&Synchronization::Type::propertyDeclarations,
|
Contains(Field("Synchronization::Type::propertyDeclarations", &Synchronization::Type::propertyDeclarations,
|
||||||
ElementsAre(IsPropertyDeclaration(
|
ElementsAre(IsPropertyDeclaration(
|
||||||
"colorSpace",
|
"colorSpace",
|
||||||
Synchronization::ImportedType{"QObject::NamedColorSpaces"},
|
Synchronization::ImportedType{"QObject::NamedColorSpaces"},
|
||||||
@@ -880,7 +880,7 @@ TEST_F(QmlTypesParser, default_property)
|
|||||||
parser.parse(source, imports, types, directoryInfo);
|
parser.parse(source, imports, types, directoryInfo);
|
||||||
|
|
||||||
ASSERT_THAT(types,
|
ASSERT_THAT(types,
|
||||||
ElementsAre(Field(&Synchronization::Type::defaultPropertyName, Eq("children"))));
|
ElementsAre(Field("Synchronization::Type::defaultPropertyName", &Synchronization::Type::defaultPropertyName, Eq("children"))));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(QmlTypesParser, skip_template_item)
|
TEST_F(QmlTypesParser, skip_template_item)
|
||||||
|
@@ -27,10 +27,10 @@ protected:
|
|||||||
TEST_F(SqliteColumn, default_construct)
|
TEST_F(SqliteColumn, default_construct)
|
||||||
{
|
{
|
||||||
ASSERT_THAT(column,
|
ASSERT_THAT(column,
|
||||||
AllOf(Field(&Column::name, IsEmpty()),
|
AllOf(Field("Column::name", &Column::name, IsEmpty()),
|
||||||
Field(&Column::tableName, IsEmpty()),
|
Field("Column::tableName", &Column::tableName, IsEmpty()),
|
||||||
Field(&Column::type, ColumnType::None),
|
Field("Column::type", &Column::type, ColumnType::None),
|
||||||
Field(&Column::constraints, IsEmpty())));
|
Field("Column::constraints", &Column::constraints, IsEmpty())));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SqliteColumn, clear)
|
TEST_F(SqliteColumn, clear)
|
||||||
@@ -43,10 +43,10 @@ TEST_F(SqliteColumn, clear)
|
|||||||
column.clear();
|
column.clear();
|
||||||
|
|
||||||
ASSERT_THAT(column,
|
ASSERT_THAT(column,
|
||||||
AllOf(Field(&Column::name, IsEmpty()),
|
AllOf(Field("Column::name", &Column::name, IsEmpty()),
|
||||||
Field(&Column::tableName, IsEmpty()),
|
Field("Column::tableName", &Column::tableName, IsEmpty()),
|
||||||
Field(&Column::type, ColumnType::None),
|
Field("Column::type", &Column::type, ColumnType::None),
|
||||||
Field(&Column::constraints, IsEmpty())));
|
Field("Column::constraints", &Column::constraints, IsEmpty())));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SqliteColumn, constructor)
|
TEST_F(SqliteColumn, constructor)
|
||||||
@@ -61,16 +61,16 @@ TEST_F(SqliteColumn, constructor)
|
|||||||
Enforment::Deferred}}};
|
Enforment::Deferred}}};
|
||||||
|
|
||||||
ASSERT_THAT(column,
|
ASSERT_THAT(column,
|
||||||
AllOf(Field(&Column::name, Eq("column")),
|
AllOf(Field("Column::name", &Column::name, Eq("column")),
|
||||||
Field(&Column::tableName, Eq("table")),
|
Field("Column::tableName", &Column::tableName, Eq("table")),
|
||||||
Field(&Column::type, ColumnType::Text),
|
Field("Column::type", &Column::type, ColumnType::Text),
|
||||||
Field(&Column::constraints,
|
Field("Column::constraints", &Column::constraints,
|
||||||
ElementsAre(VariantWith<ForeignKey>(
|
ElementsAre(VariantWith<ForeignKey>(
|
||||||
AllOf(Field(&ForeignKey::table, Eq("referencedTable")),
|
AllOf(Field("ForeignKey::table", &ForeignKey::table, Eq("referencedTable")),
|
||||||
Field(&ForeignKey::column, Eq("referencedColumn")),
|
Field("ForeignKey::column", &ForeignKey::column, Eq("referencedColumn")),
|
||||||
Field(&ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
Field("ForeignKey::updateAction", &ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
||||||
Field(&ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
Field("ForeignKey::deleteAction", &ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
||||||
Field(&ForeignKey::enforcement, Enforment::Deferred)))))));
|
Field("ForeignKey::enforcement", &ForeignKey::enforcement, Enforment::Deferred)))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SqliteColumn, flat_constructor)
|
TEST_F(SqliteColumn, flat_constructor)
|
||||||
@@ -85,16 +85,16 @@ TEST_F(SqliteColumn, flat_constructor)
|
|||||||
Enforment::Deferred}}};
|
Enforment::Deferred}}};
|
||||||
|
|
||||||
ASSERT_THAT(column,
|
ASSERT_THAT(column,
|
||||||
AllOf(Field(&Column::name, Eq("column")),
|
AllOf(Field("Column::name", &Column::name, Eq("column")),
|
||||||
Field(&Column::tableName, Eq("table")),
|
Field("Column::tableName", &Column::tableName, Eq("table")),
|
||||||
Field(&Column::type, ColumnType::Text),
|
Field("Column::type", &Column::type, ColumnType::Text),
|
||||||
Field(&Column::constraints,
|
Field("Column::constraints", &Column::constraints,
|
||||||
ElementsAre(VariantWith<ForeignKey>(
|
ElementsAre(VariantWith<ForeignKey>(
|
||||||
AllOf(Field(&ForeignKey::table, Eq("referencedTable")),
|
AllOf(Field("ForeignKey::table", &ForeignKey::table, Eq("referencedTable")),
|
||||||
Field(&ForeignKey::column, Eq("referencedColumn")),
|
Field("ForeignKey::column", &ForeignKey::column, Eq("referencedColumn")),
|
||||||
Field(&ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
Field("ForeignKey::updateAction", &ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
||||||
Field(&ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
Field("ForeignKey::deleteAction", &ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
||||||
Field(&ForeignKey::enforcement, Enforment::Deferred)))))));
|
Field("ForeignKey::enforcement", &ForeignKey::enforcement, Enforment::Deferred)))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
class SqliteStrictColumn : public ::testing::Test
|
class SqliteStrictColumn : public ::testing::Test
|
||||||
@@ -108,10 +108,10 @@ protected:
|
|||||||
TEST_F(SqliteStrictColumn, default_construct)
|
TEST_F(SqliteStrictColumn, default_construct)
|
||||||
{
|
{
|
||||||
ASSERT_THAT(column,
|
ASSERT_THAT(column,
|
||||||
AllOf(Field(&Column::name, IsEmpty()),
|
AllOf(Field("Column::name", &Column::name, IsEmpty()),
|
||||||
Field(&Column::tableName, IsEmpty()),
|
Field("Column::tableName", &Column::tableName, IsEmpty()),
|
||||||
Field(&Column::type, StrictColumnType::Any),
|
Field("Column::type", &Column::type, StrictColumnType::Any),
|
||||||
Field(&Column::constraints, IsEmpty())));
|
Field("Column::constraints", &Column::constraints, IsEmpty())));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SqliteStrictColumn, clear)
|
TEST_F(SqliteStrictColumn, clear)
|
||||||
@@ -124,10 +124,10 @@ TEST_F(SqliteStrictColumn, clear)
|
|||||||
column.clear();
|
column.clear();
|
||||||
|
|
||||||
ASSERT_THAT(column,
|
ASSERT_THAT(column,
|
||||||
AllOf(Field(&Column::name, IsEmpty()),
|
AllOf(Field("Column::name", &Column::name, IsEmpty()),
|
||||||
Field(&Column::tableName, IsEmpty()),
|
Field("Column::tableName", &Column::tableName, IsEmpty()),
|
||||||
Field(&Column::type, StrictColumnType::Any),
|
Field("Column::type", &Column::type, StrictColumnType::Any),
|
||||||
Field(&Column::constraints, IsEmpty())));
|
Field("Column::constraints", &Column::constraints, IsEmpty())));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SqliteStrictColumn, constructor)
|
TEST_F(SqliteStrictColumn, constructor)
|
||||||
@@ -142,16 +142,16 @@ TEST_F(SqliteStrictColumn, constructor)
|
|||||||
Enforment::Deferred}}};
|
Enforment::Deferred}}};
|
||||||
|
|
||||||
ASSERT_THAT(column,
|
ASSERT_THAT(column,
|
||||||
AllOf(Field(&Column::name, Eq("column")),
|
AllOf(Field("Column::name", &Column::name, Eq("column")),
|
||||||
Field(&Column::tableName, Eq("table")),
|
Field("Column::tableName", &Column::tableName, Eq("table")),
|
||||||
Field(&Column::type, StrictColumnType::Text),
|
Field("Column::type", &Column::type, StrictColumnType::Text),
|
||||||
Field(&Column::constraints,
|
Field("Column::constraints", &Column::constraints,
|
||||||
ElementsAre(VariantWith<ForeignKey>(
|
ElementsAre(VariantWith<ForeignKey>(
|
||||||
AllOf(Field(&ForeignKey::table, Eq("referencedTable")),
|
AllOf(Field("ForeignKey::table", &ForeignKey::table, Eq("referencedTable")),
|
||||||
Field(&ForeignKey::column, Eq("referencedColumn")),
|
Field("ForeignKey::column", &ForeignKey::column, Eq("referencedColumn")),
|
||||||
Field(&ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
Field("ForeignKey::updateAction", &ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
||||||
Field(&ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
Field("ForeignKey::deleteAction", &ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
||||||
Field(&ForeignKey::enforcement, Enforment::Deferred)))))));
|
Field("ForeignKey::enforcement", &ForeignKey::enforcement, Enforment::Deferred)))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SqliteStrictColumn, flat_constructor)
|
TEST_F(SqliteStrictColumn, flat_constructor)
|
||||||
@@ -166,16 +166,16 @@ TEST_F(SqliteStrictColumn, flat_constructor)
|
|||||||
Enforment::Deferred}}};
|
Enforment::Deferred}}};
|
||||||
|
|
||||||
ASSERT_THAT(column,
|
ASSERT_THAT(column,
|
||||||
AllOf(Field(&Column::name, Eq("column")),
|
AllOf(Field("Column::name", &Column::name, Eq("column")),
|
||||||
Field(&Column::tableName, Eq("table")),
|
Field("Column::tableName", &Column::tableName, Eq("table")),
|
||||||
Field(&Column::type, StrictColumnType::Text),
|
Field("Column::type", &Column::type, StrictColumnType::Text),
|
||||||
Field(&Column::constraints,
|
Field("Column::constraints", &Column::constraints,
|
||||||
ElementsAre(VariantWith<ForeignKey>(
|
ElementsAre(VariantWith<ForeignKey>(
|
||||||
AllOf(Field(&ForeignKey::table, Eq("referencedTable")),
|
AllOf(Field("ForeignKey::table", &ForeignKey::table, Eq("referencedTable")),
|
||||||
Field(&ForeignKey::column, Eq("referencedColumn")),
|
Field("ForeignKey::column", &ForeignKey::column, Eq("referencedColumn")),
|
||||||
Field(&ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
Field("ForeignKey::updateAction", &ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
||||||
Field(&ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
Field("ForeignKey::deleteAction", &ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
||||||
Field(&ForeignKey::enforcement, Enforment::Deferred)))))));
|
Field("ForeignKey::enforcement", &ForeignKey::enforcement, Enforment::Deferred)))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -665,7 +665,7 @@ TEST_F(SqliteStatement, write_sqlite_blob_value)
|
|||||||
statement.write(Sqlite::Value{bytes});
|
statement.write(Sqlite::Value{bytes});
|
||||||
|
|
||||||
ASSERT_THAT(readStatement.template optionalValue<Sqlite::Blob>(),
|
ASSERT_THAT(readStatement.template optionalValue<Sqlite::Blob>(),
|
||||||
Optional(Field(&Sqlite::Blob::bytes, Eq(bytes))));
|
Optional(Field("Sqlite::Blob::bytes", &Sqlite::Blob::bytes, Eq(bytes))));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SqliteStatement, write_null_value_view)
|
TEST_F(SqliteStatement, write_null_value_view)
|
||||||
@@ -717,7 +717,7 @@ TEST_F(SqliteStatement, write_sqlite_blob_value_view)
|
|||||||
statement.write(Sqlite::ValueView::create(bytes));
|
statement.write(Sqlite::ValueView::create(bytes));
|
||||||
|
|
||||||
ASSERT_THAT(readStatement.template optionalValue<Sqlite::Blob>(),
|
ASSERT_THAT(readStatement.template optionalValue<Sqlite::Blob>(),
|
||||||
Optional(Field(&Sqlite::Blob::bytes, Eq(bytes))));
|
Optional(Field("Sqlite::Blob::bytes", &Sqlite::Blob::bytes, Eq(bytes))));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SqliteStatement, write_empty_blobs)
|
TEST_F(SqliteStatement, write_empty_blobs)
|
||||||
@@ -754,7 +754,7 @@ TEST_F(SqliteStatement, write_blobs)
|
|||||||
statement.write(bytes);
|
statement.write(bytes);
|
||||||
|
|
||||||
ASSERT_THAT(readStatement.template optionalValue<Sqlite::Blob>(),
|
ASSERT_THAT(readStatement.template optionalValue<Sqlite::Blob>(),
|
||||||
Optional(Field(&Sqlite::Blob::bytes, Eq(bytes))));
|
Optional(Field("Sqlite::Blob::bytes", &Sqlite::Blob::bytes, Eq(bytes))));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SqliteStatement, cannot_write_to_closed_database)
|
TEST_F(SqliteStatement, cannot_write_to_closed_database)
|
||||||
@@ -1145,7 +1145,7 @@ TEST_F(SqliteStatement, get_blob_values)
|
|||||||
|
|
||||||
auto values = statement.values<Sqlite::Blob>();
|
auto values = statement.values<Sqlite::Blob>();
|
||||||
|
|
||||||
ASSERT_THAT(values, ElementsAre(Field(&Sqlite::Blob::bytes, Eq(bytes))));
|
ASSERT_THAT(values, ElementsAre(Field("Sqlite::Blob::bytes", &Sqlite::Blob::bytes, Eq(bytes))));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SqliteStatement, get_empty_optional_blob_value_for_integer)
|
TEST_F(SqliteStatement, get_empty_optional_blob_value_for_integer)
|
||||||
@@ -1154,7 +1154,7 @@ TEST_F(SqliteStatement, get_empty_optional_blob_value_for_integer)
|
|||||||
|
|
||||||
auto value = statement.optionalValue<Sqlite::Blob>();
|
auto value = statement.optionalValue<Sqlite::Blob>();
|
||||||
|
|
||||||
ASSERT_THAT(value, Optional(Field(&Sqlite::Blob::bytes, IsEmpty())));
|
ASSERT_THAT(value, Optional(Field("Sqlite::Blob::bytes", &Sqlite::Blob::bytes, IsEmpty())));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SqliteStatement, get_empty_optional_blob_value_for_float)
|
TEST_F(SqliteStatement, get_empty_optional_blob_value_for_float)
|
||||||
@@ -1163,7 +1163,7 @@ TEST_F(SqliteStatement, get_empty_optional_blob_value_for_float)
|
|||||||
|
|
||||||
auto value = statement.optionalValue<Sqlite::Blob>();
|
auto value = statement.optionalValue<Sqlite::Blob>();
|
||||||
|
|
||||||
ASSERT_THAT(value, Optional(Field(&Sqlite::Blob::bytes, IsEmpty())));
|
ASSERT_THAT(value, Optional(Field("Sqlite::Blob::bytes", &Sqlite::Blob::bytes, IsEmpty())));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SqliteStatement, get_empty_optional_blob_value_for_text)
|
TEST_F(SqliteStatement, get_empty_optional_blob_value_for_text)
|
||||||
@@ -1172,7 +1172,7 @@ TEST_F(SqliteStatement, get_empty_optional_blob_value_for_text)
|
|||||||
|
|
||||||
auto value = statement.optionalValue<Sqlite::Blob>();
|
auto value = statement.optionalValue<Sqlite::Blob>();
|
||||||
|
|
||||||
ASSERT_THAT(value, Optional(Field(&Sqlite::Blob::bytes, IsEmpty())));
|
ASSERT_THAT(value, Optional(Field("Sqlite::Blob::bytes", &Sqlite::Blob::bytes, IsEmpty())));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SqliteStatement, get_optional_single_value_and_multiple_query_value)
|
TEST_F(SqliteStatement, get_optional_single_value_and_multiple_query_value)
|
||||||
|
@@ -172,10 +172,10 @@ TEST_F(SqliteTable, add_column)
|
|||||||
auto &column = table.addColumn("name", ColumnType::Text, {Sqlite::Unique{}});
|
auto &column = table.addColumn("name", ColumnType::Text, {Sqlite::Unique{}});
|
||||||
|
|
||||||
ASSERT_THAT(column,
|
ASSERT_THAT(column,
|
||||||
AllOf(Field(&Column::name, Eq("name")),
|
AllOf(Field("Column::name", &Column::name, Eq("name")),
|
||||||
Field(&Column::tableName, Eq(tableName)),
|
Field("Column::tableName", &Column::tableName, Eq(tableName)),
|
||||||
Field(&Column::type, ColumnType::Text),
|
Field("Column::type", &Column::type, ColumnType::Text),
|
||||||
Field(&Column::constraints,
|
Field("Column::constraints", &Column::constraints,
|
||||||
ElementsAre(VariantWith<Sqlite::Unique>(Eq(Sqlite::Unique{}))))));
|
ElementsAre(VariantWith<Sqlite::Unique>(Eq(Sqlite::Unique{}))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,16 +193,16 @@ TEST_F(SqliteTable, add_foreign_key_column_with_table)
|
|||||||
Enforment::Deferred);
|
Enforment::Deferred);
|
||||||
|
|
||||||
ASSERT_THAT(column,
|
ASSERT_THAT(column,
|
||||||
AllOf(Field(&Column::name, Eq("name")),
|
AllOf(Field("Column::name", &Column::name, Eq("name")),
|
||||||
Field(&Column::tableName, Eq(tableName)),
|
Field("Column::tableName", &Column::tableName, Eq(tableName)),
|
||||||
Field(&Column::type, ColumnType::Integer),
|
Field("Column::type", &Column::type, ColumnType::Integer),
|
||||||
Field(&Column::constraints,
|
Field("Column::constraints", &Column::constraints,
|
||||||
ElementsAre(VariantWith<ForeignKey>(
|
ElementsAre(VariantWith<ForeignKey>(
|
||||||
AllOf(Field(&ForeignKey::table, Eq("foreignTable")),
|
AllOf(Field("ForeignKey::table", &ForeignKey::table, Eq("foreignTable")),
|
||||||
Field(&ForeignKey::column, IsEmpty()),
|
Field("ForeignKey::column", &ForeignKey::column, IsEmpty()),
|
||||||
Field(&ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
Field("ForeignKey::updateAction", &ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
||||||
Field(&ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
Field("ForeignKey::deleteAction", &ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
||||||
Field(&ForeignKey::enforcement, Enforment::Deferred)))))));
|
Field("ForeignKey::enforcement", &ForeignKey::enforcement, Enforment::Deferred)))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SqliteTable, add_foreign_key_column_with_column)
|
TEST_F(SqliteTable, add_foreign_key_column_with_column)
|
||||||
@@ -219,16 +219,16 @@ TEST_F(SqliteTable, add_foreign_key_column_with_column)
|
|||||||
Enforment::Deferred);
|
Enforment::Deferred);
|
||||||
|
|
||||||
ASSERT_THAT(column,
|
ASSERT_THAT(column,
|
||||||
AllOf(Field(&Column::name, Eq("name")),
|
AllOf(Field("Column::name", &Column::name, Eq("name")),
|
||||||
Field(&Column::tableName, Eq(tableName)),
|
Field("Column::tableName", &Column::tableName, Eq(tableName)),
|
||||||
Field(&Column::type, ColumnType::Text),
|
Field("Column::type", &Column::type, ColumnType::Text),
|
||||||
Field(&Column::constraints,
|
Field("Column::constraints", &Column::constraints,
|
||||||
ElementsAre(VariantWith<ForeignKey>(
|
ElementsAre(VariantWith<ForeignKey>(
|
||||||
AllOf(Field(&ForeignKey::table, Eq("foreignTable")),
|
AllOf(Field("ForeignKey::table", &ForeignKey::table, Eq("foreignTable")),
|
||||||
Field(&ForeignKey::column, Eq("foreignColumn")),
|
Field("ForeignKey::column", &ForeignKey::column, Eq("foreignColumn")),
|
||||||
Field(&ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
Field("ForeignKey::updateAction", &ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
||||||
Field(&ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
Field("ForeignKey::deleteAction", &ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
||||||
Field(&ForeignKey::enforcement, Enforment::Deferred)))))));
|
Field("ForeignKey::enforcement", &ForeignKey::enforcement, Enforment::Deferred)))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SqliteTable, add_foreign_key_which_is_not_unique_throws_an_exceptions)
|
TEST_F(SqliteTable, add_foreign_key_which_is_not_unique_throws_an_exceptions)
|
||||||
@@ -261,17 +261,17 @@ TEST_F(SqliteTable, add_foreign_key_column_with_table_and_not_null)
|
|||||||
{Sqlite::NotNull{}});
|
{Sqlite::NotNull{}});
|
||||||
|
|
||||||
ASSERT_THAT(column,
|
ASSERT_THAT(column,
|
||||||
AllOf(Field(&Column::name, Eq("name")),
|
AllOf(Field("Column::name", &Column::name, Eq("name")),
|
||||||
Field(&Column::tableName, Eq(tableName)),
|
Field("Column::tableName", &Column::tableName, Eq(tableName)),
|
||||||
Field(&Column::type, ColumnType::Integer),
|
Field("Column::type", &Column::type, ColumnType::Integer),
|
||||||
Field(&Column::constraints,
|
Field("Column::constraints", &Column::constraints,
|
||||||
UnorderedElementsAre(
|
UnorderedElementsAre(
|
||||||
VariantWith<ForeignKey>(
|
VariantWith<ForeignKey>(
|
||||||
AllOf(Field(&ForeignKey::table, Eq("foreignTable")),
|
AllOf(Field("ForeignKey::table", &ForeignKey::table, Eq("foreignTable")),
|
||||||
Field(&ForeignKey::column, IsEmpty()),
|
Field("ForeignKey::column", &ForeignKey::column, IsEmpty()),
|
||||||
Field(&ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
Field("ForeignKey::updateAction", &ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
||||||
Field(&ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
Field("ForeignKey::deleteAction", &ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
||||||
Field(&ForeignKey::enforcement, Enforment::Deferred))),
|
Field("ForeignKey::enforcement", &ForeignKey::enforcement, Enforment::Deferred))),
|
||||||
VariantWith<Sqlite::NotNull>(Eq(Sqlite::NotNull{}))))));
|
VariantWith<Sqlite::NotNull>(Eq(Sqlite::NotNull{}))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,17 +290,17 @@ TEST_F(SqliteTable, add_foreign_key_column_with_column_and_not_null)
|
|||||||
{Sqlite::NotNull{}});
|
{Sqlite::NotNull{}});
|
||||||
|
|
||||||
ASSERT_THAT(column,
|
ASSERT_THAT(column,
|
||||||
AllOf(Field(&Column::name, Eq("name")),
|
AllOf(Field("Column::name", &Column::name, Eq("name")),
|
||||||
Field(&Column::tableName, Eq(tableName)),
|
Field("Column::tableName", &Column::tableName, Eq(tableName)),
|
||||||
Field(&Column::type, ColumnType::Text),
|
Field("Column::type", &Column::type, ColumnType::Text),
|
||||||
Field(&Column::constraints,
|
Field("Column::constraints", &Column::constraints,
|
||||||
UnorderedElementsAre(
|
UnorderedElementsAre(
|
||||||
VariantWith<ForeignKey>(
|
VariantWith<ForeignKey>(
|
||||||
AllOf(Field(&ForeignKey::table, Eq("foreignTable")),
|
AllOf(Field("ForeignKey::table", &ForeignKey::table, Eq("foreignTable")),
|
||||||
Field(&ForeignKey::column, Eq("foreignColumn")),
|
Field("ForeignKey::column", &ForeignKey::column, Eq("foreignColumn")),
|
||||||
Field(&ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
Field("ForeignKey::updateAction", &ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
||||||
Field(&ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
Field("ForeignKey::deleteAction", &ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
||||||
Field(&ForeignKey::enforcement, Enforment::Deferred))),
|
Field("ForeignKey::enforcement", &ForeignKey::enforcement, Enforment::Deferred))),
|
||||||
VariantWith<Sqlite::NotNull>(Eq(Sqlite::NotNull{}))))));
|
VariantWith<Sqlite::NotNull>(Eq(Sqlite::NotNull{}))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -471,10 +471,10 @@ TEST_F(StrictSqliteTable, add_column)
|
|||||||
auto &column = table.addColumn("name", StrictColumnType::Text, {Sqlite::Unique{}});
|
auto &column = table.addColumn("name", StrictColumnType::Text, {Sqlite::Unique{}});
|
||||||
|
|
||||||
ASSERT_THAT(column,
|
ASSERT_THAT(column,
|
||||||
AllOf(Field(&Column::name, Eq("name")),
|
AllOf(Field("Column::name", &Column::name, Eq("name")),
|
||||||
Field(&Column::tableName, Eq(tableName)),
|
Field("Column::tableName", &Column::tableName, Eq(tableName)),
|
||||||
Field(&Column::type, StrictColumnType::Text),
|
Field("Column::type", &Column::type, StrictColumnType::Text),
|
||||||
Field(&Column::constraints,
|
Field("Column::constraints", &Column::constraints,
|
||||||
ElementsAre(VariantWith<Sqlite::Unique>(Eq(Sqlite::Unique{}))))));
|
ElementsAre(VariantWith<Sqlite::Unique>(Eq(Sqlite::Unique{}))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -492,16 +492,16 @@ TEST_F(StrictSqliteTable, add_foreign_key_column_with_table)
|
|||||||
Enforment::Deferred);
|
Enforment::Deferred);
|
||||||
|
|
||||||
ASSERT_THAT(column,
|
ASSERT_THAT(column,
|
||||||
AllOf(Field(&Column::name, Eq("name")),
|
AllOf(Field("Column::name", &Column::name, Eq("name")),
|
||||||
Field(&Column::tableName, Eq(tableName)),
|
Field("Column::tableName", &Column::tableName, Eq(tableName)),
|
||||||
Field(&Column::type, StrictColumnType::Integer),
|
Field("Column::type", &Column::type, StrictColumnType::Integer),
|
||||||
Field(&Column::constraints,
|
Field("Column::constraints", &Column::constraints,
|
||||||
ElementsAre(VariantWith<ForeignKey>(
|
ElementsAre(VariantWith<ForeignKey>(
|
||||||
AllOf(Field(&ForeignKey::table, Eq("foreignTable")),
|
AllOf(Field("ForeignKey::table", &ForeignKey::table, Eq("foreignTable")),
|
||||||
Field(&ForeignKey::column, IsEmpty()),
|
Field("ForeignKey::column", &ForeignKey::column, IsEmpty()),
|
||||||
Field(&ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
Field("ForeignKey::updateAction", &ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
||||||
Field(&ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
Field("ForeignKey::deleteAction", &ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
||||||
Field(&ForeignKey::enforcement, Enforment::Deferred)))))));
|
Field("ForeignKey::enforcement", &ForeignKey::enforcement, Enforment::Deferred)))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(StrictSqliteTable, add_foreign_key_column_with_column)
|
TEST_F(StrictSqliteTable, add_foreign_key_column_with_column)
|
||||||
@@ -520,16 +520,16 @@ TEST_F(StrictSqliteTable, add_foreign_key_column_with_column)
|
|||||||
Enforment::Deferred);
|
Enforment::Deferred);
|
||||||
|
|
||||||
ASSERT_THAT(column,
|
ASSERT_THAT(column,
|
||||||
AllOf(Field(&Column::name, Eq("name")),
|
AllOf(Field("Column::name", &Column::name, Eq("name")),
|
||||||
Field(&Column::tableName, Eq(tableName)),
|
Field("Column::tableName", &Column::tableName, Eq(tableName)),
|
||||||
Field(&Column::type, StrictColumnType::Text),
|
Field("Column::type", &Column::type, StrictColumnType::Text),
|
||||||
Field(&Column::constraints,
|
Field("Column::constraints", &Column::constraints,
|
||||||
ElementsAre(VariantWith<ForeignKey>(
|
ElementsAre(VariantWith<ForeignKey>(
|
||||||
AllOf(Field(&ForeignKey::table, Eq("foreignTable")),
|
AllOf(Field("ForeignKey::table", &ForeignKey::table, Eq("foreignTable")),
|
||||||
Field(&ForeignKey::column, Eq("foreignColumn")),
|
Field("ForeignKey::column", &ForeignKey::column, Eq("foreignColumn")),
|
||||||
Field(&ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
Field("ForeignKey::updateAction", &ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
||||||
Field(&ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
Field("ForeignKey::deleteAction", &ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
||||||
Field(&ForeignKey::enforcement, Enforment::Deferred)))))));
|
Field("ForeignKey::enforcement", &ForeignKey::enforcement, Enforment::Deferred)))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(StrictSqliteTable, add_foreign_key_which_is_not_unique_throws_an_exceptions)
|
TEST_F(StrictSqliteTable, add_foreign_key_which_is_not_unique_throws_an_exceptions)
|
||||||
@@ -562,17 +562,17 @@ TEST_F(StrictSqliteTable, add_foreign_key_column_with_table_and_not_null)
|
|||||||
{Sqlite::NotNull{}});
|
{Sqlite::NotNull{}});
|
||||||
|
|
||||||
ASSERT_THAT(column,
|
ASSERT_THAT(column,
|
||||||
AllOf(Field(&Column::name, Eq("name")),
|
AllOf(Field("Column::name", &Column::name, Eq("name")),
|
||||||
Field(&Column::tableName, Eq(tableName)),
|
Field("Column::tableName", &Column::tableName, Eq(tableName)),
|
||||||
Field(&Column::type, StrictColumnType::Integer),
|
Field("Column::type", &Column::type, StrictColumnType::Integer),
|
||||||
Field(&Column::constraints,
|
Field("Column::constraints", &Column::constraints,
|
||||||
UnorderedElementsAre(
|
UnorderedElementsAre(
|
||||||
VariantWith<ForeignKey>(
|
VariantWith<ForeignKey>(
|
||||||
AllOf(Field(&ForeignKey::table, Eq("foreignTable")),
|
AllOf(Field("ForeignKey::table", &ForeignKey::table, Eq("foreignTable")),
|
||||||
Field(&ForeignKey::column, IsEmpty()),
|
Field("ForeignKey::column", &ForeignKey::column, IsEmpty()),
|
||||||
Field(&ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
Field("ForeignKey::updateAction", &ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
||||||
Field(&ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
Field("ForeignKey::deleteAction", &ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
||||||
Field(&ForeignKey::enforcement, Enforment::Deferred))),
|
Field("ForeignKey::enforcement", &ForeignKey::enforcement, Enforment::Deferred))),
|
||||||
VariantWith<Sqlite::NotNull>(Eq(Sqlite::NotNull{}))))));
|
VariantWith<Sqlite::NotNull>(Eq(Sqlite::NotNull{}))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -593,17 +593,17 @@ TEST_F(StrictSqliteTable, add_foreign_key_column_with_column_and_not_null)
|
|||||||
{Sqlite::NotNull{}});
|
{Sqlite::NotNull{}});
|
||||||
|
|
||||||
ASSERT_THAT(column,
|
ASSERT_THAT(column,
|
||||||
AllOf(Field(&Column::name, Eq("name")),
|
AllOf(Field("Column::name", &Column::name, Eq("name")),
|
||||||
Field(&Column::tableName, Eq(tableName)),
|
Field("Column::tableName", &Column::tableName, Eq(tableName)),
|
||||||
Field(&Column::type, StrictColumnType::Text),
|
Field("Column::type", &Column::type, StrictColumnType::Text),
|
||||||
Field(&Column::constraints,
|
Field("Column::constraints", &Column::constraints,
|
||||||
UnorderedElementsAre(
|
UnorderedElementsAre(
|
||||||
VariantWith<ForeignKey>(
|
VariantWith<ForeignKey>(
|
||||||
AllOf(Field(&ForeignKey::table, Eq("foreignTable")),
|
AllOf(Field("ForeignKey::table", &ForeignKey::table, Eq("foreignTable")),
|
||||||
Field(&ForeignKey::column, Eq("foreignColumn")),
|
Field("ForeignKey::column", &ForeignKey::column, Eq("foreignColumn")),
|
||||||
Field(&ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
Field("ForeignKey::updateAction", &ForeignKey::updateAction, ForeignKeyAction::SetNull),
|
||||||
Field(&ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
Field("ForeignKey::deleteAction", &ForeignKey::deleteAction, ForeignKeyAction::Cascade),
|
||||||
Field(&ForeignKey::enforcement, Enforment::Deferred))),
|
Field("ForeignKey::enforcement", &ForeignKey::enforcement, Enforment::Deferred))),
|
||||||
VariantWith<Sqlite::NotNull>(Eq(Sqlite::NotNull{}))))));
|
VariantWith<Sqlite::NotNull>(Eq(Sqlite::NotNull{}))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user