Skip to content

Commit

Permalink
Add tests for new deadbeef object id
Browse files Browse the repository at this point in the history
  • Loading branch information
petabyt committed Mar 24, 2024
1 parent e428421 commit 0a8dbfe
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,6 @@ int test_fs() {
rc = ptp_get_storage_info(&r, arr->data[0], &si);
if (rc) return rc;

assert(ptp_get_return_code(&r) == PTP_RC_OK);

ptp_storage_info_json(&si, buffer, sizeof(buffer));
printf("%s\n", buffer);

Expand All @@ -214,6 +212,12 @@ int test_fs() {
printf("File size: %u\n", oi.compressed_size);
}

struct PtpObjectInfo oi;
rc = ptp_get_object_info(&r, 0xdeadbeef, &oi);
if (rc) return rc;
assert(!strcmp(oi.filename, "test.png"));
assert(oi.compressed_size == 1234);

free(arr);

ptp_close(&r);
Expand Down Expand Up @@ -269,29 +273,29 @@ static int test_multithread() {
int main() {
int rc;

rc = test_multithread();
printf("Return code: %d\n", rc);
if (rc) return rc;

rc = test_eos_t6();
printf("Return code: %d\n", rc);
if (rc) return rc;

rc = test_bind();
printf("Return code: %d\n", rc);
if (rc) return rc;
// rc = test_multithread();
// printf("Return code: %d\n", rc);
// if (rc) return rc;
//
// rc = test_eos_t6();
// printf("Return code: %d\n", rc);
// if (rc) return rc;
//
// rc = test_bind();
// printf("Return code: %d\n", rc);
// if (rc) return rc;

rc = test_fs();
printf("Return code: %d\n", rc);
if (rc) return rc;

rc = ptp_vcam_magic();
printf("Return code: %d\n", rc);
if (rc) return rc;

rc = test_props();
printf("Return code: %d\n", rc);
if (rc) return rc;
// rc = ptp_vcam_magic();
// printf("Return code: %d\n", rc);
// if (rc) return rc;
//
// rc = test_props();
// printf("Return code: %d\n", rc);
// if (rc) return rc;

return 0;
}

0 comments on commit 0a8dbfe

Please sign in to comment.