about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/store-api.cc
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2020-11-28T00·24-0500
committerglittershark <grfn@gws.fyi>2020-11-28T00·47+0000
commit6f38ac6657cabcee067a6299551d280680be16ff (patch)
tree6da8f6990253bf59b1bee706b71a3bb3a008e191 /third_party/nix/src/libstore/store-api.cc
parent49024be05644d4fac252e2191e9de74e0ffd4fe3 (diff)
fix(tvix): Add missing break;s to BuildResult::FromProto r/1947
Add missing break statements to the big switch block in
BuildResult::FromProto, and cover the whole thing with a rapidcheck
round-trip test.

Change-Id: I7a07ca398cc5f02ca4fd8e6256fd563c6f3aea9d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2178
Tested-by: BuildkiteCI
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Diffstat (limited to 'third_party/nix/src/libstore/store-api.cc')
-rw-r--r--third_party/nix/src/libstore/store-api.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/third_party/nix/src/libstore/store-api.cc b/third_party/nix/src/libstore/store-api.cc
index d7ca54fa9a77..d8dbea18e953 100644
--- a/third_party/nix/src/libstore/store-api.cc
+++ b/third_party/nix/src/libstore/store-api.cc
@@ -97,30 +97,43 @@ std::optional<BuildResult> BuildResult::FromProto(
   switch (resp.status()) {
     case proto::BuildStatus::Built:
       result.status = BuildResult::Status::Built;
+      break;
     case proto::BuildStatus::Substituted:
       result.status = BuildResult::Status::Substituted;
+      break;
     case proto::BuildStatus::AlreadyValid:
       result.status = BuildResult::Status::AlreadyValid;
+      break;
     case proto::BuildStatus::PermanentFailure:
       result.status = BuildResult::Status::PermanentFailure;
+      break;
     case proto::BuildStatus::InputRejected:
       result.status = BuildResult::Status::InputRejected;
+      break;
     case proto::BuildStatus::OutputRejected:
       result.status = BuildResult::Status::OutputRejected;
+      break;
     case proto::BuildStatus::TransientFailure:
       result.status = BuildResult::Status::TransientFailure;
+      break;
     case proto::BuildStatus::CachedFailure:
       result.status = BuildResult::Status::CachedFailure;
+      break;
     case proto::BuildStatus::TimedOut:
       result.status = BuildResult::Status::TimedOut;
+      break;
     case proto::BuildStatus::MiscFailure:
       result.status = BuildResult::Status::MiscFailure;
+      break;
     case proto::BuildStatus::DependencyFailed:
       result.status = BuildResult::Status::DependencyFailed;
+      break;
     case proto::BuildStatus::LogLimitExceeded:
       result.status = BuildResult::Status::LogLimitExceeded;
+      break;
     case proto::BuildStatus::NotDeterministic:
       result.status = BuildResult::Status::NotDeterministic;
+      break;
     default:
       return {};
   }