40 static FatFS *testable;
42 void error_checker (
const ErrorCode err) {
48 pwOut.
printf(
"No print string yet for FatFS's error #%d (raw = %d)\n", err - FatFS::BEG_ERROR, err);
58 delete testable->m_driver;
68 TEST(ReadMasterBootRecord) {
73 err = testable->m_driver->start();
75 ASSERT_EQ_MSG(FatFS::NO_ERROR, err);
77 testable->m_buf.buf = (uint8_t *) malloc(testable->m_driver->get_sector_size());
79 err = testable->read_boot_sector(0);
81 ASSERT_EQ_MSG(FatFS::NO_ERROR, err);
84 ASSERT_NEQ_MSG(0, testable->m_initFatInfo.bootSector);
89 TEST(Mount_defaultParameters) {
94 err = testable->
mount();
96 ASSERT_EQ_MSG(FatFS::NO_ERROR, err);
98 ASSERT_EQ_MSG(FatFS::FAT_32, testable->m_filesystem);
103 TEST(Mount_withParameter0) {
108 err = testable->
mount(0);
110 ASSERT_EQ_MSG(FatFS::NO_ERROR, err);
115 TEST(Mount_withParameter4) {
120 err = testable->
mount(4);
135 RUN_TEST(Constructor);
136 RUN_TEST(ReadMasterBootRecord);
137 RUN_TEST(Mount_defaultParameters);
138 RUN_TEST(Mount_withParameter0);
139 RUN_TEST(Mount_withParameter4);
Generic definitions and functions for the Parallax Propeller.
void print_error_str(const Printer *printer, const ErrorCode err) const
Print through UART an error string followed by entering an infinite loop.
const PropWare::Printer pwOut
Most common use of printing in PropWare applications (not thread safe; see PropWare::pwSyncOut for mu...
void printf(const char fmt[], const T first, const Targs...remaining) const
Similar in functionality to the C-standard function printf.
PropWare::ErrorCode mount(const uint8_t partition=0)
A simple SD driver communicating over the SPI protocol.
static SPI * get_instance()
Best way to use SPI is through here, where you can get a shared instance of the SPI module (not threa...