Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 committed Nov 21, 2024
1 parent 01499ea commit e3c25d8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Test/AwsCommonRuntimeKitTests/crt/CBOR.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0.

import XCTest
import AwsCCommon
import XCTest

@testable import AwsCommonRuntimeKit

class CBORTests: XCBaseTestCase {
Expand Down Expand Up @@ -38,12 +39,15 @@ class CBORTests: XCBaseTestCase {
.indef_break,
]

// encode the values
let encoder = try! CBOREncoder()
for value in values {
encoder.encode(value)
// encode the values. Drop the encoder to verify lifetime semantics.
var encoded: [UInt8] = []
do {
let encoder = try! CBOREncoder()
for value in values {
encoder.encode(value)
}
encoded = encoder.getEncoded()
}
let encoded = encoder.getEncoded();

// decode the values
let decoder = try! CBORDecoder(data: encoded)
Expand Down

0 comments on commit e3c25d8

Please sign in to comment.