Commit 4c444006 authored by alex@thinkpad's avatar alex@thinkpad
Browse files

selftest: fixed crash on 1100D

Reported by greg_kennedy: https://www.magiclantern.fm/forum/index.php?topic=1009.msg233247#msg233247
Bug in testing code, triggered by camera running out of memory.

--HG--
branch : lua_fix
parent 5a6e3c2a3a45
......@@ -599,12 +599,14 @@ static void stub_test_file_io()
uint32_t size;
TEST_FUNC_CHECK(FIO_GetFileSize("test.dat", &size), == 0);
TEST_FUNC_CHECK(size, == 0x20000);
void* p;
TEST_FUNC_CHECK(p = (void*)_alloc_dma_memory(0x20000), != 0);
TEST_FUNC_CHECK(f = FIO_OpenFile("test.dat", O_RDONLY | O_SYNC), != 0);
TEST_FUNC_CHECK(FIO_ReadFile(f, p, 0x20000), == 0x20000);
void * p = NULL;
TEST_FUNC_CHECK(p = (void*)fio_malloc(0x20000), != 0);
if (p) {
TEST_FUNC_CHECK(f = FIO_OpenFile("test.dat", O_RDONLY | O_SYNC), != 0);
TEST_FUNC_CHECK(FIO_ReadFile(f, p, 0x20000), == 0x20000);
}
TEST_VOID(FIO_CloseFile(f));
TEST_VOID(_free_dma_memory(p));
TEST_VOID(fio_free(p));
{
int count = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment