summaryrefslogtreecommitdiffstats
path: root/db/db_test.go
diff options
context:
space:
mode:
authorsiddharth <s@ricketyspace.net>2021-11-28 17:03:18 -0500
committersiddharth <s@ricketyspace.net>2021-11-28 17:03:18 -0500
commit337741015cc46179fa8886079a416bb2fe4f4845 (patch)
tree0e914f58f1a86b2fb9951eadecfa75e7491c3314 /db/db_test.go
parent8adac927363d1f541b0737c96c713cd6d79acb79 (diff)
db: update FernDB
Add `mutex` field to the FernDB struct.
Diffstat (limited to 'db/db_test.go')
-rw-r--r--db/db_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/db/db_test.go b/db/db_test.go
index 5a2a983..e2308c1 100644
--- a/db/db_test.go
+++ b/db/db_test.go
@@ -46,6 +46,14 @@ func TestOpenNewDB(t *testing.T) {
return
}
+ // Verify that 'mutex' is initialized.
+ if db.mutex == nil {
+ t.Errorf("db.mutex is nil")
+ return
+ }
+ db.mutex.Lock()
+ db.mutex.Unlock()
+
// Verify that 'downloaded' is initialized
if db.downloaded == nil {
t.Errorf("db.downloaded is nil")
@@ -77,6 +85,14 @@ func TestOpenExistingDB(t *testing.T) {
return
}
+ // Verify that 'mutex' is initialized.
+ if db.mutex == nil {
+ t.Errorf("db.mutex is nil")
+ return
+ }
+ db.mutex.Lock()
+ db.mutex.Unlock()
+
// Validate db.downloaded.
var entries, expectedEntries []string
var ok bool