diff options
author | Maurizio Porrato <maurizio.porrato@gmail.com> | 2019-03-05 02:34:52 +0000 |
---|---|---|
committer | techknowlogick <matti@mdranta.net> | 2019-03-04 21:34:52 -0500 |
commit | 19862699cd4fcac672cf87310b192d3182357086 (patch) | |
tree | daf50ff68513844f2b065dac4888872ab9b0058d /models/u2f_test.go | |
parent | 141c58f5a6353a3e9173ababd1532819ba2ee284 (diff) | |
download | gitea-19862699cd4fcac672cf87310b192d3182357086.tar.gz gitea-19862699cd4fcac672cf87310b192d3182357086.zip |
Override xorm type mapping for U2F counter (#6232)
Diffstat (limited to 'models/u2f_test.go')
-rw-r--r-- | models/u2f_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/models/u2f_test.go b/models/u2f_test.go index 6d6cd495ca..0080c649cb 100644 --- a/models/u2f_test.go +++ b/models/u2f_test.go @@ -40,6 +40,14 @@ func TestU2FRegistration_UpdateCounter(t *testing.T) { AssertExistsIf(t, true, &U2FRegistration{ID: 1, Counter: 1}) } +func TestU2FRegistration_UpdateLargeCounter(t *testing.T) { + assert.NoError(t, PrepareTestDatabase()) + reg := AssertExistsAndLoadBean(t, &U2FRegistration{ID: 1}).(*U2FRegistration) + reg.Counter = 0xffffffff + assert.NoError(t, reg.UpdateCounter()) + AssertExistsIf(t, true, &U2FRegistration{ID: 1, Counter: 0xffffffff}) +} + func TestCreateRegistration(t *testing.T) { assert.NoError(t, PrepareTestDatabase()) user := AssertExistsAndLoadBean(t, &User{ID: 1}).(*User) |