mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 11:14:39 +00:00
Update all calls to aaruf_open.
This commit is contained in:
@@ -88,7 +88,7 @@ TEST_F(CreateImageFixture, create_image_uncompresed_duplicated)
|
||||
free(buffer);
|
||||
|
||||
// Reopen the image
|
||||
context = aaruf_open("test.aif");
|
||||
context = aaruf_open("test.aif", false, NULL);
|
||||
ASSERT_NE(context, nullptr) << "Failed to open test.aif";
|
||||
|
||||
// Get image info to verify it's a valid image
|
||||
@@ -181,7 +181,7 @@ TEST_F(CreateImageFixture, create_image_uncompresed_deduplicated)
|
||||
free(buffer);
|
||||
|
||||
// Reopen the image
|
||||
context = aaruf_open("test.aif");
|
||||
context = aaruf_open("test.aif", false, NULL);
|
||||
ASSERT_NE(context, nullptr) << "Failed to open test.aif";
|
||||
|
||||
// Get image info to verify it's a valid image
|
||||
@@ -274,7 +274,7 @@ TEST_F(CreateImageFixture, create_image_compresed_duplicated)
|
||||
free(buffer);
|
||||
|
||||
// Reopen the image
|
||||
context = aaruf_open("test.aif");
|
||||
context = aaruf_open("test.aif", false, NULL);
|
||||
ASSERT_NE(context, nullptr) << "Failed to open test.aif";
|
||||
|
||||
// Get image info to verify it's a valid image
|
||||
@@ -367,7 +367,7 @@ TEST_F(CreateImageFixture, create_image_compresed_deduplicated)
|
||||
free(buffer);
|
||||
|
||||
// Reopen the image
|
||||
context = aaruf_open("test.aif");
|
||||
context = aaruf_open("test.aif", false, NULL);
|
||||
ASSERT_NE(context, nullptr) << "Failed to open test.aif";
|
||||
|
||||
// Get image info to verify it's a valid image
|
||||
@@ -460,7 +460,7 @@ TEST_F(CreateImageFixture, create_image_table_shift_9)
|
||||
free(buffer);
|
||||
|
||||
// Reopen the image
|
||||
context = aaruf_open("test.aif");
|
||||
context = aaruf_open("test.aif", false, NULL);
|
||||
ASSERT_NE(context, nullptr) << "Failed to open test.aif";
|
||||
|
||||
// Get image info to verify it's a valid image
|
||||
@@ -581,7 +581,7 @@ TEST_F(CreateImageFixture, create_audio_image)
|
||||
free(buffer);
|
||||
|
||||
// Reopen the image
|
||||
context = aaruf_open("test_audio.aif");
|
||||
context = aaruf_open("test_audio.aif", false, NULL);
|
||||
ASSERT_NE(context, nullptr) << "Failed to open test_audio.aif";
|
||||
|
||||
// Get image info to verify it's a valid image
|
||||
|
||||
@@ -49,7 +49,7 @@ TEST_F(OpenImageFixture, open_mf2hd_v1)
|
||||
snprintf(filename, PATH_MAX, "%s/data/mf2hd_v1.aif", path);
|
||||
|
||||
// Attempt to open the image file
|
||||
void *context = aaruf_open(filename);
|
||||
void *context = aaruf_open(filename, false, NULL);
|
||||
|
||||
// Verify that the file was successfully opened
|
||||
ASSERT_NE(context, nullptr) << "Failed to open mf2hd_v1.aif";
|
||||
@@ -108,7 +108,7 @@ TEST_F(OpenImageFixture, open_mf2hd_v2)
|
||||
snprintf(filename, PATH_MAX, "%s/data/mf2hd.aif", path);
|
||||
|
||||
// Attempt to open the image file
|
||||
void *context = aaruf_open(filename);
|
||||
void *context = aaruf_open(filename, false, NULL);
|
||||
|
||||
// Verify that the file was successfully opened
|
||||
ASSERT_NE(context, nullptr) << "Failed to open mf2hd.aif";
|
||||
@@ -167,7 +167,7 @@ TEST_F(OpenImageFixture, open_floptical_v1)
|
||||
snprintf(filename, PATH_MAX, "%s/data/floptical_v1.aif", path);
|
||||
|
||||
// Attempt to open the image file
|
||||
void *context = aaruf_open(filename);
|
||||
void *context = aaruf_open(filename, false, NULL);
|
||||
|
||||
// Verify that the file was successfully opened
|
||||
ASSERT_NE(context, nullptr) << "Failed to open floptical_v1.aif";
|
||||
@@ -226,7 +226,7 @@ TEST_F(OpenImageFixture, open_floptical_v2)
|
||||
snprintf(filename, PATH_MAX, "%s/data/floptical.aif", path);
|
||||
|
||||
// Attempt to open the image file
|
||||
void *context = aaruf_open(filename);
|
||||
void *context = aaruf_open(filename, false, NULL);
|
||||
|
||||
// Verify that the file was successfully opened
|
||||
ASSERT_NE(context, nullptr) << "Failed to open floptical.aif";
|
||||
@@ -285,7 +285,7 @@ TEST_F(OpenImageFixture, open_gigamo_v1)
|
||||
snprintf(filename, PATH_MAX, "%s/data/gigamo_v1.aif", path);
|
||||
|
||||
// Attempt to open the image file
|
||||
void *context = aaruf_open(filename);
|
||||
void *context = aaruf_open(filename, false, NULL);
|
||||
|
||||
// Verify that the file was successfully opened
|
||||
ASSERT_NE(context, nullptr) << "Failed to open gigamo_v1.aif";
|
||||
@@ -344,7 +344,7 @@ TEST_F(OpenImageFixture, open_gigamo_v2)
|
||||
snprintf(filename, PATH_MAX, "%s/data/gigamo.aif", path);
|
||||
|
||||
// Attempt to open the image file
|
||||
void *context = aaruf_open(filename);
|
||||
void *context = aaruf_open(filename, false, NULL);
|
||||
|
||||
// Verify that the file was successfully opened
|
||||
ASSERT_NE(context, nullptr) << "Failed to open gigamo.aif";
|
||||
@@ -403,7 +403,7 @@ TEST_F(OpenImageFixture, open_hifd_v1)
|
||||
snprintf(filename, PATH_MAX, "%s/data/hifd_v1.aif", path);
|
||||
|
||||
// Attempt to open the image file
|
||||
void *context = aaruf_open(filename);
|
||||
void *context = aaruf_open(filename, false, NULL);
|
||||
|
||||
// Verify that the file was successfully opened
|
||||
ASSERT_NE(context, nullptr) << "Failed to open hifd_v1.aif";
|
||||
@@ -462,7 +462,7 @@ TEST_F(OpenImageFixture, open_hifd_v2)
|
||||
snprintf(filename, PATH_MAX, "%s/data/hifd.aif", path);
|
||||
|
||||
// Attempt to open the image file
|
||||
void *context = aaruf_open(filename);
|
||||
void *context = aaruf_open(filename, false, NULL);
|
||||
|
||||
// Verify that the file was successfully opened
|
||||
ASSERT_NE(context, nullptr) << "Failed to open hifd.aif";
|
||||
@@ -521,7 +521,7 @@ TEST_F(OpenImageFixture, open_mo540_v1)
|
||||
snprintf(filename, PATH_MAX, "%s/data/mo540_v1.aif", path);
|
||||
|
||||
// Attempt to open the image file
|
||||
void *context = aaruf_open(filename);
|
||||
void *context = aaruf_open(filename, false, NULL);
|
||||
|
||||
// Verify that the file was successfully opened
|
||||
ASSERT_NE(context, nullptr) << "Failed to open mo540_v1.aif";
|
||||
@@ -580,7 +580,7 @@ TEST_F(OpenImageFixture, open_mo540_v2)
|
||||
snprintf(filename, PATH_MAX, "%s/data/mo540.aif", path);
|
||||
|
||||
// Attempt to open the image file
|
||||
void *context = aaruf_open(filename);
|
||||
void *context = aaruf_open(filename, false, NULL);
|
||||
|
||||
// Verify that the file was successfully opened
|
||||
ASSERT_NE(context, nullptr) << "Failed to open mo540.aif";
|
||||
@@ -639,7 +639,7 @@ TEST_F(OpenImageFixture, open_mo640_v1)
|
||||
snprintf(filename, PATH_MAX, "%s/data/mo640_v1.aif", path);
|
||||
|
||||
// Attempt to open the image file
|
||||
void *context = aaruf_open(filename);
|
||||
void *context = aaruf_open(filename, false, NULL);
|
||||
|
||||
// Verify that the file was successfully opened
|
||||
ASSERT_NE(context, nullptr) << "Failed to open mo640_v1.aif";
|
||||
@@ -698,7 +698,7 @@ TEST_F(OpenImageFixture, open_mo640_v2)
|
||||
snprintf(filename, PATH_MAX, "%s/data/mo640.aif", path);
|
||||
|
||||
// Attempt to open the image file
|
||||
void *context = aaruf_open(filename);
|
||||
void *context = aaruf_open(filename, false, NULL);
|
||||
|
||||
// Verify that the file was successfully opened
|
||||
ASSERT_NE(context, nullptr) << "Failed to open mo640.aif";
|
||||
@@ -757,7 +757,7 @@ TEST_F(OpenImageFixture, open_cdmode1_v1)
|
||||
snprintf(filename, PATH_MAX, "%s/data/cdmode1_v1.aif", path);
|
||||
|
||||
// Attempt to open the image file
|
||||
void *context = aaruf_open(filename);
|
||||
void *context = aaruf_open(filename, false, NULL);
|
||||
|
||||
// Verify that the file was successfully opened
|
||||
ASSERT_NE(context, nullptr) << "Failed to open cdmode1_v1.aif";
|
||||
@@ -819,7 +819,7 @@ TEST_F(OpenImageFixture, open_cdmode1_v2)
|
||||
snprintf(filename, PATH_MAX, "%s/data/cdmode1.aif", path);
|
||||
|
||||
// Attempt to open the image file
|
||||
void *context = aaruf_open(filename);
|
||||
void *context = aaruf_open(filename, false, NULL);
|
||||
|
||||
// Verify that the file was successfully opened
|
||||
ASSERT_NE(context, nullptr) << "Failed to open cdmode1.aif";
|
||||
@@ -881,7 +881,7 @@ TEST_F(OpenImageFixture, open_cdmode2_v1)
|
||||
snprintf(filename, PATH_MAX, "%s/data/cdmode2_v1.aif", path);
|
||||
|
||||
// Attempt to open the image file
|
||||
void *context = aaruf_open(filename);
|
||||
void *context = aaruf_open(filename, false, NULL);
|
||||
|
||||
// Verify that the file was successfully opened
|
||||
ASSERT_NE(context, nullptr) << "Failed to open cdmode2_v1.aif";
|
||||
@@ -943,7 +943,7 @@ TEST_F(OpenImageFixture, open_cdmode2_v2)
|
||||
snprintf(filename, PATH_MAX, "%s/data/cdmode2.aif", path);
|
||||
|
||||
// Attempt to open the image file
|
||||
void *context = aaruf_open(filename);
|
||||
void *context = aaruf_open(filename, false, NULL);
|
||||
|
||||
// Verify that the file was successfully opened
|
||||
ASSERT_NE(context, nullptr) << "Failed to open cdmode2.aif";
|
||||
@@ -999,7 +999,7 @@ TEST_F(OpenImageFixture, open_cdmode2_v2)
|
||||
// Test opening a non-existent file
|
||||
TEST_F(OpenImageFixture, OpenNonExistentFile)
|
||||
{
|
||||
const void *context = aaruf_open("/nonexistent/path/to/file.aif");
|
||||
const void *context = aaruf_open("/nonexistent/path/to/file.aif", false, NULL);
|
||||
|
||||
// Should return NULL for non-existent files
|
||||
EXPECT_EQ(context, nullptr) << "Opening non-existent file should return NULL";
|
||||
@@ -1008,7 +1008,7 @@ TEST_F(OpenImageFixture, OpenNonExistentFile)
|
||||
// Test opening with NULL path
|
||||
TEST_F(OpenImageFixture, OpenNullPath)
|
||||
{
|
||||
const void *context = aaruf_open(nullptr);
|
||||
const void *context = aaruf_open(nullptr, false, NULL);
|
||||
|
||||
// Should return NULL for NULL path
|
||||
EXPECT_EQ(context, nullptr) << "Opening NULL path should return NULL";
|
||||
|
||||
@@ -44,7 +44,7 @@ int cli_compare(const char *path1, const char *path2, bool use_long)
|
||||
uint8_t sector_status2 = 0;
|
||||
|
||||
printf("Opening first image: %s\n", path1);
|
||||
ctx1 = aaruf_open(path1);
|
||||
ctx1 = aaruf_open(path1, false, NULL);
|
||||
if(ctx1 == NULL)
|
||||
{
|
||||
fprintf(stderr, "Error: Could not open first image '%s'\n", path1);
|
||||
@@ -52,7 +52,7 @@ int cli_compare(const char *path1, const char *path2, bool use_long)
|
||||
}
|
||||
|
||||
printf("Opening second image: %s\n", path2);
|
||||
ctx2 = aaruf_open(path2);
|
||||
ctx2 = aaruf_open(path2, false, NULL);
|
||||
if(ctx2 == NULL)
|
||||
{
|
||||
fprintf(stderr, "Error: Could not open second image '%s'\n", path2);
|
||||
|
||||
@@ -417,7 +417,7 @@ int compare(const char *path1, const char *path2)
|
||||
// Open first image
|
||||
tb_printf(2, 2, TB_WHITE | TB_BOLD, TB_BLUE, "Opening image...");
|
||||
tb_present();
|
||||
ctx1 = aaruf_open(path1);
|
||||
ctx1 = aaruf_open(path1, false, NULL);
|
||||
if(ctx1 == NULL)
|
||||
{
|
||||
tb_printf(2, 3, TB_RED | TB_BOLD, TB_BLUE, "Error opening image");
|
||||
@@ -430,7 +430,7 @@ int compare(const char *path1, const char *path2)
|
||||
// Open second image
|
||||
tb_printf(state.mid_x + 2, 2, TB_WHITE | TB_BOLD, TB_BLUE, "Opening image...");
|
||||
tb_present();
|
||||
ctx2 = aaruf_open(path2);
|
||||
ctx2 = aaruf_open(path2, false, NULL);
|
||||
if(ctx2 == NULL)
|
||||
{
|
||||
tb_printf(state.mid_x + 2, 3, TB_RED | TB_BOLD, TB_BLUE, "Error opening image");
|
||||
|
||||
@@ -41,7 +41,7 @@ int convert(const char *input_path, const char *output_path, bool use_long)
|
||||
printf("Converting image from %s to %s%s...\n", input_path, output_path, use_long ? " (long mode)" : "");
|
||||
|
||||
// Open input image
|
||||
input_ctx = aaruf_open(input_path);
|
||||
input_ctx = aaruf_open(input_path, false, NULL);
|
||||
if(input_ctx == NULL)
|
||||
{
|
||||
printf("Error %d when opening input AaruFormat image.\n", errno);
|
||||
|
||||
@@ -76,7 +76,7 @@ int info(const char *path)
|
||||
mediaTagEntry const *mediaTag = NULL;
|
||||
mediaTagEntry const *tmpMediaTag = NULL;
|
||||
|
||||
ctx = aaruf_open(path);
|
||||
ctx = aaruf_open(path, false, NULL);
|
||||
|
||||
if(ctx == NULL)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ int read(const unsigned long long sector_no, const char *path)
|
||||
uint8_t *data = NULL;
|
||||
uint8_t sector_status = 0;
|
||||
|
||||
ctx = aaruf_open(path);
|
||||
ctx = aaruf_open(path, false, NULL);
|
||||
|
||||
if(ctx == NULL)
|
||||
{
|
||||
@@ -85,7 +85,7 @@ int read_long(const unsigned long long sector_no, const char *path)
|
||||
uint8_t *data = NULL;
|
||||
uint8_t sector_status = 0;
|
||||
|
||||
ctx = aaruf_open(path);
|
||||
ctx = aaruf_open(path, false, NULL);
|
||||
|
||||
if(ctx == NULL)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ int verify(const char *path)
|
||||
aaruformat_context *ctx = NULL;
|
||||
uint32_t res = 0;
|
||||
|
||||
ctx = aaruf_open(path);
|
||||
ctx = aaruf_open(path, false, NULL);
|
||||
|
||||
if(ctx == NULL)
|
||||
{
|
||||
@@ -56,7 +56,7 @@ int verify_sectors(const char *path)
|
||||
uint32_t buffer_len = 2352;
|
||||
int32_t res = 0;
|
||||
CdEccContext *cd_ecc_context = NULL;
|
||||
ctx = aaruf_open(path);
|
||||
ctx = aaruf_open(path, false, NULL);
|
||||
bool verify_result = false;
|
||||
bool has_edc = false, has_ecc_p = false, ecc_p_correct = false, has_ecc_q = false, ecc_q_correct = false;
|
||||
bool edc_correct = false;
|
||||
|
||||
Reference in New Issue
Block a user