<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I’ve written a few unit tests for NSKeyedArchiver/NSKeyedUnarchiver but it could do with lots more (if anyone is interested!). We are gated by some methods not having isEqual() implementations yet (which is used to verify the test results).<div class=""><br class=""></div><div class="">The tests pass on both Linux and OS X, although presently the user class test is disabled for Linux as subclassing NSObject outside of Foundation is broken.<div class=""><br class=""></div><div class="">The NSKeyedArchiver tests encode an object (graph), decode it and check it matches. The NSKeyedUnarchiver tests decode an object (graph) that was encoded using OS X Foundation. We currently don’t exercise NSKeyedArchiver writing to a file, although it does work on both platforms.</div><div class=""><br class=""></div><div class="">— Luke</div><div class=""><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Executed 24 tests, with 0 failures (0 unexpected) in 0.001 (0.022) seconds</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_array' started.</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_array' passed (0.01 seconds).</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_dictionary' started.</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_dictionary' passed (0.013 seconds).</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_string' started.</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_string' passed (0.003 seconds).</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_mutable_array' started.</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_mutable_array' passed (0.01 seconds).</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_mutable_dictionary' started.</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_mutable_dictionary' passed (0.008 seconds).</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_null' started.</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_null' passed (0.006 seconds).</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_set' started.</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_set' passed (0.006 seconds).</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_url' started.</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_url' passed (0.007 seconds).</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_user_class' started.</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_user_class' passed (0.0 seconds).</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_uuid' started.</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedArchiver.test_archive_uuid' passed (0.008 seconds).</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Executed 10 tests, with 0 failures (0 unexpected) in 0.007 (0.071) seconds</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedUnarchiver.test_unarchive_array' started.</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedUnarchiver.test_unarchive_array' passed (0.004 seconds).</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedUnarchiver.test_unarchive_complex' started.</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedUnarchiver.test_unarchive_complex' passed (0.012 seconds).</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedUnarchiver.test_unarchive_concrete_value' started.</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedUnarchiver.test_unarchive_concrete_value' passed (0.01 seconds).</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedUnarchiver.test_unarchive_url' started.</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedUnarchiver.test_unarchive_url' passed (0.005 seconds).</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedUnarchiver.test_unarchive_uuid' started.</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Consolas; color: rgb(141, 166, 249); background-color: rgb(0, 0, 0);" class="">Test Case 'TestNSKeyedUnarchiver.test_unarchive_uuid' passed (0.003 seconds).</div></div><div class=""><br class=""></div></div></div></body></html>