Prechádzať zdrojové kódy

Fix some fortune tests (#6382)

* Fix some fortune tests

* Fix some fortune tests

* Fix some fortune tests
Nate 4 rokov pred
rodič
commit
47400e9280

+ 3 - 3
frameworks/CSharp/aspnetcore-mono/PlatformBenchmarks/Data/RawDb.cs

@@ -96,7 +96,7 @@ namespace PlatformBenchmarks
                     var (cmd, idParameter) = rawdb.CreateReadCommand(db);
                     var (cmd, idParameter) = rawdb.CreateReadCommand(db);
                     using (cmd)
                     using (cmd)
                     {
                     {
-                        Func<ICacheEntry, Task<CachedWorld>> create = async (entry) => 
+                        Func<ICacheEntry, Task<CachedWorld>> create = async (entry) =>
                         {
                         {
                             return await rawdb.ReadSingleRow(cmd);
                             return await rawdb.ReadSingleRow(cmd);
                         };
                         };
@@ -186,7 +186,7 @@ namespace PlatformBenchmarks
 
 
         public async Task<List<Fortune>> LoadFortunesRows()
         public async Task<List<Fortune>> LoadFortunesRows()
         {
         {
-            var result = new List<Fortune>(20);
+            var result = new List<Fortune>();
 
 
             using (var db = new NpgsqlConnection(_connectionString))
             using (var db = new NpgsqlConnection(_connectionString))
             {
             {
@@ -249,7 +249,7 @@ namespace PlatformBenchmarks
             public bool Equals(CacheKey key)
             public bool Equals(CacheKey key)
                 => key._value == _value;
                 => key._value == _value;
 
 
-            public override bool Equals(object obj) 
+            public override bool Equals(object obj)
                 => ReferenceEquals(obj, this);
                 => ReferenceEquals(obj, this);
 
 
             public override int GetHashCode()
             public override int GetHashCode()

+ 3 - 3
frameworks/CSharp/aspnetcore/PlatformBenchmarks/Data/RawDb.cs

@@ -96,7 +96,7 @@ namespace PlatformBenchmarks
                     var (cmd, idParameter) = rawdb.CreateReadCommand(db);
                     var (cmd, idParameter) = rawdb.CreateReadCommand(db);
                     using (cmd)
                     using (cmd)
                     {
                     {
-                        Func<ICacheEntry, Task<CachedWorld>> create = async (entry) => 
+                        Func<ICacheEntry, Task<CachedWorld>> create = async (entry) =>
                         {
                         {
                             return await rawdb.ReadSingleRow(cmd);
                             return await rawdb.ReadSingleRow(cmd);
                         };
                         };
@@ -186,7 +186,7 @@ namespace PlatformBenchmarks
 
 
         public async Task<List<Fortune>> LoadFortunesRows()
         public async Task<List<Fortune>> LoadFortunesRows()
         {
         {
-            var result = new List<Fortune>(20);
+            var result = new List<Fortune>();
 
 
             using (var db = new NpgsqlConnection(_connectionString))
             using (var db = new NpgsqlConnection(_connectionString))
             {
             {
@@ -249,7 +249,7 @@ namespace PlatformBenchmarks
             public bool Equals(CacheKey key)
             public bool Equals(CacheKey key)
                 => key._value == _value;
                 => key._value == _value;
 
 
-            public override bool Equals(object obj) 
+            public override bool Equals(object obj)
                 => ReferenceEquals(obj, this);
                 => ReferenceEquals(obj, this);
 
 
             public override int GetHashCode()
             public override int GetHashCode()

+ 1 - 1
frameworks/Java/servlet/src/main/java/hello/FortunesServlet.java

@@ -40,7 +40,7 @@ public class FortunesServlet extends HttpServlet {
 		res.setCharacterEncoding(UTF8);
 		res.setCharacterEncoding(UTF8);
 		res.setContentType(CONTENT_TYPE_HTML_UTF8);
 		res.setContentType(CONTENT_TYPE_HTML_UTF8);
 
 
-		final List<Fortune> fortunes = new ArrayList<>(32);
+		final List<Fortune> fortunes = new ArrayList<>();
 
 
 		try (Connection conn = dataSource.getConnection()) {
 		try (Connection conn = dataSource.getConnection()) {
 			Common.modifySQLConnectionSettings(conn);
 			Common.modifySQLConnectionSettings(conn);

+ 1 - 1
frameworks/Java/wizzardo-http/src/main/java/com/wizzardo/techempower/DBController.java

@@ -147,7 +147,7 @@ public class DBController extends Controller {
             try {
             try {
                 if (res.succeeded()) {
                 if (res.succeeded()) {
                     PgRowSet result = res.result();
                     PgRowSet result = res.result();
-                    ArrayList<Fortune> fortunes = new ArrayList<>(result.size() + 1);
+                    ArrayList<Fortune> fortunes = new ArrayList<>();
                     for (Row row : result) {
                     for (Row row : result) {
                         fortunes.add(new Fortune(row.getInteger(0), row.getString(1)));
                         fortunes.add(new Fortune(row.getInteger(0), row.getString(1)));
                     }
                     }