File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
src/test/java/org/javawebstack/orm/test/automigrate Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change 1515
1616import 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+ */
1833public 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" ;
You can’t perform that action at this time.
0 commit comments