Skip to content

Commit

Permalink
[tests] Check state from JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
ricab committed Nov 22, 2023
1 parent 1dd7c00 commit 60536b1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_base_snapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,4 +340,13 @@ TEST_F(TestBaseSnapshot, adoptsDiskSpaceFromJson)
EXPECT_EQ(snapshot.get_disk_space().in_bytes(), QString{disk}.toInt());
}

TEST_F(TestBaseSnapshot, adoptsStateFromJson)
{
constexpr auto state = mp::VirtualMachine::State::stopped;
auto json = test_snapshot_json();
mod_snapshot_json(json, "state", static_cast<int>(state));

auto snapshot = MockBaseSnapshot{plant_snapshot_json(json), vm};
EXPECT_EQ(snapshot.get_state(), state);
}
} // namespace

0 comments on commit 60536b1

Please sign in to comment.