diff --git a/platform/windows/rivet-host.vcxproj b/platform/windows/rivet-host.vcxproj index ff38a76..e528cf8 100644 --- a/platform/windows/rivet-host.vcxproj +++ b/platform/windows/rivet-host.vcxproj @@ -73,6 +73,11 @@ stdcpp17 true + + /utf-8 %(AdditionalOptions) NotUsing Level4 true diff --git a/rivet/tests/doctor.rkt b/rivet/tests/doctor.rkt index 9ccdb57..ac8d96a 100644 --- a/rivet/tests/doctor.rkt +++ b/rivet/tests/doctor.rkt @@ -143,7 +143,11 @@ (lambda () (define project-root (create-project! "gate" temp-gate-root)) (define project (load-project project-root)) - (write-schema-snapshot! project "rivet-schema.json") + ;; The baseline lives at the project root (what every downstream + ;; commits); a cwd-relative path would drop it next to this test file + ;; and stay behind after the run. + (write-schema-snapshot! project + (build-path project-root "rivet-schema.json")) (generate-clients! project) ;; A stray good-shaped updater call and a workflow pin keep the green ;; path realistic: the scanner and pin check run on every report. diff --git a/rivet/tests/inspect.rkt b/rivet/tests/inspect.rkt index 3eb6228..939c508 100644 --- a/rivet/tests/inspect.rkt +++ b/rivet/tests/inspect.rkt @@ -118,8 +118,12 @@ (lambda (out) (display "// custom app entry\n" out))) (define custom-report (project-report project)) (define custom-macos (hash-ref (hash-ref custom-report 'edit-points) 'macos-ui)) + ;; Reported paths are path->string output, so separators follow the host + ;; — build the expectation instead of hardcoding forward slashes. (check-equal? (map (lambda (entry) (hash-ref entry 'path)) custom-macos) - '("macos-host/Sources/RivetHost/AgentDemoApp.swift")) + (list (path->string + (build-path "macos-host" "Sources" "RivetHost" + "AgentDemoApp.swift")))) (check-true (andmap (lambda (entry) (hash-ref entry 'exists)) custom-macos)) (delete-file (build-path root "rivet-schema.json")) diff --git a/rivet/tests/linux-native-installer.rkt b/rivet/tests/linux-native-installer.rkt index 0a5641a..ac95b77 100644 --- a/rivet/tests/linux-native-installer.rkt +++ b/rivet/tests/linux-native-installer.rkt @@ -103,8 +103,11 @@ (check-true (regexp-match? #rx"update-desktop-database" (file->string script)) "maintainer scripts must refresh the desktop database") - (check-equal? (file-or-directory-permissions script 'bits) 493 - "maintainer scripts must be executable (0o755)")) + ;; Unix permission bits do not exist on NTFS: everything reports + ;; 0o777 there, so the 0o755 assertion is only meaningful on POSIX. + (when (memq (system-type 'os) '(unix macosx)) + (check-equal? (file-or-directory-permissions script 'bits) 493 + "maintainer scripts must be executable (0o755)"))) ;; ------------------------------------------------------------- rpm (define spec-path (build-path temp-root "demo.spec")) diff --git a/rivet/tests/updater-scaffold.rkt b/rivet/tests/updater-scaffold.rkt index 888b684..f94b432 100644 --- a/rivet/tests/updater-scaffold.rkt +++ b/rivet/tests/updater-scaffold.rkt @@ -14,7 +14,11 @@ ;; --- settings adapter over a hash ------------------------------------------ (define (make-fake-settings) - (define store (make-hasheq)) + ;; equal?-based keys on purpose: the adapter contract passes string keys, + ;; and interned literals from two modules are eq?-distinct, so a hasheq + ;; store silently loses every cross-module write (the resolved bucket + ;; never came back). + (define store (make-hash)) (updater-settings-adapter (lambda (key) (hash-ref store key #f)) (lambda (key value) (hash-set! store key value)))) @@ -155,26 +159,16 @@ (let* ([settings (make-fake-settings)] [first-bucket (resolve-rollout-bucket! settings)] [stored ((updater-settings-adapter-get settings) - "update.rollout-bucket")] - [direct-set - (begin - ((updater-settings-adapter-set! settings) - "diagnostic.direct" "yes") - ((updater-settings-adapter-get settings) "diagnostic.direct"))] - [writer-binding - (updater-settings-adapter-set! settings)] - [pre-set - (begin - (writer-binding "update.rollout-bucket" "42") - ((updater-settings-adapter-get settings) "update.rollout-bucket"))] - [resolved-after-pre (resolve-rollout-bucket! settings)]) - (eprintf "diagnostic: first-bucket=~a stored=~a direct-set=~a writer-is-set-proc=~a pre-set=~a resolved-after-pre=~a\n" - first-bucket stored direct-set - (if (writer-binding "diagnostic.direct" "ignored") #t #f) - pre-set resolved-after-pre) + "update.rollout-bucket")]) (check-true (and (exact-integer? first-bucket) (<= 0 first-bucket 99))) + ;; The draw persisted under the key the next run reads back. (check-equal? stored (number->string first-bucket)) - (check-equal? (resolve-rollout-bucket! settings) first-bucket)) + ;; Sticky: a stored draw is recovered, not redrawn. + (check-equal? (resolve-rollout-bucket! settings) first-bucket) + ;; A valid value written directly through the adapter is what the next + ;; run recovers, too. + ((updater-settings-adapter-set! settings) "update.rollout-bucket" "42") + (check-equal? (resolve-rollout-bucket! settings) 42)) (let ([settings (updater-settings-adapter diff --git a/runtime/src/device_session_host.cpp b/runtime/src/device_session_host.cpp index 8eac591..a8c8e21 100644 --- a/runtime/src/device_session_host.cpp +++ b/runtime/src/device_session_host.cpp @@ -178,9 +178,9 @@ void DeviceSessionHost::run() { // The pairing window elapsed with no desktop decision; the state // machine answers with its own expiry semantics. auto expire_actions = server_->expire(now_()); - bool saw_acceptance = false; - bool saw_close = false; - execute(expire_actions, saw_acceptance, saw_close); + bool expired_acceptance = false; + bool expired_close = false; + execute(expire_actions, expired_acceptance, expired_close); timed_out = true; break; }