Skip to content

Commit cb7b18c

Browse files
Add JavaDoc Description for DefaultSizeTest Class
1 parent 6c99124 commit cb7b18c

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

src/test/java/org/javawebstack/orm/test/automigrate/DefaultSizeTest.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,21 @@
1515

1616
import java.sql.SQLException;
1717

18+
/**
19+
* This class tests if the default size is being applied for the types:
20+
* - String
21+
* - char[]
22+
*
23+
* This class also tests that the default size is not applied to the type:
24+
* - short
25+
* - Short
26+
* - int
27+
* - Integer
28+
* - float
29+
* - Float
30+
* - double
31+
* - Double
32+
*/
1833
public class DefaultSizeTest extends ORMTestCase {
1934

2035
// Copy from DefaultMapper:
@@ -29,9 +44,9 @@ public class DefaultSizeTest extends ORMTestCase {
2944
// The max sizes given in the manual are in bytes. There are overheads which need to be subtracted.
3045
// The following values assume utf8mb4 encoding which uses 4 bytes per character and
3146
// further quarters the maximum column length accordingly.
32-
private static final long MAX_SIZE_VARCHAR = (long) Math.floor((65535 - BYTES_OVERHEAD_VARCHAR) / 4);
33-
private static final long MAX_SIZE_MEDIUMTEXT = (long) Math.floor((16777215 - BYTES_OVERHEAD_MEDIUMTEXT) / 4);
34-
private static final long MAX_SIZE_LONGTEXT = (long) Math.floor((4294967295L - BYTES_OVERHEAD_LONGTEXT) / 4);
47+
private static final long MAX_SIZE_VARCHAR = (long) Math.floor((65535 - BYTES_OVERHEAD_VARCHAR) / 4.0);
48+
private static final long MAX_SIZE_MEDIUMTEXT = (long) Math.floor((16777215 - BYTES_OVERHEAD_MEDIUMTEXT) / 4.0);
49+
private static final long MAX_SIZE_LONGTEXT = (long) Math.floor((4294967295L - BYTES_OVERHEAD_LONGTEXT) / 4.0);
3550

3651
final static String tableNameString = "just_strings";
3752
final static String columnNameString = "string";

0 commit comments

Comments
 (0)