@@ -71,17 +71,21 @@ TEST_F(nix_api_store_test, ReturnsValidStorePath)
71
71
ASSERT_NE (result, nullptr );
72
72
ASSERT_STREQ (" name" , result->path .name ().data ());
73
73
ASSERT_STREQ (PATH_SUFFIX.substr (1 ).c_str (), result->path .to_string ().data ());
74
+ nix_store_path_free (result);
74
75
}
75
76
76
77
TEST_F (nix_api_store_test, SetsLastErrCodeToNixOk)
77
78
{
78
- nix_store_parse_path (ctx, store, (nixStoreDir + PATH_SUFFIX).c_str ());
79
+ StorePath * path = nix_store_parse_path (ctx, store, (nixStoreDir + PATH_SUFFIX).c_str ());
79
80
ASSERT_EQ (ctx->last_err_code , NIX_OK);
81
+ nix_store_path_free (path);
80
82
}
81
83
82
84
TEST_F (nix_api_store_test, DoesNotCrashWhenContextIsNull)
83
85
{
84
- ASSERT_NO_THROW (nix_store_parse_path (ctx, store, (nixStoreDir + PATH_SUFFIX).c_str ()));
86
+ StorePath * path = nullptr ;
87
+ ASSERT_NO_THROW (path = nix_store_parse_path (ctx, store, (nixStoreDir + PATH_SUFFIX).c_str ()));
88
+ nix_store_path_free (path);
85
89
}
86
90
87
91
TEST_F (nix_api_store_test, get_version)
@@ -119,6 +123,7 @@ TEST_F(nix_api_store_test, nix_store_is_valid_path_not_in_store)
119
123
{
120
124
StorePath * path = nix_store_parse_path (ctx, store, (nixStoreDir + PATH_SUFFIX).c_str ());
121
125
ASSERT_EQ (false , nix_store_is_valid_path (ctx, store, path));
126
+ nix_store_path_free (path);
122
127
}
123
128
124
129
TEST_F (nix_api_store_test, nix_store_real_path)
0 commit comments