Files
breeze/tests/sync_status_policy_behavior.zi
T
waozi b5356aaac7 Port Inbe screens, storage, and platform hosts to Ziran
Replace the remaining .kry and C application sources with Ziran modules,
move vendored dependencies to their current pointers, and add Ziran tests for
the ported hosts and policies.
2026-09-27 15:40:52 -03:00

42 lines
1.5 KiB
Ziran

#import, file "../src/app/sync_status_policy.zi";
#import, file "../src/storage/sync_status.zi";
#program_export
Answer :: () -> s32 {
status: SyncStatus
status.review_pending = 1
status.queued_changes = 2
if SyncStatusKeyFor(false, true, 7, true, status) != "sync_connection_required" {
return 1
}
if SyncStatusKeyFor(true, true, 7, true, status) != "sync_in_progress" {
return 2
}
if SyncStatusKeyFor(true, false, 7, true, status) != "sync_auth_failed" ||
SyncStatusKeyFor(true, false, 2, true, status) != "sync_no_account" ||
SyncStatusKeyFor(true, false, 1, true, status) != "sync_server_url_invalid" ||
SyncStatusKeyFor(true, false, 5, true, status) != "sync_sign_failed" ||
SyncStatusKeyFor(true, false, 3, true, status) != "sync_failed" ||
SyncStatusKeyFor(true, false, 6, true, status) != "sync_retry_waiting" {
return 3
}
if SyncStatusKeyFor(true, false, 0, false, status) != "sync_status_ready" ||
SyncStatusKeyFor(true, false, 0, true, status) != "sync_status_review_pending" {
return 4
}
status.review_pending = 0
if SyncStatusKeyFor(true, false, 0, true, status) != "sync_status_local_queued" {
return 5
}
status.queued_changes = 0
status.full_upload_done = 0
if SyncStatusKeyFor(true, false, 0, true, status) != "sync_status_local_queued" {
return 6
}
status.full_upload_done = 1
if SyncStatusKeyFor(true, false, 0, true, status) != "sync_status_ready" {
return 7
}
return 42
}