Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions platform/windows/rivet-host.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@
<ClCompile>
<LanguageStandard>stdcpp17</LanguageStandard>
<ConformanceMode>true</ConformanceMode>
<!-- Sources and headers are UTF-8; without this MSVC reads them in
the system code page and CJK-locale machines drown in C4819
(and misread any non-ASCII literal). Downstream hosts already
build with /utf-8 — the linked static library must match. -->
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
Expand Down
6 changes: 5 additions & 1 deletion rivet/tests/doctor.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 5 additions & 1 deletion rivet/tests/inspect.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
7 changes: 5 additions & 2 deletions rivet/tests/linux-native-installer.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
32 changes: 13 additions & 19 deletions rivet/tests/updater-scaffold.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions runtime/src/device_session_host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading