@@ -18,10 +18,8 @@ TEST_CASE("cloning an ellipse works", "[instancing]") {
1818 uint8_t * bytes = new uint8_t [length];
1919 REQUIRE (fread (bytes, 1 , length, fp) == length);
2020 auto reader = rive::BinaryReader (bytes, length);
21- rive::File* file = nullptr ;
22- auto result = rive::File::import (reader, &file);
21+ auto file = rive::File::import (reader);
2322
24- REQUIRE (result == rive::ImportResult::success);
2523 REQUIRE (file != nullptr );
2624 REQUIRE (file->artboard () != nullptr );
2725
@@ -33,8 +31,6 @@ TEST_CASE("cloning an ellipse works", "[instancing]") {
3331 REQUIRE (node->y () == clonedNode->y ());
3432
3533 delete clonedNode;
36-
37- delete file;
3834 delete[] bytes;
3935}
4036
@@ -48,10 +44,8 @@ TEST_CASE("instancing artboard clones clipped properties", "[instancing]") {
4844 uint8_t * bytes = new uint8_t [length];
4945 REQUIRE (fread (bytes, 1 , length, fp) == length);
5046 auto reader = rive::BinaryReader (bytes, length);
51- rive::File* file = nullptr ;
52- auto result = rive::File::import (reader, &file);
47+ auto file = rive::File::import (reader);
5348
54- REQUIRE (result == rive::ImportResult::success);
5549 REQUIRE (file != nullptr );
5650 REQUIRE (file->artboard () != nullptr );
5751 REQUIRE (!file->artboard ()->isInstance ());
@@ -74,7 +68,6 @@ TEST_CASE("instancing artboard clones clipped properties", "[instancing]") {
7468 rive::NoOpRenderer renderer;
7569 artboard->draw (&renderer);
7670
77- delete file;
7871 delete[] bytes;
7972}
8073
@@ -88,10 +81,8 @@ TEST_CASE("instancing artboard doesn't clone animations", "[instancing]") {
8881 uint8_t * bytes = new uint8_t [length];
8982 REQUIRE (fread (bytes, 1 , length, fp) == length);
9083 auto reader = rive::BinaryReader (bytes, length);
91- rive::File* file = nullptr ;
92- auto result = rive::File::import (reader, &file);
84+ auto file = rive::File::import (reader);
9385
94- REQUIRE (result == rive::ImportResult::success);
9586 REQUIRE (file != nullptr );
9687 REQUIRE (file->artboard () != nullptr );
9788
@@ -105,7 +96,7 @@ TEST_CASE("instancing artboard doesn't clone animations", "[instancing]") {
10596 REQUIRE (rive::LinearAnimation::deleteCount == 0 );
10697
10798 int numberOfAnimations = file->artboard ()->animationCount ();
108- delete file;
99+ file. reset ( nullptr ) ;
109100 // Now the animations should've been deleted.
110101 REQUIRE (rive::LinearAnimation::deleteCount == numberOfAnimations);
111102
0 commit comments