Created
June 11, 2015 21:24
-
-
Save wxgeorge/d8517e45286e4823e4a0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "fixtures/PersistingTestFixture.h" | |
class FirmwareDownloadtests : public PersistingTestFixture {}; | |
TEST_F(FirmwareDownloadTests, TestBasicHappyPath) { | |
// no cached image | |
// image is an upgrade | |
NclFirmwareVersion current_version = {0x01, 0x04, 0x00}; | |
std::shared_ptr<CheckFirmwareUpgradeOperation> op = | |
std::make_shared<CheckFirmwareUpgradeOperation>( | |
current_version, | |
"http://pm.corp.bionym.com/releases/FW/1.5.0/nymi_fw_01050009.bin", | |
this->safe_directory() | |
); | |
op->execute_in_foreground(); | |
EXPECT_TRUE(op->succeeded()); | |
// load image | |
ASSERT_TRUE(file_exists(this->safe_directory() + 'nymi-fw-upgrade.bin')); | |
FirmwareImage image; | |
// load image | |
EXPECT_TRUE(op->is_upgrade()); | |
EXPECT_EQ(IMAGE_DONWLOADED_IS_AN_UPGRADE, op->result()); | |
EXPECT_TRUE(NFIL_ImageIsAnUpgrade(image.get_fw_version(), current_version)); | |
} | |
TEST_F(FirmwareDownloadtests, TestWithDownloadFailure) { | |
// | |
} | |
TEST_F(FirmwareDownloadtests, FileChangedButVersionSame) { | |
// | |
} | |
TEST_F(FirmwareDownloadtests, CorruptedFile) { | |
// | |
} | |
TEST_F(FirmwareDownloadtests, ImageIsARegression) { | |
// | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment