     func deserialize_allowFragments(objectType: ObjectType) {
         let subject = "3"
 
-        do {
-            for encoding in supportedEncodings {
-                guard let data = subject.data(using: encoding) else {
-                    XCTFail("Unable to convert string to data")
-                    return
-                }
-                let result = try getjsonObjectResult(data, objectType) as? Int
+        for encoding in supportedEncodings {
+            guard let data = subject.data(using: encoding) else {
+                XCTFail("Unable to convert string to data using encoding \(encoding)")
+                continue
+            }
+
+            // Check failure to decode without .allowFragments
+            XCTAssertThrowsError(try getjsonObjectResult(data, objectType)) {
+                let nserror = ($0 as! NSError)
+                XCTAssertEqual(nserror.domain, NSCocoaErrorDomain)
+                let code = CocoaError(_nsError: nserror).code
+                XCTAssertEqual(code, .propertyListReadCorrupt)
+            }
+
+            do {
+                let result = try getjsonObjectResult(data, objectType, options: .allowFragments) as? Int
                 XCTAssertEqual(result, 3)
-            }
-        } catch {
-            XCTFail("Unexpected error: \(error)")
+            } catch {
+                XCTFail("Unexpected error: \(error) using encoding \(encoding)")
+            }
         }
     }
 

        deserialize_unicodeSurrogatePairEscapeSequence(objectType: .data)
    }

    // Disabled due to uninitialized memory SR-606
    //    func test_deserialize_allowFragments_withData() {
    //        deserialize_allowFragments(objectType: .data)
    //    }

    func test_deserialize_unterminatedObjectString_withData() {
        deserialize_unterminatedObjectString(objectType: .data)

            ("test_deserialize_simpleEscapeSequences_withStream", test_deserialize_simpleEscapeSequences_withStream),
            ("test_deserialize_unicodeEscapeSequence_withStream", test_deserialize_unicodeEscapeSequence_withStream),
            ("test_deserialize_unicodeSurrogatePairEscapeSequence_withStream", test_deserialize_unicodeSurrogatePairEscapeSequence_withStream),
            ("test_deserialize_allowFragments_withStream", test_deserialize_allowFragments_withStream),

            ("test_deserialize_unterminatedObjectString_withStream", test_deserialize_unterminatedObjectString_withStream),
            ("test_deserialize_missingObjectKey_withStream", test_deserialize_missingObjectKey_withStream),
