Commit d45e352
committed
test: drop Enum.ordinal() dependence (Error Prone EnumOrdinal) in two tests
Both tests depended on Enum.ordinal(), which Error Prone flags (EnumOrdinal):
ordinal is an implementation detail and tying assertions to it is fragile.
- value/LogLevelTest: testOrdinalOrder asserted pairwise ordinal inequalities.
Replaced with testDeclarationOrder, which assertArrayEquals against
LogLevel.values() (declaration order) — pins the full least-to-most-severe
order without ordinal(), and is strictly stronger.
- parameters/ModelParametersExtendedTest: testSetMirostatAllValues compared the
emitted --mirostat value to String.valueOf(m.ordinal()), a coincidence that
ordinal 0/1/2 matches MiroStat's CLI arg values. Now asserts against
m.getArgValue() — the contract setMirostat actually writes (via putEnum) —
mirroring the sibling rope-scaling test.
Verified: full `mvn test-compile` reports 0 EnumOrdinal warnings; LogLevelTest
7/7 and ModelParametersExtendedTest 140/140 pass; spotless:check clean.1 parent ed5a82a commit d45e352
2 files changed
Lines changed: 10 additions & 6 deletions
File tree
- src/test/java/net/ladenthin/llama
- parameters
- value
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1031 | 1031 | | |
1032 | 1032 | | |
1033 | 1033 | | |
1034 | | - | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
1035 | 1037 | | |
1036 | 1038 | | |
1037 | 1039 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
0 commit comments