Refactor RomTest to include LoadFromFile tests
This commit is contained in:
@@ -3,8 +3,12 @@
|
|||||||
#include <gmock/gmock.h>
|
#include <gmock/gmock.h>
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
namespace yaze_test {
|
#include "absl/status/status.h"
|
||||||
|
#include "absl/status/statusor.h"
|
||||||
|
#include "test/core/testing.h"
|
||||||
|
|
||||||
|
namespace yaze {
|
||||||
|
namespace test {
|
||||||
using yaze::app::Rom;
|
using yaze::app::Rom;
|
||||||
|
|
||||||
class RomTest : public ::testing::Test {
|
class RomTest : public ::testing::Test {
|
||||||
@@ -17,4 +21,18 @@ TEST_F(RomTest, RomTest) {
|
|||||||
EXPECT_EQ(rom_.data(), nullptr);
|
EXPECT_EQ(rom_.data(), nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace yaze_test
|
TEST_F(RomTest, LoadFromFile) {
|
||||||
|
EXPECT_OK(rom_.LoadFromFile("test.sfc"));
|
||||||
|
EXPECT_EQ(rom_.size(), 0x200000);
|
||||||
|
EXPECT_NE(rom_.data(), nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(RomTest, LoadFromFileInvalid) {
|
||||||
|
EXPECT_THAT(rom_.LoadFromFile("invalid.sfc"),
|
||||||
|
StatusIs(absl::StatusCode::kNotFound));
|
||||||
|
EXPECT_EQ(rom_.size(), 0);
|
||||||
|
EXPECT_EQ(rom_.data(), nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace test
|
||||||
|
} // namespace yaze
|
||||||
Reference in New Issue
Block a user