Skip to content

Commit e005c14

Browse files
committed
Fix broken tests due to mismatched timestamp magnitude
1 parent 44eb09d commit e005c14

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/test_session_protocol.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ static SerialisedProtobufContentWithProForTesting build_protobuf_content_with_se
6363
result.proof.gen_index_hash.data(), result.proof.gen_index_hash.size());
6464
proto_proof->set_rotatingpublickey(
6565
result.proof.rotating_pubkey.data(), result.proof.rotating_pubkey.size());
66-
proto_proof->set_expiryunixts(result.proof.expiry_unix_ts.time_since_epoch().count());
66+
proto_proof->set_expiryunixts(
67+
std::chrono::duration_cast<std::chrono::seconds>(
68+
result.proof.expiry_unix_ts.time_since_epoch())
69+
.count());
6770
proto_proof->set_sig(result.proof.sig.data(), result.proof.sig.size());
6871

6972
// Generate the plaintext
@@ -662,7 +665,9 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") {
662665
&multi_decrypt_keys,
663666
encrypt_result.ciphertext.data,
664667
encrypt_result.ciphertext.size,
665-
protobuf_content_with_pro.proof.expiry_unix_ts.time_since_epoch().count(),
668+
std::chrono::duration_cast<std::chrono::seconds>(
669+
protobuf_content_with_pro.proof.expiry_unix_ts.time_since_epoch())
670+
.count(),
666671
pro_backend_ed_pk.data(),
667672
pro_backend_ed_pk.size(),
668673
error,

0 commit comments

Comments
 (0)