Skip to content

Commit

Permalink
more checkrep!!! i love checkrep
Browse files Browse the repository at this point in the history
  • Loading branch information
arvid220u committed Jun 29, 2022
1 parent 999a256 commit f7bf199
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
17 changes: 17 additions & 0 deletions daemon/db/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,23 @@ impl DB {
assert!(registration_count == 0, "registration_count = {}, has_registered = {}", registration_count, has_registered);
}

// transmission table iff !deleted
let transmission_non_deleted_count = friend::table.filter(friend::deleted.eq(false)).inner_join(transmission::table).count().get_result::<i64>(conn_b).unwrap();
let non_deleted_count = friend::table.filter(friend::deleted.eq(false)).count().get_result::<i64>(conn_b).unwrap();
let transmission_count = transmission::table.count().get_result::<i64>(conn_b).unwrap();
assert!(
transmission_non_deleted_count == non_deleted_count,
"transmission_non_deleted_count = {}, non_deleted_count = {}",
transmission_non_deleted_count,
non_deleted_count
);
assert!(
transmission_count == transmission_non_deleted_count,
"transmission_count = {}, transmission_non_deleted_count = {}",
transmission_count,
transmission_non_deleted_count
);

Ok(())
})
.unwrap();
Expand Down
4 changes: 0 additions & 4 deletions daemon/db/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,6 @@ fn test_send_msg() {
let msg = "hi im a single chunk";
db.queue_message_to_send("friend_1", msg, vec![msg.to_string()]).unwrap();

unsafe {
db.dump();
}

let chunk_to_send = db.chunk_to_send(vec![]).unwrap();

// the chunk to send will be the system message for the outgoing invitation
Expand Down

0 comments on commit f7bf199

Please sign in to comment.