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.
60 lines
1.7 KiB
Ziran
60 lines
1.7 KiB
Ziran
#import, file "../src/app/app_types.zi";
|
|
#import, file "../src/app/exercise_types.zi";
|
|
#import, file "../src/core/types.zi";
|
|
#import, file "../src/practices/session_results.zi";
|
|
|
|
using ExerciseType;
|
|
|
|
#program_export
|
|
Answer :: () -> s32 {
|
|
if app_text_from_cstring(null, 0) != "" {
|
|
return 99
|
|
}
|
|
app: InnerBreeze
|
|
fail_path: [5]u8 = .{102, 97, 105, 108, 0}
|
|
save_path: [5]u8 = .{115, 97, 118, 101, 0}
|
|
|
|
app.breathing.screen = ScreenResults
|
|
app_prepare_session_results(*app, EXERCISE_PATTERNS, 90, 2,
|
|
null, null, 0, *fail_path[0])
|
|
session_result_discard(*app)
|
|
if app.session_result.active != 1 ||
|
|
app.session_result.write_failed != 1 ||
|
|
app.breathing.screen != ScreenResults ||
|
|
app.ui.sync_requested {
|
|
return 1
|
|
}
|
|
|
|
app_prepare_session_results(*app, EXERCISE_PATTERNS, 90, 2,
|
|
null, null, 0, *save_path[0])
|
|
session_result_discard(*app)
|
|
if app.session_result.active != 0 ||
|
|
app.breathing.screen != ScreenStart ||
|
|
!app.ui.sync_requested {
|
|
return 2
|
|
}
|
|
|
|
app.ui.sync_requested = false
|
|
app.breathing.screen = ScreenResults
|
|
app_prepare_session_results(*app, EXERCISE_PATTERNS, 90, 2,
|
|
null, null, 0, *save_path[0])
|
|
app.session_result.mood = 9
|
|
session_result_done(*app)
|
|
if app.session_result.active != 1 ||
|
|
app.session_result.write_failed != 1 ||
|
|
app.breathing.screen != ScreenResults ||
|
|
app.ui.sync_requested {
|
|
return 3
|
|
}
|
|
|
|
app.session_result.mood = 4
|
|
session_result_done(*app)
|
|
if app.session_result.active != 0 ||
|
|
app.breathing.screen != ScreenStart ||
|
|
!app.ui.sync_requested {
|
|
return 4
|
|
}
|
|
return 42
|
|
}
|
|
#import, file "../src/app/host_services.zi";
|