From e1aa50dd869cf50916856f8a4cb0e4c84ee6280f Mon Sep 17 00:00:00 2001 From: Daniele Teti Date: Mon, 6 Nov 2023 12:37:33 +0100 Subject: [PATCH] Delphi12 compatibility --- lib/swagdoc/Source/Json.Schema.pas | 4 +- lib/swagdoc/Source/SwagDoc.dproj | 158 +++++++++++++--- sources/MVCFramework.ActiveRecord.pas | 10 - sources/MVCFramework.IntfObjectPool.pas | 2 - sources/MVCFramework.JSONRPC.pas | 5 + sources/MVCFramework.LRUCache.pas | 1 - sources/MVCFramework.ObjectPool.pas | 4 - sources/MVCFramework.RESTClient.pas | 8 + sources/MVCFramework.Rtti.Utils.pas | 1 - ...VCFramework.Serializer.JsonDataObjects.pas | 3 - sources/MVCFramework.pas | 6 +- sources/dmvcframework.inc | 3 + tasks.py | 3 +- .../Several/ActiveRecordControllerTestU.pas | 2 +- .../general/Several/ActiveRecordTestsU.pas | 112 ++++++------ .../general/Several/DMVCFrameworkTests.dproj | 172 ++++++++++++++++-- unittests/general/Several/FrameworkTestsU.pas | 54 +++--- unittests/general/Several/LiveServerTestU.pas | 2 +- unittests/general/Several/PGUtilsU.pas | 3 +- .../Serializers.JsonDataObjectsTestU.pas | 28 +-- unittests/general/TestServer/TestServer.dproj | 167 +++++++++++++---- 21 files changed, 543 insertions(+), 205 deletions(-) diff --git a/lib/swagdoc/Source/Json.Schema.pas b/lib/swagdoc/Source/Json.Schema.pas index e08653d5..c35b5b03 100644 --- a/lib/swagdoc/Source/Json.Schema.pas +++ b/lib/swagdoc/Source/Json.Schema.pas @@ -92,7 +92,7 @@ var vSchemaKind: TSchemaKind; vClass: TPersistentClass; begin - Result := nil; + //Result := nil; //dt vSchemaKind := GetSchemaKind; if (vSchemaKind = skUnknown) then raise ETypeNotSupportedByAField.Create(c_ErrorTypeNotSupportedByAField); @@ -129,7 +129,7 @@ end; function TJsonSchema.GetSchemaKind: TSchemaKind; var vTypeInfo: PTypeInfo; - vClass: TPersistentClass; + //vClass: TPersistentClass; //dt begin Result := skUnknown; vTypeInfo := System.TypeInfo(T); diff --git a/lib/swagdoc/Source/SwagDoc.dproj b/lib/swagdoc/Source/SwagDoc.dproj index 3fb504e8..6d10aa07 100644 --- a/lib/swagdoc/Source/SwagDoc.dproj +++ b/lib/swagdoc/Source/SwagDoc.dproj @@ -2,7 +2,7 @@ {5B9408E7-46AC-4431-9716-C9EB9F8589B1} SwagDoc.dpk - 19.5 + 20.1 None True Debug @@ -13,16 +13,6 @@ true - - true - Base - true - - - true - Base - true - true Base @@ -64,19 +54,6 @@ true true - - None - android-support-v4.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar - $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png - - - package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= - Debug - false - None - android-support-v4.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar - $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) Debug @@ -272,6 +249,16 @@ 1 + + + res\drawable-anydpi-v21 + 1 + + + res\drawable-anydpi-v21 + 1 + + res\values @@ -292,6 +279,66 @@ 1 + + + res\values-v31 + 1 + + + res\values-v31 + 1 + + + + + res\drawable-anydpi-v26 + 1 + + + res\drawable-anydpi-v26 + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-anydpi-v33 + 1 + + + res\drawable-anydpi-v33 + 1 + + res\values @@ -302,6 +349,16 @@ 1 + + + res\values-night-v21 + 1 + + + res\values-night-v21 + 1 + + res\drawable @@ -472,6 +529,56 @@ 1 + + + res\drawable-anydpi-v24 + 1 + + + res\drawable-anydpi-v24 + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-night-anydpi-v21 + 1 + + + res\drawable-night-anydpi-v21 + 1 + + + + + res\drawable-anydpi-v31 + 1 + + + res\drawable-anydpi-v31 + 1 + + + + + res\drawable-night-anydpi-v31 + 1 + + + res\drawable-night-anydpi-v31 + 1 + + 1 @@ -912,9 +1019,6 @@ - False - False - False True False diff --git a/sources/MVCFramework.ActiveRecord.pas b/sources/MVCFramework.ActiveRecord.pas index 3d83706e..a5f02b4f 100644 --- a/sources/MVCFramework.ActiveRecord.pas +++ b/sources/MVCFramework.ActiveRecord.pas @@ -3025,10 +3025,6 @@ end; class function TMVCActiveRecordHelper.Select(const SQL: string; const Params: array of Variant; const ParamTypes: array of TFieldType; const Options: TMVCActiveRecordLoadOptions): TObjectList; -var - lDataSet: TDataSet; - lAR: TMVCActiveRecord; - lHandled: Boolean; begin Result := TObjectList.Create(True); try @@ -3049,12 +3045,8 @@ class function TMVCActiveRecordHelper.SelectOne(const SQL: string; const Para const ParamTypes: array of TFieldType; const Options: TMVCActiveRecordLoadOptions; const RaiseExceptionIfNotFound: Boolean): T; var - lDataSet: TDataSet; - lAR: TMVCActiveRecord; - lHandled: Boolean; lList: TObjectList; begin - Result := nil; lList := Select(SQL, Params, ParamTypes, Options); try if (lList.Count = 0) then @@ -3606,8 +3598,6 @@ class function TMVCActiveRecordHelper.Merge(CurrentList, NewList: TObjectList var I: Integer; lFoundAtIndex: Integer; - lCurrPKValue: Integer; - lPKValue: TValue; lUnitOfWork: IMVCUnitOfWork; lPKType: TFieldType; lNeedsToBeUpdated: Boolean; diff --git a/sources/MVCFramework.IntfObjectPool.pas b/sources/MVCFramework.IntfObjectPool.pas index cfeafe65..b5857e3f 100644 --- a/sources/MVCFramework.IntfObjectPool.pas +++ b/sources/MVCFramework.IntfObjectPool.pas @@ -220,12 +220,10 @@ end; procedure TIntfCleanupThread.Execute; var - lTargetSize: Integer; lAvgSize: TPoolSizeSamples; lArrIndex: Integer; lSampleTick: Integer; begin - lArrIndex := 0; lSampleTick := 0; while not Terminated do begin diff --git a/sources/MVCFramework.JSONRPC.pas b/sources/MVCFramework.JSONRPC.pas index d3ee2449..0c379a2c 100644 --- a/sources/MVCFramework.JSONRPC.pas +++ b/sources/MVCFramework.JSONRPC.pas @@ -29,6 +29,8 @@ unit MVCFramework.JSONRPC; https://www.jsonrpc.org/historical/json-rpc-over-http.html } +{$I dmvcframework.inc} + interface uses @@ -2907,6 +2909,9 @@ begin else begin RaiseSerializationError('Parameter doesn''t support IJSONRPCResponse'); + {$IF Defined(DELPHI12ORBETTER)} + Result := Default(T); + {$ENDIF} end; end; diff --git a/sources/MVCFramework.LRUCache.pas b/sources/MVCFramework.LRUCache.pas index 5cad86b0..9405084c 100644 --- a/sources/MVCFramework.LRUCache.pas +++ b/sources/MVCFramework.LRUCache.pas @@ -123,7 +123,6 @@ end; procedure TMVCLRUCache.RemoveIf(const Action: TMVCLRUCacheAction); var - I: Integer; lIndex: Integer; lCacheSize: Integer; begin diff --git a/sources/MVCFramework.ObjectPool.pas b/sources/MVCFramework.ObjectPool.pas index f7b85d45..21206003 100644 --- a/sources/MVCFramework.ObjectPool.pas +++ b/sources/MVCFramework.ObjectPool.pas @@ -103,8 +103,6 @@ implementation { TObjectPool } constructor TObjectPool.Create(MaxSize: Integer; ShrinkTriggerSize, ShrinkTargetSize: Integer; const Factory: TFunc); -var - i: Integer; begin inherited Create; fOnResetState := nil; @@ -222,12 +220,10 @@ end; procedure TCleanupThread.Execute; var - lTargetSize: Integer; lAvgSize: TPoolSizeSamples; lArrIndex: Integer; lSampleTick: Integer; begin - lArrIndex := 0; lSampleTick := 0; while not Terminated do begin diff --git a/sources/MVCFramework.RESTClient.pas b/sources/MVCFramework.RESTClient.pas index 0eeb44e7..8c390f15 100644 --- a/sources/MVCFramework.RESTClient.pas +++ b/sources/MVCFramework.RESTClient.pas @@ -671,7 +671,11 @@ function TMVCRESTClient.AddBodyFieldFormData(const aName: string; aStreamValue: const aContentType: string): IMVCRESTClient; begin Result := Self; + {$IF Defined(DELPHI12ORBETTER)} + GetBodyFormData.AddStream(aName, aStreamValue, False, '', aContentType); + {$ELSE} GetBodyFormData.AddStream(aName, aStreamValue, '', aContentType); + {$ENDIF} SetContentType(TMVCMediaType.MULTIPART_FORM_DATA); end; {$ENDIF} @@ -706,7 +710,11 @@ end; function TMVCRESTClient.AddFile(const aName: string; aFileStreamValue: TStream; const aFileName, aContentType: string): IMVCRESTClient; begin Result := Self; + {$IF Defined(DELPHI12ORBETTER)} + GetBodyFormData.AddStream(aName, aFileStreamValue, False, aFileName, aContentType); + {$ELSE} GetBodyFormData.AddStream(aName, aFileStreamValue, aFileName, aContentType); + {$ENDIF} SetContentType(TMVCMediaType.MULTIPART_FORM_DATA); end; {$ENDIF} diff --git a/sources/MVCFramework.Rtti.Utils.pas b/sources/MVCFramework.Rtti.Utils.pas index 4f0d2366..77945350 100644 --- a/sources/MVCFramework.Rtti.Utils.pas +++ b/sources/MVCFramework.Rtti.Utils.pas @@ -539,7 +539,6 @@ var V: TValue; Found: Boolean; begin - Found := False; for elem in AList do begin V := GetProperty(elem, APropertyName); diff --git a/sources/MVCFramework.Serializer.JsonDataObjects.pas b/sources/MVCFramework.Serializer.JsonDataObjects.pas index 6c6ec09c..a7d5abee 100644 --- a/sources/MVCFramework.Serializer.JsonDataObjects.pas +++ b/sources/MVCFramework.Serializer.JsonDataObjects.pas @@ -3858,8 +3858,6 @@ end; function TMVCJsonDataObjectsSerializer.JSONObjectToRecord(const JSONObject: TJsonObject): T; var - lTypeSize: Integer; - lTypeInfo: PTypeInfo; AIgnoredAttributes: TMVCIgnoredList; lKeyName: string; lAttributeValue: TValue; @@ -3876,7 +3874,6 @@ begin raise EMVCDeserializationException.Create('Extected record, got ' + lRTTIType.QualifiedName); end; - lTypeInfo := lRTTIType.Handle; lBuffer := @Result; lField := nil; AIgnoredAttributes := []; diff --git a/sources/MVCFramework.pas b/sources/MVCFramework.pas index ca78a1d2..29cf0ba5 100644 --- a/sources/MVCFramework.pas +++ b/sources/MVCFramework.pas @@ -1470,7 +1470,6 @@ var Obj: TObject; lSerializer: IMVCSerializer; begin - Result := nil; if FSerializers.TryGetValue(ContentMediaType, lSerializer) then begin Obj := TMVCSerializerHelper.CreateObject(TClass(T).QualifiedClassName); @@ -1495,7 +1494,6 @@ var List: TObjectList; lSerializer: IMVCSerializer; begin - Result := nil; if FSerializers.TryGetValue(ContentMediaType, lSerializer) then begin List := TObjectList.Create(True); @@ -3020,8 +3018,8 @@ begin lFromQueryStringAttribute) then begin Inc(lAttributeInjectedParamCount, 1); - lInjectedParamValue := AContext.Request.QueryStringParam - (lFromQueryStringAttribute.ParamName); + lInjectedParamValue := URLDecode(AContext.Request.QueryStringParam + (lFromQueryStringAttribute.ParamName)); HandleDefaultValueForInjectedParameter(lInjectedParamValue, lFromQueryStringAttribute); AActualParams[I] := GetActualParam(AActionFormalParams[I], lInjectedParamValue); end diff --git a/sources/dmvcframework.inc b/sources/dmvcframework.inc index 9b7122e5..873382b9 100644 --- a/sources/dmvcframework.inc +++ b/sources/dmvcframework.inc @@ -75,6 +75,9 @@ DelphiMVCFramework is compatible with Delphi version XE7 or better {$DEFINE ALEXANDRIAORBETTER} {$ENDIF} +{$IF CompilerVersion >= 36} // 12 +{$DEFINE DELPHI12ORBETTER} +{$ENDIF} {$IFDEF MOBILE} {$LEGACYIFEND OFF} diff --git a/tasks.py b/tasks.py index 4aaccf18..823e50c2 100644 --- a/tasks.py +++ b/tasks.py @@ -12,7 +12,7 @@ from pathlib import Path init() -DEFAULT_DELPHI_VERSION = "11.3" +DEFAULT_DELPHI_VERSION = "12" g_releases_path = "releases" g_output = "bin" @@ -54,6 +54,7 @@ def build_delphi_project( "11.1": {"path": "22.0", "desc": "Delphi 11.1 Alexandria"}, "11.2": {"path": "22.0", "desc": "Delphi 11.2 Alexandria"}, "11.3": {"path": "22.0", "desc": "Delphi 11.3 Alexandria"}, + "12": {"path": "23.0", "desc": "Delphi 12"}, } assert delphi_version in delphi_versions, ( diff --git a/unittests/general/Several/ActiveRecordControllerTestU.pas b/unittests/general/Several/ActiveRecordControllerTestU.pas index 26318edb..b7ed5752 100644 --- a/unittests/general/Several/ActiveRecordControllerTestU.pas +++ b/unittests/general/Several/ActiveRecordControllerTestU.pas @@ -212,7 +212,7 @@ begin Assert.IsTrue(lJSON.Contains('data') and (lJSON.Types['data'] = TJsonDataType.jdtArray), 'incorrect "data" property in JSON'); var lCustomers := TJSONUtils.JSONArrayToListOf(lJSON.A['data']); try - Assert.AreEqual(20, lCustomers.Count); + Assert.AreEqual(20, lCustomers.Count); finally lCustomers.Free; end; diff --git a/unittests/general/Several/ActiveRecordTestsU.pas b/unittests/general/Several/ActiveRecordTestsU.pas index c811be5b..e5365e7c 100644 --- a/unittests/general/Several/ActiveRecordTestsU.pas +++ b/unittests/general/Several/ActiveRecordTestsU.pas @@ -250,7 +250,7 @@ begin lCustomer.ID := -1; { don't be fooled by the default! } lCustomer.Insert; lID := lCustomer.ID; - Assert.AreEqual(1, lID); + Assert.AreEqual(1, lID); finally lCustomer.Free; end; @@ -274,11 +274,11 @@ begin lCustomer := TMVCActiveRecord.GetByPK(lID); try Assert.AreEqual('1234', lCustomer.Code.Value); - Assert.AreEqual(3, lCustomer.Rating.Value); + Assert.AreEqual(3, lCustomer.Rating.Value); Assert.AreEqual('note1noteupdated', lCustomer.Note); Assert.AreEqual('bit Time Professionals', lCustomer.CompanyName.Value); Assert.AreEqual('Rome, IT', lCustomer.City); - Assert.AreEqual(1, lCustomer.ID.Value); + Assert.AreEqual(1, lCustomer.ID.Value); Assert.IsFalse(lCustomer.CreationTime.HasValue); Assert.IsFalse(lCustomer.CreationDate.HasValue); finally @@ -329,7 +329,7 @@ begin lCustomer := TMVCActiveRecord.GetByPK('1000'); try Assert.AreEqual('1000', lCustomer.Code); - Assert.AreEqual(3, lCustomer.Rating.Value); + Assert.AreEqual(3, lCustomer.Rating.Value); Assert.AreEqual('note1noteupdated', lCustomer.Note); Assert.AreEqual('bit Time Professionals', lCustomer.CompanyName.Value); Assert.AreEqual('Rome, IT', lCustomer.City); @@ -387,7 +387,7 @@ begin lCustomer := TMVCActiveRecord.GetByPK(lGUID); try Assert.AreEqual('1234', lCustomer.Code.Value); - Assert.AreEqual(3, lCustomer.Rating.Value); + Assert.AreEqual(3, lCustomer.Rating.Value); Assert.AreEqual('note1noteupdated', lCustomer.Note); Assert.AreEqual('bit Time Professionals', lCustomer.CompanyName.Value); Assert.AreEqual('Rome, IT', lCustomer.City); @@ -426,7 +426,7 @@ begin lCustomer.ID := -1; { don't be fooled by the default! } lCustomer.Insert; lID := lCustomer.ID; - Assert.AreEqual(1, lID); + Assert.AreEqual(1, lID); finally lCustomer.Free; end; @@ -450,11 +450,11 @@ begin lCustomer := TMVCActiveRecord.GetByPK(lID); try Assert.AreEqual('1234', lCustomer.Code.Value); - Assert.AreEqual(3, lCustomer.Rating.Value); + Assert.AreEqual(3, lCustomer.Rating.Value); Assert.AreEqual('note1noteupdated', lCustomer.Note); Assert.AreEqual('bit Time Professionals', lCustomer.CompanyName.Value); Assert.AreEqual('Rome, IT', lCustomer.City); - Assert.AreEqual(1, lCustomer.ID); + Assert.AreEqual(1, lCustomer.ID); Assert.IsFalse(lCustomer.CreationTime.HasValue); Assert.IsFalse(lCustomer.CreationDate.HasValue); finally @@ -595,7 +595,7 @@ begin var lGoodCustomers := TMVCActiveRecord.SelectRQL('', 10); try - Assert.AreEqual(2, lGoodCustomers.Count); + Assert.AreEqual(2, lGoodCustomers.Count); finally lGoodCustomers.Free; end; @@ -617,7 +617,7 @@ begin lGoodCustomers := TMVCActiveRecord.SelectRQL('lt(Rating,4);sort(+CompanyName)', 10); try - Assert.AreEqual(0, lGoodCustomers.Count); + Assert.AreEqual(0, lGoodCustomers.Count); finally lGoodCustomers.Free; end; @@ -712,28 +712,28 @@ begin LoadData; lCustomers := TMVCActiveRecord.SelectRQL(RQL1, MAXINT); try - Assert.AreEqual(240, lCustomers.Count); + Assert.AreEqual(240, lCustomers.Count); finally lCustomers.Free; end; lCustomers := TMVCActiveRecord.SelectRQL(RQL1, 20); try - Assert.AreEqual(20, lCustomers.Count); + Assert.AreEqual(20, lCustomers.Count); finally lCustomers.Free; end; lCustomers := TMVCActiveRecord.SelectRQL(RQL1, 1); try - Assert.AreEqual(1, lCustomers.Count); + Assert.AreEqual(1, lCustomers.Count); finally lCustomers.Free; end; lCustomers := TMVCActiveRecord.SelectRQL(RQL1, -1); try - Assert.AreEqual(240, lCustomers.Count); + Assert.AreEqual(240, lCustomers.Count); finally lCustomers.Free; end; @@ -836,20 +836,20 @@ begin lCustomers.Free; end; - Assert.AreEqual(0, lInserted); - Assert.AreEqual(30, lUpdated); - Assert.AreEqual(0, lDeleted); + Assert.AreEqual(0, lInserted); + Assert.AreEqual(30, lUpdated); + Assert.AreEqual(0, lDeleted); lCustomers := TMVCActiveRecord.All; try - Assert.AreEqual(30, lCustomers.Count); + Assert.AreEqual(30, lCustomers.Count); finally lCustomers.Free; end; lCustomers := TMVCActiveRecord.SelectRQL('eq(rating,10)', 1000); try - Assert.AreEqual(30, lCustomers.Count); + Assert.AreEqual(30, lCustomers.Count); finally lCustomers.Free; end; @@ -944,34 +944,34 @@ begin lCustomers.Free; end; - Assert.AreEqual(2, lInserted); - Assert.AreEqual(4, lUpdated); - Assert.AreEqual(26, lDeleted); + Assert.AreEqual(2, lInserted); + Assert.AreEqual(4, lUpdated); + Assert.AreEqual(26, lDeleted); lCustomers := TMVCActiveRecord.All; try - Assert.AreEqual(6, lCustomers.Count); + Assert.AreEqual(6, lCustomers.Count); finally lCustomers.Free; end; lCustomers := TMVCActiveRecord.SelectRQL('eq(rating,3)', 1000); try - Assert.AreEqual(2, lCustomers.Count); + Assert.AreEqual(2, lCustomers.Count); finally lCustomers.Free; end; lCustomers := TMVCActiveRecord.SelectRQL('eq(rating,2)', 1000); try - Assert.AreEqual(2, lCustomers.Count, 'Customers not updated correctly'); + Assert.AreEqual(2, lCustomers.Count, 'Customers not updated correctly'); finally lCustomers.Free; end; lCustomers := TMVCActiveRecord.SelectRQL('eq(rating,1)', 1000); try - Assert.AreEqual(2, lCustomers.Count); + Assert.AreEqual(2, lCustomers.Count); finally lCustomers.Free; end; @@ -1023,13 +1023,13 @@ begin lCustomers.Free; end; - Assert.AreEqual(0, lInserted); - Assert.AreEqual(0, lUpdated); - Assert.AreEqual(30, lDeleted); + Assert.AreEqual(0, lInserted); + Assert.AreEqual(0, lUpdated); + Assert.AreEqual(30, lDeleted); lCustomers := TMVCActiveRecord.All; try - Assert.AreEqual(lTotCustomers, lCustomers.Count); + Assert.AreEqual(lTotCustomers, lCustomers.Count); finally lCustomers.Free; end; @@ -1103,27 +1103,27 @@ begin lCustomers.Free; end; - Assert.AreEqual(2, lInserted); - Assert.AreEqual(30, lUpdated); - Assert.AreEqual(0, lDeleted); + Assert.AreEqual(2, lInserted); + Assert.AreEqual(30, lUpdated); + Assert.AreEqual(0, lDeleted); lCustomers := TMVCActiveRecord.All; try - Assert.AreEqual(lTotCustomers, lCustomers.Count); + Assert.AreEqual(lTotCustomers, lCustomers.Count); finally lCustomers.Free; end; lCustomers := TMVCActiveRecord.SelectRQL('eq(rating,1)', 1000); try - Assert.AreEqual(lTotCustomers - 2, lCustomers.Count, 'Some customer changed when should not change'); + Assert.AreEqual(lTotCustomers - 2, lCustomers.Count, 'Some customer changed when should not change'); finally lCustomers.Free; end; lCustomers := TMVCActiveRecord.SelectRQL('eq(rating,3)', 1000); try - Assert.AreEqual(2, lCustomers.Count, 'Some customer changed when should not change'); + Assert.AreEqual(2, lCustomers.Count, 'Some customer changed when should not change'); finally lCustomers.Free; end; @@ -1143,7 +1143,7 @@ begin LoadData; lCustomers := TMVCActiveRecord.SelectRQLByNamedQuery('CityRomeOrLondon', [], MAXINT); try - Assert.AreEqual(240, lCustomers.Count); + Assert.AreEqual(240, lCustomers.Count); for var lCustomer in lCustomers do begin Assert.IsMatch('^(Rome|London)$', lCustomer.City); @@ -1176,7 +1176,7 @@ begin LoadData; var lCustomers := TMVCActiveRecord.SelectByNamedQuery('ByTwoCities', ['Rome', 'London'], [ftString, ftString]); try - Assert.AreEqual(240, lCustomers.Count); + Assert.AreEqual(240, lCustomers.Count); for var lCustomer in lCustomers do begin Assert.IsMatch('^(Rome|London)$', lCustomer.City); @@ -1190,7 +1190,7 @@ procedure TTestActiveRecordBase.TestNamedQuerySQLByBackEnd; begin var lList := TMVCActiveRecord.SelectByNamedQuery('get_backend_name', [],[]); try - Assert.AreEqual(1, lList.Count); + Assert.AreEqual(1, lList.Count); Assert.AreEqual(lList.First.GetBackEnd, lList.First.BackEndName); finally lList.Free; @@ -1344,7 +1344,7 @@ begin Assert.AreEqual('1234', lRMCustomer.Code.Value); Assert.AreEqual('note1noteupdated', lRMCustomer.Note); Assert.AreEqual('bit Time Professionals', lRMCustomer.CompanyName.Value); - Assert.AreEqual(1, lRMCustomer.ID.Value); + Assert.AreEqual(1, lRMCustomer.ID.Value); finally lRMCustomer.Free; end; @@ -1458,7 +1458,7 @@ begin var lRomeCustomers := TMVCActiveRecord.SelectRQL('', 10); try - Assert.AreEqual(2, lRomeCustomers.Count); + Assert.AreEqual(2, lRomeCustomers.Count); finally lRomeCustomers.Free; end; @@ -1473,7 +1473,7 @@ begin lRomeCustomers := TMVCActiveRecord.SelectRQL('eq(Rating,5);sort(+CompanyName)', 10); try - Assert.AreEqual(1, lRomeCustomers.Count); + Assert.AreEqual(1, lRomeCustomers.Count); Assert.AreEqual('Rome Company 1', lRomeCustomers[0].CompanyName.Value); finally lRomeCustomers.Free; @@ -1481,7 +1481,7 @@ begin lRomeCustomers := TMVCActiveRecord.SelectRQL('lt(Rating,2);sort(+CompanyName)', 10); try - Assert.AreEqual(0, lRomeCustomers.Count); + Assert.AreEqual(0, lRomeCustomers.Count); finally lRomeCustomers.Free; end; @@ -1495,14 +1495,14 @@ begin var lRomeBasedCustomers := TMVCActiveRecord.Where('city = ?', ['New York'], [ftString]); try - Assert.AreEqual(0, lRomeBasedCustomers.Count); + Assert.AreEqual(0, lRomeBasedCustomers.Count); finally lRomeBasedCustomers.Free; end; lRomeBasedCustomers := TMVCActiveRecord.Where('description = ?', ['Daniele'], [ftString]); try - Assert.AreEqual(1, lRomeBasedCustomers.Count); + Assert.AreEqual(1, lRomeBasedCustomers.Count); finally lRomeBasedCustomers.Free; end; @@ -1557,7 +1557,7 @@ begin lCustomer.ID := -1; { don't be fooled by the default! } lCustomer.Insert; lID := lCustomer.ID; - Assert.AreEqual(1, lID); + Assert.AreEqual(1, lID); lCustomer.CompanyName.Clear; lCustomer.City := ''; lCustomer.Note := ''; @@ -1593,7 +1593,7 @@ begin LoadData; lCustomers := TMVCActiveRecord.SelectRQL(RQL1, MAXINT); try - Assert.AreEqual(240, lCustomers.Count); + Assert.AreEqual(240, lCustomers.Count); for var lCustomer in lCustomers do begin Assert.IsMatch('^(Rome|London)$', lCustomer.City); @@ -1640,7 +1640,7 @@ begin // LoadData; // lCustomers := TMVCActiveRecord.SelectRQL(RQL1, MAXINT); // try - // Assert.AreEqual(240, lCustomers.Count); + // Assert.AreEqual(240, lCustomers.Count); // for var lCustomer in lCustomers do // begin // Assert.IsMatch('^(Rome|London)$', lCustomer.City); @@ -1662,7 +1662,7 @@ begin LoadData; lCustomers := TMVCActiveRecord.SelectRQL(RQL1, MAXINT); try - Assert.AreEqual(240, lCustomers.Count); + Assert.AreEqual(240, lCustomers.Count); for var lCustomer in lCustomers do begin Assert.IsMatch('^(Rome|London)$', lCustomer.City); @@ -1673,14 +1673,14 @@ begin lCustomers := TMVCActiveRecord.SelectRQL(RQL1, 10); try - Assert.AreEqual(10, lCustomers.Count); + Assert.AreEqual(10, lCustomers.Count); finally lCustomers.Free; end; lCustomers := TMVCActiveRecord.SelectRQL(RQL1, 0); try - Assert.AreEqual(0, lCustomers.Count); + Assert.AreEqual(0, lCustomers.Count); finally lCustomers.Free; end; @@ -1701,7 +1701,7 @@ begin LoadData; lCustomers := TMVCActiveRecord.SelectRQL(RQL1, MAXINT); try - Assert.AreEqual(140, lCustomers.Count); + Assert.AreEqual(140, lCustomers.Count); finally lCustomers.Free; end; @@ -1731,7 +1731,7 @@ begin lCustomers := TMVCActiveRecord.SelectRQL(RQL1, MAXINT); try - Assert.AreEqual(1, lCustomers.Count); + Assert.AreEqual(1, lCustomers.Count); finally lCustomers.Free; end; @@ -1750,7 +1750,7 @@ begin LoadData; lCustomers := TMVCActiveRecord.SelectRQL(RQL1, MAXINT); try - Assert.AreEqual(240, lCustomers.Count); + Assert.AreEqual(240, lCustomers.Count); for var lCustomer in lCustomers do begin Assert.IsMatch('^(Rome|London)$', lCustomer.City); @@ -1829,7 +1829,7 @@ begin lCustomer.Note := 'note1'; lCustomer.Store; { pk is not set, so it should do an insert } lID := lCustomer.ID; - Assert.AreEqual(1, lID, 'ID should be 1 but it is ' + lID.ToString); + Assert.AreEqual(1, lID, 'ID should be 1 but it is ' + lID.ToString); finally lCustomer.Free; end; @@ -1923,7 +1923,7 @@ begin lCustomer.ID := -1; { don't be fooled by the default! } lCustomer.Insert; lID := lCustomer.ID; - Assert.AreEqual(1, lID); + Assert.AreEqual(1, lID); finally lCustomer.Free; end; diff --git a/unittests/general/Several/DMVCFrameworkTests.dproj b/unittests/general/Several/DMVCFrameworkTests.dproj index 145fad14..cdd46fb7 100644 --- a/unittests/general/Several/DMVCFrameworkTests.dproj +++ b/unittests/general/Several/DMVCFrameworkTests.dproj @@ -1,11 +1,11 @@  {0582DE6A-D716-46D3-8CBD-84AD73A4B536} - 19.5 + 20.1 VCL True TESTINSIGHT - Win64 + Win32 3 Console DMVCFrameworkTests.dpr @@ -47,6 +47,13 @@ true true + + true + Cfg_4 + true + true + true + true Cfg_4 @@ -122,7 +129,7 @@ false false false - DEBUG;TESTINSIGHT;$(DCC_Define) + DEBUG;$(DCC_Define) true @@ -160,6 +167,10 @@ 1033 + + 1033 + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + CI;$(DCC_Define) @@ -176,6 +187,9 @@ 1033 + + TESTINSIGHT;$(DCC_Define) + 1033 --include:lru @@ -263,10 +277,6 @@ Base - - Cfg_1 - Base - Cfg_2 Cfg_1 @@ -275,14 +285,18 @@ Cfg_4 Cfg_1 - - Cfg_5 - Cfg_4 - Cfg_6 Cfg_4 + + Cfg_1 + Base + + + Cfg_5 + Cfg_4 + Delphi.Personality.12 @@ -343,10 +357,8 @@ DMVCFrameworkTests.dpr - Embarcadero C++Builder Office 2000 Servers Package - Embarcadero C++Builder Office XP Servers Package - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components @@ -470,6 +482,16 @@ 1 + + + res\drawable-anydpi-v21 + 1 + + + res\drawable-anydpi-v21 + 1 + + res\values @@ -490,6 +512,66 @@ 1 + + + res\values-v31 + 1 + + + res\values-v31 + 1 + + + + + res\drawable-anydpi-v26 + 1 + + + res\drawable-anydpi-v26 + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-anydpi-v33 + 1 + + + res\drawable-anydpi-v33 + 1 + + res\values @@ -500,6 +582,16 @@ 1 + + + res\values-night-v21 + 1 + + + res\values-night-v21 + 1 + + res\drawable @@ -670,6 +762,56 @@ 1 + + + res\drawable-anydpi-v24 + 1 + + + res\drawable-anydpi-v24 + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-night-anydpi-v21 + 1 + + + res\drawable-night-anydpi-v21 + 1 + + + + + res\drawable-anydpi-v31 + 1 + + + res\drawable-anydpi-v31 + 1 + + + + + res\drawable-night-anydpi-v31 + 1 + + + res\drawable-night-anydpi-v31 + 1 + + 1 diff --git a/unittests/general/Several/FrameworkTestsU.pas b/unittests/general/Several/FrameworkTestsU.pas index a0d30dac..8a8782f6 100644 --- a/unittests/general/Several/FrameworkTestsU.pas +++ b/unittests/general/Several/FrameworkTestsU.pas @@ -421,16 +421,16 @@ begin Params.Clear; Assert.isTrue(FRouter.ExecuteRouting('/issue338/projectid/pictures/imageuuid', httpGET, 'text/plain', 'text/plain', FControllers, 'text/plain', TMVCMediaType.TEXT_PLAIN, '', Params, ResponseContentType, ResponseContentEncoding)); - Assert.areEqual('GetImage', FRouter.MethodToCall.Name); - Assert.areEqual(2, Params.Count); - Assert.areEqual('projectid', Params['projectid']); - Assert.areEqual('imageuuid', Params['imageuuid']); + Assert.AreEqual('GetImage', FRouter.MethodToCall.Name); + Assert.AreEqual(2, Params.Count); + Assert.AreEqual('projectid', Params['projectid']); + Assert.AreEqual('imageuuid', Params['imageuuid']); Params.Clear; Assert.isTrue(FRouter.ExecuteRouting('/issue338/projectid', httpGET, 'text/plain', 'text/plain', FControllers, 'text/plain', TMVCMediaType.TEXT_PLAIN, '', Params, ResponseContentType, ResponseContentEncoding)); Assert.areEqual('GetProject', FRouter.MethodToCall.Name); - Assert.areEqual(1, Params.Count); + Assert.areEqual(1, Params.Count); Assert.areEqual('projectid', Params['projectid']); finally Params.Free; @@ -450,7 +450,7 @@ begin Assert.isTrue(FRouter.ExecuteRouting('/issue492/delphi$mvc$framework', httpGET, 'text/plain', 'text/plain', FControllers, 'text/plain', TMVCMediaType.TEXT_PLAIN, '', Params, ResponseContentType, ResponseContentEncoding)); Assert.areEqual('GetIssue492', FRouter.MethodToCall.Name); - Assert.areEqual(1, Params.Count); + Assert.areEqual(1, Params.Count); Assert.areEqual('delphi$mvc$framework', Params['stringvalue']); finally Params.Free; @@ -470,7 +470,7 @@ begin Assert.isTrue(FRouter.ExecuteRouting('/patient/$match', httpGET, 'text/plain', 'text/plain', FControllers, 'text/plain', TMVCMediaType.TEXT_PLAIN, '', Params, ResponseContentType, ResponseContentEncoding)); Assert.areEqual('GetOrderIssue513', FRouter.MethodToCall.Name); - Assert.areEqual(0, Params.Count); + Assert.areEqual(0, Params.Count); finally Params.Free; end; @@ -489,7 +489,7 @@ begin Assert.isTrue(FRouter.ExecuteRouting('/patient/$match/daniele/teti', httpGET, 'text/plain', 'text/plain', FControllers, 'text/plain', TMVCMediaType.TEXT_PLAIN, '', Params, ResponseContentType, ResponseContentEncoding)); Assert.areEqual('GetOrderIssue513WithPars', FRouter.MethodToCall.Name); - Assert.areEqual(2, Params.Count); + Assert.areEqual(2, Params.Count); Assert.areEqual('daniele', Params['par1']); Assert.areEqual('teti', Params['par2']); finally @@ -510,7 +510,7 @@ begin Assert.isTrue(FRouter.ExecuteRouting('/patient/$match/da$niele/te$ti', httpGET, 'text/plain', 'text/plain', FControllers, 'text/plain', TMVCMediaType.TEXT_PLAIN, '', Params, ResponseContentType, ResponseContentEncoding)); Assert.areEqual('GetOrderIssue513WithPars', FRouter.MethodToCall.Name); - Assert.areEqual(2, Params.Count); + Assert.areEqual(2, Params.Count); Assert.areEqual('da$niele', Params['par1']); Assert.areEqual('te$ti', Params['par2']); finally @@ -1075,7 +1075,7 @@ begin try Assert.isTrue(FRouter.ExecuteRouting('/orders', httpGET, 'text/plain', 'text/plain', FControllers, 'text/plain', TMVCConstants.DEFAULT_CONTENT_CHARSET, '', Params, ResponseContentType, ResponseContentCharset)); - Assert.areEqual(0, Params.Count); + Assert.areEqual(0, Params.Count); Assert.areEqual('TSimpleController', FRouter.ControllerClazz.ClassName); Assert.areEqual('Orders', FRouter.MethodToCall.Name); Assert.areEqual(TMVCConstants.DEFAULT_CONTENT_CHARSET, ResponseContentCharset); @@ -1112,7 +1112,7 @@ begin Assert.isTrue(lRouter.ExecuteRouting('/api/orders', httpGET, 'text/plain', 'text/plain', FControllers, 'text/plain', TMVCConstants.DEFAULT_CONTENT_CHARSET, '/api', lParams, ResponseContentType, ResponseContentEncoding)); - Assert.areEqual(0, lParams.Count); + Assert.areEqual(0, lParams.Count); Assert.areEqual('TSimpleController', lRouter.ControllerClazz.ClassName); Assert.areEqual('Orders', lRouter.MethodToCall.Name); Assert.areEqual(TMVCConstants.DEFAULT_CONTENT_CHARSET, ResponseContentEncoding); @@ -1138,7 +1138,7 @@ begin try Assert.isTrue(FRouter.ExecuteRouting('/orders/789', httpGET, 'text/plain', 'text/plain', FControllers, 'text/plain', TMVCMediaType.TEXT_PLAIN, '', Params, ResponseContentType, ResponseContentEncoding)); - Assert.areEqual(1, Params.Count); + Assert.areEqual(1, Params.Count); Assert.areEqual('789', Params['ordernumber']); Assert.areEqual('TSimpleController', FRouter.ControllerClazz.ClassName); Assert.areEqual('OrderNumber', FRouter.MethodToCall.Name); @@ -1150,7 +1150,7 @@ begin try Assert.isTrue(FRouter.ExecuteRouting('/orders/àèéìòù .-_\', httpGET, 'text/plain', 'text/plain', FControllers, 'text/plain', TMVCMediaType.TEXT_PLAIN, '', Params, ResponseContentType, ResponseContentEncoding)); - Assert.areEqual(1, Params.Count); + Assert.areEqual(1, Params.Count); Assert.areEqual('àèéìòù .-_\', Params['ordernumber']); Assert.areEqual('TSimpleController', FRouter.ControllerClazz.ClassName); Assert.areEqual('OrderNumber', FRouter.MethodToCall.Name); @@ -1172,7 +1172,7 @@ begin Assert.isTrue(FRouter.ExecuteRouting('/orders', httpGET, '', 'application/json', FControllers, TMVCConstants.DEFAULT_CONTENT_TYPE, TMVCConstants.DEFAULT_CONTENT_CHARSET, '', Params, ResponseContentType, ResponseContentCharset)); - Assert.areEqual(0, Params.Count); + Assert.areEqual(0, Params.Count); Assert.areEqual('TSimpleController', FRouter.ControllerClazz.ClassName); Assert.areEqual('OrdersProduceJSON', FRouter.MethodToCall.Name); Assert.areEqual(TMVCConstants.DEFAULT_CONTENT_CHARSET, ResponseContentCharset); @@ -1193,7 +1193,7 @@ begin Assert.isTrue(FRouter.ExecuteRouting('/orders', httpGET, '', 'application/json; charset=UTF-8', FControllers, TMVCConstants.DEFAULT_CONTENT_TYPE, TMVCConstants.DEFAULT_CONTENT_CHARSET, '', Params, ResponseContentType, ResponseContentCharset)); - Assert.areEqual(0, Params.Count); + Assert.areEqual(0, Params.Count); Assert.areEqual('TSimpleController', FRouter.ControllerClazz.ClassName); Assert.areEqual('OrdersProduceJSON', FRouter.MethodToCall.Name); Assert.areEqual(TMVCConstants.DEFAULT_CONTENT_CHARSET, ResponseContentCharset); @@ -1465,7 +1465,7 @@ begin try Assert.isTrue(FRouter.ExecuteRouting('/', httpGET, 'text/plain', 'text/plain', FControllers, 'text/plain', TMVCMediaType.TEXT_PLAIN, '', Params, ResponseContentType, ResponseContentEncoding)); - Assert.areEqual(0, Params.Count); + Assert.areEqual(0, Params.Count); Assert.areEqual('TSimpleController', FRouter.ControllerClazz.ClassName); Assert.areEqual('Index', FRouter.MethodToCall.Name); finally @@ -1483,7 +1483,7 @@ begin try Assert.isTrue(FRouter.ExecuteRouting('', httpGET, 'text/plain', 'text/plain', FControllers, 'text/plain', TMVCMediaType.TEXT_PLAIN, '', Params, ResponseContentType, ResponseContentEncoding)); - Assert.areEqual(0, Params.Count); + Assert.areEqual(0, Params.Count); Assert.areEqual('TSimpleController', FRouter.ControllerClazz.ClassName); Assert.areEqual('Index', FRouter.MethodToCall.Name); finally @@ -1752,14 +1752,14 @@ begin Assert.isFalse(lMultiMap.Contains('key1')); lMultiMap.Add('key1', TMyIntfObject.Create(1, 'value1')); Assert.isTrue(lMultiMap.Contains('key1')); - Assert.areEqual(1, lMultiMap.GetItems('key1').Count); + Assert.areEqual(1, lMultiMap.GetItems('key1').Count); lMultiMap.Add('key1', TMyIntfObject.Create(2, 'value2')); - Assert.areEqual(2, lMultiMap.GetItems('key1').Count); + Assert.areEqual(2, lMultiMap.GetItems('key1').Count); Assert.areEqual('value1', lMultiMap.GetItems('key1')[0].GetDescription); Assert.areEqual('value2', lMultiMap.GetItems('key1')[1].GetDescription); lMultiMap.Add('key2', TMyIntfObject.Create(1, 'value3')); - Assert.areEqual(2, lMultiMap.GetItems('key1').Count); - Assert.areEqual(1, lMultiMap.GetItems('key2').Count); + Assert.areEqual(2, lMultiMap.GetItems('key1').Count); + Assert.areEqual(1, lMultiMap.GetItems('key2').Count); end; procedure TTestMultiMap.TestInterfaceMultiMapRemove; @@ -1770,7 +1770,7 @@ begin lMultiMap.Remove('not valid'); lMultiMap.Add('key1', TMyIntfObject.Create(1, 'value1')); lMultiMap.Add('key1', TMyIntfObject.Create(2, 'value2')); - Assert.areEqual(2, lMultiMap.GetItems('key1').Count); + Assert.areEqual(2, lMultiMap.GetItems('key1').Count); Assert.isTrue(lMultiMap.Contains('key1')); lMultiMap.Remove('key1'); Assert.isFalse(lMultiMap.Contains('key1')); @@ -1786,14 +1786,14 @@ begin Assert.isFalse(lMultiMap.Contains('key1')); lMultiMap.Add('key1', TMyClass.Create(1, 'value1')); Assert.isTrue(lMultiMap.Contains('key1')); - Assert.areEqual(1, lMultiMap.GetItems('key1').Count); + Assert.areEqual(1, lMultiMap.GetItems('key1').Count); lMultiMap.Add('key1', TMyClass.Create(2, 'value2')); - Assert.areEqual(2, lMultiMap.GetItems('key1').Count); + Assert.areEqual(2, lMultiMap.GetItems('key1').Count); Assert.areEqual('value1', lMultiMap.GetItems('key1')[0].Description); Assert.areEqual('value2', lMultiMap.GetItems('key1')[1].Description); lMultiMap.Add('key2', TMyClass.Create(1, 'value3')); - Assert.areEqual(2, lMultiMap.GetItems('key1').Count); - Assert.areEqual(1, lMultiMap.GetItems('key2').Count); + Assert.areEqual(2, lMultiMap.GetItems('key1').Count); + Assert.areEqual(1, lMultiMap.GetItems('key2').Count); end; procedure TTestMultiMap.TestObjectMultiMapRemove; @@ -1804,7 +1804,7 @@ begin lMultiMap.Remove('not valid'); lMultiMap.Add('key1', TMyClass.Create(1, 'value1')); lMultiMap.Add('key1', TMyClass.Create(2, 'value2')); - Assert.areEqual(2, lMultiMap.GetItems('key1').Count); + Assert.areEqual(2, lMultiMap.GetItems('key1').Count); Assert.isTrue(lMultiMap.Contains('key1')); lMultiMap.Remove('key1'); Assert.isFalse(lMultiMap.Contains('key1')); diff --git a/unittests/general/Several/LiveServerTestU.pas b/unittests/general/Several/LiveServerTestU.pas index 7f9b3679..77c4f4a8 100644 --- a/unittests/general/Several/LiveServerTestU.pas +++ b/unittests/general/Several/LiveServerTestU.pas @@ -736,7 +736,7 @@ var begin res := RESTClient.Get('/lotofcookies'); Assert.areEqual(HTTP_STATUS.OK, res.StatusCode); - Assert.areEqual(4, res.Cookies.Count, 'Wrong number of cookies'); + Assert.areEqual(4, res.Cookies.Count, 'Wrong number of cookies'); for I := 0 to 3 do begin Assert.areEqual('usersettings' + IntToStr(I + 1), res.Cookies[I].Name); diff --git a/unittests/general/Several/PGUtilsU.pas b/unittests/general/Several/PGUtilsU.pas index d02b3be5..3e178563 100644 --- a/unittests/general/Several/PGUtilsU.pas +++ b/unittests/general/Several/PGUtilsU.pas @@ -167,7 +167,8 @@ var lOutput: string; begin lParams := ' -D ' + fPGDataDir + - ' -E UTF8 --lc-collate=en_US.UTF8 --lc-ctype=en_US.UTF8 --locale=en_US'; + ' --encoding=UTF8 --lc-collate=en-US --lc-ctype=en-US --locale=en-US'; +// ' --encoding=UTF8 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8 --locale=en_US'; if SysExecute(fInitDBExecutable + lParams, lOutput) <> 0 then begin raise Exception.Create(lOutput); diff --git a/unittests/general/Several/Serializers.JsonDataObjectsTestU.pas b/unittests/general/Several/Serializers.JsonDataObjectsTestU.pas index d5e6b1f3..92f3debb 100644 --- a/unittests/general/Several/Serializers.JsonDataObjectsTestU.pas +++ b/unittests/general/Several/Serializers.JsonDataObjectsTestU.pas @@ -1433,10 +1433,10 @@ begin fSerializer.DeserializeObject(lData, lList2); - Assert.areEqual(2, lList2.ListOfString.Count); - Assert.areEqual(2, lList2.ListOfInteger.Count); - Assert.areEqual(2, lList2.ListOfBoolean.Count); - Assert.areEqual(2, lList2.ListOfDouble.Count); + Assert.areEqual(2, lList2.ListOfString.Count); + Assert.areEqual(2, lList2.ListOfInteger.Count); + Assert.areEqual(2, lList2.ListOfBoolean.Count); + Assert.areEqual(2, lList2.ListOfDouble.Count); Assert.areEqual(lList.ListOfString[0], lList2.ListOfString[0]); Assert.areEqual(lList.ListOfString[1], lList2.ListOfString[1]); @@ -1640,7 +1640,7 @@ begin Assert.areEqual(Integer(1), LGenericEntity.Code); Assert.areEqual('General Description', LGenericEntity.Description); - Assert.areEqual(Integer(5), LGenericEntity.Items.Count); + Assert.areEqual(5, LGenericEntity.Items.Count); Assert.areEqual('Description 01', LGenericEntity.Items[0].Description); Assert.areEqual('Description 02', LGenericEntity.Items[1].Description); Assert.areEqual('Description 03', LGenericEntity.Items[2].Description); @@ -1687,21 +1687,21 @@ begin Assert.areEqual(Integer(1), LNestedGenericEntity.Code); Assert.areEqual('General Description', LNestedGenericEntity.Description); - Assert.areEqual(Integer(3), LNestedGenericEntity.Items.Count); + Assert.areEqual(Integer(3), LNestedGenericEntity.Items.Count); - Assert.areEqual(Integer(10), LNestedGenericEntity.Items[0].Code); + Assert.areEqual(Integer(10), LNestedGenericEntity.Items[0].Code); Assert.areEqual('Item_01', LNestedGenericEntity.Items[0].Description); - Assert.areEqual(Integer(1), LNestedGenericEntity.Items[0].Items.Count); + Assert.areEqual(Integer(1), LNestedGenericEntity.Items[0].Items.Count); Assert.areEqual('Description 01', LNestedGenericEntity.Items[0].Items[0].Description); - Assert.areEqual(Integer(11), LNestedGenericEntity.Items[1].Code); + Assert.areEqual(Integer(11), LNestedGenericEntity.Items[1].Code); Assert.areEqual('Item_02', LNestedGenericEntity.Items[1].Description); - Assert.areEqual(Integer(1), LNestedGenericEntity.Items[1].Items.Count); + Assert.areEqual(Integer(1), LNestedGenericEntity.Items[1].Items.Count); Assert.areEqual('Description 02', LNestedGenericEntity.Items[1].Items[0].Description); - Assert.areEqual(Integer(12), LNestedGenericEntity.Items[2].Code); + Assert.areEqual(Integer(12), LNestedGenericEntity.Items[2].Code); Assert.areEqual('Item_03', LNestedGenericEntity.Items[2].Description); - Assert.areEqual(Integer(1), LNestedGenericEntity.Items[2].Items.Count); + Assert.areEqual(Integer(1), LNestedGenericEntity.Items[2].Items.Count); Assert.areEqual('Description 03', LNestedGenericEntity.Items[2].Items[0].Description); finally @@ -1795,14 +1795,14 @@ begin Assert.areEqual(Integer(1), LGenericEntity.Code); Assert.areEqual('General Description', LGenericEntity.Description); - Assert.areEqual(Integer(5), LGenericEntity.Items.Count); + Assert.areEqual(Integer(5), LGenericEntity.Items.Count); Assert.areEqual('Description 01', LGenericEntity.Items[0].Description); Assert.areEqual('Description 02', LGenericEntity.Items[1].Description); Assert.areEqual('Description 03', LGenericEntity.Items[2].Description); Assert.areEqual('Description 04', LGenericEntity.Items[3].Description); Assert.areEqual('Description 05', LGenericEntity.Items[4].Description); - Assert.areEqual(Integer(5), LGenericEntity.Items2.Count); + Assert.areEqual(Integer(5), LGenericEntity.Items2.Count); Assert.areEqual('Description2 01', LGenericEntity.Items2[0].Description); Assert.areEqual('Description2 02', LGenericEntity.Items2[1].Description); Assert.areEqual('Description2 03', LGenericEntity.Items2[2].Description); diff --git a/unittests/general/TestServer/TestServer.dproj b/unittests/general/TestServer/TestServer.dproj index abde1a9b..3317fabd 100644 --- a/unittests/general/TestServer/TestServer.dproj +++ b/unittests/general/TestServer/TestServer.dproj @@ -4,25 +4,15 @@ TestServer.dpr True CI - 131 + 3 Console None - 19.5 + 20.1 Win64 true - - true - Base - true - - - true - Base - true - true Base @@ -38,12 +28,6 @@ Base true - - true - Cfg_2 - true - true - true Cfg_2 @@ -70,16 +54,6 @@ $(BDS)\bin\delphi_PROJECTICON.ico $(BDS)\bin\delphi_PROJECTICNS.icns - - package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= - Debug - annotation-1.2.0.dex.jar;asynclayoutinflater-1.0.0.dex.jar;billing-4.0.0.dex.jar;browser-1.0.0.dex.jar;cloud-messaging.dex.jar;collection-1.0.0.dex.jar;coordinatorlayout-1.0.0.dex.jar;core-1.5.0-rc02.dex.jar;core-common-2.0.1.dex.jar;core-runtime-2.0.1.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;firebase-annotations-16.0.0.dex.jar;firebase-common-20.0.0.dex.jar;firebase-components-17.0.0.dex.jar;firebase-datatransport-18.0.0.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.0.0.dex.jar;firebase-installations-interop-17.0.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-22.0.0.dex.jar;fmx.dex.jar;fragment-1.0.0.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;legacy-support-core-ui-1.0.0.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.0.0.dex.jar;lifecycle-livedata-2.0.0.dex.jar;lifecycle-livedata-core-2.0.0.dex.jar;lifecycle-runtime-2.0.0.dex.jar;lifecycle-service-2.0.0.dex.jar;lifecycle-viewmodel-2.0.0.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;play-services-ads-20.1.0.dex.jar;play-services-ads-base-20.1.0.dex.jar;play-services-ads-identifier-17.0.0.dex.jar;play-services-ads-lite-20.1.0.dex.jar;play-services-base-17.5.0.dex.jar;play-services-basement-17.6.0.dex.jar;play-services-cloud-messaging-16.0.0.dex.jar;play-services-drive-17.0.0.dex.jar;play-services-games-21.0.0.dex.jar;play-services-location-18.0.0.dex.jar;play-services-maps-17.0.1.dex.jar;play-services-measurement-base-18.0.0.dex.jar;play-services-measurement-sdk-api-18.0.0.dex.jar;play-services-places-placereport-17.0.0.dex.jar;play-services-stats-17.0.0.dex.jar;play-services-tasks-17.2.0.dex.jar;print-1.0.0.dex.jar;room-common-2.1.0.dex.jar;room-runtime-2.1.0.dex.jar;slidingpanelayout-1.0.0.dex.jar;sqlite-2.0.1.dex.jar;sqlite-framework-2.0.1.dex.jar;swiperefreshlayout-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.0.0.dex.jar;transport-runtime-3.0.0.dex.jar;user-messaging-platform-1.0.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.1.0.dex.jar - - - package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= - Debug - annotation-1.2.0.dex.jar;asynclayoutinflater-1.0.0.dex.jar;billing-4.0.0.dex.jar;browser-1.0.0.dex.jar;cloud-messaging.dex.jar;collection-1.0.0.dex.jar;coordinatorlayout-1.0.0.dex.jar;core-1.5.0-rc02.dex.jar;core-common-2.0.1.dex.jar;core-runtime-2.0.1.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;firebase-annotations-16.0.0.dex.jar;firebase-common-20.0.0.dex.jar;firebase-components-17.0.0.dex.jar;firebase-datatransport-18.0.0.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.0.0.dex.jar;firebase-installations-interop-17.0.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-22.0.0.dex.jar;fmx.dex.jar;fragment-1.0.0.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;legacy-support-core-ui-1.0.0.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.0.0.dex.jar;lifecycle-livedata-2.0.0.dex.jar;lifecycle-livedata-core-2.0.0.dex.jar;lifecycle-runtime-2.0.0.dex.jar;lifecycle-service-2.0.0.dex.jar;lifecycle-viewmodel-2.0.0.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;play-services-ads-20.1.0.dex.jar;play-services-ads-base-20.1.0.dex.jar;play-services-ads-identifier-17.0.0.dex.jar;play-services-ads-lite-20.1.0.dex.jar;play-services-base-17.5.0.dex.jar;play-services-basement-17.6.0.dex.jar;play-services-cloud-messaging-16.0.0.dex.jar;play-services-drive-17.0.0.dex.jar;play-services-games-21.0.0.dex.jar;play-services-location-18.0.0.dex.jar;play-services-maps-17.0.1.dex.jar;play-services-measurement-base-18.0.0.dex.jar;play-services-measurement-sdk-api-18.0.0.dex.jar;play-services-places-placereport-17.0.0.dex.jar;play-services-stats-17.0.0.dex.jar;play-services-tasks-17.2.0.dex.jar;print-1.0.0.dex.jar;room-common-2.1.0.dex.jar;room-runtime-2.1.0.dex.jar;slidingpanelayout-1.0.0.dex.jar;sqlite-2.0.1.dex.jar;sqlite-framework-2.0.1.dex.jar;swiperefreshlayout-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.0.0.dex.jar;transport-runtime-3.0.0.dex.jar;user-messaging-platform-1.0.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.1.0.dex.jar - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) Debug @@ -102,10 +76,6 @@ true .\bin - - true - /usr/bin/xterm -e "%debuggee%" - 1033 CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) @@ -167,9 +137,6 @@ - False - False - True True True @@ -309,6 +276,16 @@ 1 + + + res\drawable-anydpi-v21 + 1 + + + res\drawable-anydpi-v21 + 1 + + res\values @@ -329,6 +306,66 @@ 1 + + + res\values-v31 + 1 + + + res\values-v31 + 1 + + + + + res\drawable-anydpi-v26 + 1 + + + res\drawable-anydpi-v26 + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-anydpi-v33 + 1 + + + res\drawable-anydpi-v33 + 1 + + res\values @@ -339,6 +376,16 @@ 1 + + + res\values-night-v21 + 1 + + + res\values-night-v21 + 1 + + res\drawable @@ -509,6 +556,56 @@ 1 + + + res\drawable-anydpi-v24 + 1 + + + res\drawable-anydpi-v24 + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-night-anydpi-v21 + 1 + + + res\drawable-night-anydpi-v21 + 1 + + + + + res\drawable-anydpi-v31 + 1 + + + res\drawable-anydpi-v31 + 1 + + + + + res\drawable-night-anydpi-v31 + 1 + + + res\drawable-night-anydpi-v31 + 1 + + 1