[Libreoffice-commits] core.git: sccomp/qa

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 9 17:58:15 UTC 2021


 sccomp/qa/unit/SwarmSolverTest.cxx |   21 +++++++--------------
 sccomp/qa/unit/solver.cxx          |    3 +--
 2 files changed, 8 insertions(+), 16 deletions(-)

New commits:
commit 5897a97bb53bcbf2283161cc22f43d87f575f3d6
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Wed Jun 9 18:14:41 2021 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Wed Jun 9 19:57:11 2021 +0200

    Simplify Sequences initializations (sccomp)
    
    Change-Id: I6316e1318ae1ee68e5d4e4529731bca0d1860b58
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116932
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/sccomp/qa/unit/SwarmSolverTest.cxx b/sccomp/qa/unit/SwarmSolverTest.cxx
index b7d3becc475c..78cfccaaa376 100644
--- a/sccomp/qa/unit/SwarmSolverTest.cxx
+++ b/sccomp/qa/unit/SwarmSolverTest.cxx
@@ -75,8 +75,7 @@ void SwarmSolverTest::testUnconstrained()
     table::CellAddress aObjective(0, 1, 1);
 
     // "changing cells" - unknown variables
-    uno::Sequence<table::CellAddress> aVariables(1);
-    aVariables[0] = table::CellAddress(0, 1, 0);
+    uno::Sequence<table::CellAddress> aVariables{ { 0, 1, 0 } };
 
     // constraints
     uno::Sequence<sheet::SolverConstraint> aConstraints;
@@ -125,8 +124,7 @@ void SwarmSolverTest::testVariableBounded()
     table::CellAddress aObjective(0, 1, 1);
 
     // "changing cells" - unknown variables
-    uno::Sequence<table::CellAddress> aVariables(1);
-    aVariables[0] = table::CellAddress(0, 1, 0);
+    uno::Sequence<table::CellAddress> aVariables{ { 0, 1, 0 } };
 
     // constraints
     uno::Sequence<sheet::SolverConstraint> aConstraints(2);
@@ -177,8 +175,7 @@ void SwarmSolverTest::testVariableConstrained()
     table::CellAddress aObjective(0, 1, 1);
 
     // "changing cells" - unknown variables
-    uno::Sequence<table::CellAddress> aVariables(1);
-    aVariables[0] = table::CellAddress(0, 1, 0);
+    uno::Sequence<table::CellAddress> aVariables{ { 0, 1, 0 } };
 
     // constraints
     uno::Sequence<sheet::SolverConstraint> aConstraints(3);
@@ -233,9 +230,7 @@ void SwarmSolverTest::testTwoVariables()
     table::CellAddress aObjective(0, 1, 5);
 
     // "changing cells" - unknown variables
-    uno::Sequence<table::CellAddress> aVariables(2);
-    aVariables[0] = table::CellAddress(0, 1, 2);
-    aVariables[1] = table::CellAddress(0, 1, 3);
+    uno::Sequence<table::CellAddress> aVariables{ { 0, 1, 2 }, { 0, 1, 3 } };
 
     // constraints
     uno::Sequence<sheet::SolverConstraint> aConstraints(4);
@@ -299,11 +294,9 @@ void SwarmSolverTest::testMultipleVariables()
     table::CellAddress aObjective(0, 5, 7);
 
     // "changing cells" - unknown variables
-    uno::Sequence<table::CellAddress> aVariables(4);
-    aVariables[0] = table::CellAddress(0, 6, 1);
-    aVariables[1] = table::CellAddress(0, 6, 2);
-    aVariables[2] = table::CellAddress(0, 6, 3);
-    aVariables[3] = table::CellAddress(0, 6, 4);
+    uno::Sequence<table::CellAddress> aVariables{
+        { 0, 6, 1 }, { 0, 6, 2 }, { 0, 6, 3 }, { 0, 6, 4 }
+    };
 
     // constraints
     uno::Sequence<sheet::SolverConstraint> aConstraints(12);
diff --git a/sccomp/qa/unit/solver.cxx b/sccomp/qa/unit/solver.cxx
index 4405279e26cb..eedbce69f274 100644
--- a/sccomp/qa/unit/solver.cxx
+++ b/sccomp/qa/unit/solver.cxx
@@ -87,8 +87,7 @@ void LpSolverTest::testSolver(OUString const & rName)
     table::CellAddress aObjective(0, 0, 0);
 
     // "changing cells" - unknown variables
-    uno::Sequence<table::CellAddress> aVariables(1);
-    aVariables[0] = table::CellAddress(0, 0, 0);
+    uno::Sequence<table::CellAddress> aVariables { {0, 0, 0 } };
 
     // constraints
     uno::Sequence<sheet::SolverConstraint> aConstraints(1);


More information about the Libreoffice-commits mailing list