2
0
Эх сурвалжийг харах

fcl-db: tests: fix TestStreamingNullFieldsXML (only fields which are not required and not readonly can be set to Null)

git-svn-id: trunk@25452 -
lacak 12 жил өмнө
parent
commit
47f9c32f11

+ 5 - 3
packages/fcl-db/tests/testbufdatasetstreams.pas

@@ -560,13 +560,15 @@ begin
     Open;
     Next;
     Edit;
-    // set all fields to null
+    // set all fields, which are not required to null
     for i:=0 to FieldCount-1 do
-      Fields[i].Clear;
+      if not Fields[i].Required and not Fields[i].ReadOnly then
+        Fields[i].Clear;
     Post;
     // check if they are null
     for i:=0 to FieldCount-1 do
-      AssertTrue(Fields[i].FieldName, Fields[i].IsNull);
+      if not Fields[i].Required and not Fields[i].ReadOnly then
+        AssertTrue(Fields[i].FieldName, Fields[i].IsNull);
     SaveToFile(TestXMLFileName, dfXML);
     end;