Lines Matching +full:- +full:f
1 // Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD
7 // http://www.apache.org/licenses/LICENSE-2.0
45 TEST_ASSERT(part->size == (fatfs_end - fatfs_start - 1)); in test_setup()
49 …TEST_ESP_OK(esp_partition_mmap(part, 0, part->size, SPI_FLASH_MMAP_DATA, &mmap_ptr, &mmap_handle)); in test_setup()
50 bool content_valid = memcmp(fatfs_start, mmap_ptr, part->size) == 0; in test_setup()
55 esp_partition_erase_range(part, 0, part->size); in test_setup()
56 for (int i = 0; i < part->size; i+= SPI_FLASH_SEC_SIZE) { in test_setup()
72 FILE* f = fopen("/spiflash/hello.txt", "r"); variable
73 TEST_ASSERT_NOT_NULL(f);
75 int cb = fread(buf, 1, sizeof(buf), f);
78 TEST_ASSERT_EQUAL(0, fclose(f));
84 size_t max_files = FOPEN_MAX - 3; /* account for stdin, stdout, stderr */
90 snprintf(name, sizeof(name), "/spiflash/f/%d.txt", i + 1);
107 FILE* f = fopen("/spiflash/hello.txt", "r"); variable
108 TEST_ASSERT_NOT_NULL(f);
109 TEST_ASSERT_EQUAL(0, fseek(f, 2, SEEK_CUR));
110 TEST_ASSERT_EQUAL('l', fgetc(f));
111 TEST_ASSERT_EQUAL(0, fseek(f, 4, SEEK_SET));
112 TEST_ASSERT_EQUAL('o', fgetc(f));
113 TEST_ASSERT_EQUAL(0, fseek(f, -5, SEEK_END));
114 TEST_ASSERT_EQUAL('r', fgetc(f));
115 TEST_ASSERT_EQUAL(0, fseek(f, 3, SEEK_END));
116 TEST_ASSERT_EQUAL(17, ftell(f));
118 TEST_ASSERT_EQUAL(0, fseek(f, 0, SEEK_END));
119 TEST_ASSERT_EQUAL(14, ftell(f));
120 TEST_ASSERT_EQUAL(0, fseek(f, 0, SEEK_SET));
128 tm.tm_year = 2018 - 1900;
129 tm.tm_mon = 5; // Note: month can be 0-11 & not 1-12
170 if (strcasecmp(de->d_name, "test_opd.txt") == 0) {
193 printf("found '%s'\n", de->d_name);
194 if (strcasecmp(de->d_name, "1.txt") == 0) {
195 TEST_ASSERT_TRUE(de->d_type == DT_REG);
198 } else if (strcasecmp(de->d_name, "2.txt") == 0) {
199 TEST_ASSERT_TRUE(de->d_type == DT_REG);
202 } else if (strcasecmp(de->d_name, "inner") == 0) {
203 TEST_ASSERT_TRUE(de->d_type == DT_DIR);
206 } else if (strcasecmp(de->d_name, "boo.bin") == 0) {
207 TEST_ASSERT_TRUE(de->d_type == DT_REG);
219 TEST_ASSERT_EQUAL(0, strcasecmp(de->d_name, names[0]));
223 TEST_ASSERT_EQUAL(0, strcasecmp(de->d_name, names[3]));
227 TEST_ASSERT_EQUAL(0, strcasecmp(de->d_name, names[1]));
231 TEST_ASSERT_EQUAL(0, strcasecmp(de->d_name, names[2]));
260 FILE* f = fopen(args->filename, "rb"); in read_task() local
261 if (f == NULL) { in read_task()
262 args->result = ESP_ERR_NOT_FOUND; in read_task()
266 srand(args->seed); in read_task()
267 for (size_t i = 0; i < args->word_count; ++i) { in read_task()
269 int cnt = fread(&rval, sizeof(rval), 1, f); in read_task()
270 if (cnt != 1 || rval != args->val) { in read_task()
271 esp_rom_printf("E(r): i=%d, cnt=%d rval=%d val=%d\n\n", i, cnt, rval, args->val); in read_task()
272 args->result = ESP_FAIL; in read_task()
276 args->result = ESP_OK; in read_task()
279 fclose(f); in read_task()
282 xSemaphoreGive(args->done); in read_task()
302 const int cpuid_1 = portNUM_PROCESSORS - 1;