Lines Matching +full:- +full:f

1 // Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
7 // http://www.apache.org/licenses/LICENSE-2.0
39 FILE* f = fopen(name, "wb"); in test_spiffs_create_file_with_text() local
40 TEST_ASSERT_NOT_NULL(f); in test_spiffs_create_file_with_text()
41 TEST_ASSERT_TRUE(fputs(text, f) != EOF); in test_spiffs_create_file_with_text()
42 TEST_ASSERT_EQUAL(0, fclose(f)); in test_spiffs_create_file_with_text()
82 FILE* f = fopen(filename, "r"); in test_spiffs_read_file() local
83 TEST_ASSERT_NOT_NULL(f); in test_spiffs_read_file()
85 int cb = fread(buf, 1, sizeof(buf), f); in test_spiffs_read_file()
88 TEST_ASSERT_EQUAL(0, fclose(f)); in test_spiffs_read_file()
109 FILE* f = fopen(filename, "wb+"); in test_spiffs_lseek() local
110 TEST_ASSERT_NOT_NULL(f); in test_spiffs_lseek()
111 TEST_ASSERT_EQUAL(11, fprintf(f, "0123456789\n")); in test_spiffs_lseek()
112 TEST_ASSERT_EQUAL(0, fseek(f, -2, SEEK_CUR)); in test_spiffs_lseek()
113 TEST_ASSERT_EQUAL('9', fgetc(f)); in test_spiffs_lseek()
114 TEST_ASSERT_EQUAL(0, fseek(f, 3, SEEK_SET)); in test_spiffs_lseek()
115 TEST_ASSERT_EQUAL('3', fgetc(f)); in test_spiffs_lseek()
116 TEST_ASSERT_EQUAL(0, fseek(f, -3, SEEK_END)); in test_spiffs_lseek()
117 TEST_ASSERT_EQUAL('8', fgetc(f)); in test_spiffs_lseek()
118 TEST_ASSERT_EQUAL(0, fseek(f, 0, SEEK_END)); in test_spiffs_lseek()
119 TEST_ASSERT_EQUAL(11, ftell(f)); in test_spiffs_lseek()
120 TEST_ASSERT_EQUAL(4, fprintf(f, "abc\n")); in test_spiffs_lseek()
121 TEST_ASSERT_EQUAL(0, fseek(f, 0, SEEK_END)); in test_spiffs_lseek()
122 TEST_ASSERT_EQUAL(15, ftell(f)); in test_spiffs_lseek()
123 TEST_ASSERT_EQUAL(0, fseek(f, 0, SEEK_SET)); in test_spiffs_lseek()
125 TEST_ASSERT_EQUAL(15, fread(buf, 1, sizeof(buf), f)); in test_spiffs_lseek()
127 TEST_ASSERT_EQUAL_INT8_ARRAY(ref_buf, buf, sizeof(ref_buf) - 1); in test_spiffs_lseek()
129 TEST_ASSERT_EQUAL(0, fclose(f)); in test_spiffs_lseek()
160 FILE* f = fopen(name_src, "w+"); in test_spiffs_rename() local
161 TEST_ASSERT_NOT_NULL(f); in test_spiffs_rename()
164 TEST_ASSERT_NOT_EQUAL(EOF, fputs(str, f)); in test_spiffs_rename()
166 TEST_ASSERT_EQUAL(0, fclose(f)); in test_spiffs_rename()
191 if (strcasecmp(de->d_name, file_name) == 0) { in test_spiffs_can_opendir()
236 printf("found '%s'\n", de->d_name); in test_spiffs_opendir_readdir_rewinddir()
237 if (strcasecmp(de->d_name, "1.txt") == 0) { in test_spiffs_opendir_readdir_rewinddir()
238 TEST_ASSERT_TRUE(de->d_type == DT_REG); in test_spiffs_opendir_readdir_rewinddir()
241 } else if (strcasecmp(de->d_name, "2.txt") == 0) { in test_spiffs_opendir_readdir_rewinddir()
242 TEST_ASSERT_TRUE(de->d_type == DT_REG); in test_spiffs_opendir_readdir_rewinddir()
245 } else if (strcasecmp(de->d_name, "inner/3.txt") == 0) { in test_spiffs_opendir_readdir_rewinddir()
246 TEST_ASSERT_TRUE(de->d_type == DT_REG); in test_spiffs_opendir_readdir_rewinddir()
249 } else if (strcasecmp(de->d_name, "boo.bin") == 0) { in test_spiffs_opendir_readdir_rewinddir()
250 TEST_ASSERT_TRUE(de->d_type == DT_REG); in test_spiffs_opendir_readdir_rewinddir()
262 TEST_ASSERT_EQUAL(0, strcasecmp(de->d_name, names[0])); in test_spiffs_opendir_readdir_rewinddir()
266 TEST_ASSERT_EQUAL(0, strcasecmp(de->d_name, names[3])); in test_spiffs_opendir_readdir_rewinddir()
270 TEST_ASSERT_EQUAL(0, strcasecmp(de->d_name, names[1])); in test_spiffs_opendir_readdir_rewinddir()
274 TEST_ASSERT_EQUAL(0, strcasecmp(de->d_name, names[2])); in test_spiffs_opendir_readdir_rewinddir()
295 int len = snprintf(file_name, sizeof(file_name), "%s/%s", dir_prefix, de->d_name); in test_spiffs_readdir_many_files()
304 for (int f = 0; f < n_files; ++f) { in test_spiffs_readdir_many_files() local
305 snprintf(file_name, sizeof(file_name), "%s/%d/%d.txt", dir_prefix, d, f); in test_spiffs_readdir_many_files()
322 TEST_ASSERT_EQUAL(1, sscanf(de->d_name, "%d.txt", &file_id)); in test_spiffs_readdir_many_files()
331 for (int f = 0; f < n_files; ++f) { in test_spiffs_readdir_many_files() local
332 TEST_ASSERT_EQUAL(1, file_count[f + d * n_files]); in test_spiffs_readdir_many_files()
359 FILE* f = fopen(args->filename, args->write ? "wb" : "rb"); in read_write_task() local
360 if (f == NULL) { in read_write_task()
361 args->result = ESP_ERR_NOT_FOUND; in read_write_task()
365 srand(args->seed); in read_write_task()
366 for (size_t i = 0; i < args->word_count; ++i) { in read_write_task()
368 if (args->write) { in read_write_task()
369 int cnt = fwrite(&val, sizeof(val), 1, f); in read_write_task()
372 args->result = ESP_FAIL; in read_write_task()
377 int cnt = fread(&rval, sizeof(rval), 1, f); in read_write_task()
380 args->result = ESP_FAIL; in read_write_task()
385 args->result = ESP_OK; in read_write_task()
388 fclose(f); in read_write_task()
391 xSemaphoreGive(args->done); in read_write_task()
409 const int cpuid_1 = portNUM_PROCESSORS - 1; in test_spiffs_concurrent()
473 TEST_ESP_OK(esp_partition_erase_range(part, 0, part->size));
490 esp_spiffs_format(part->label);
491 FILE* f = fopen(filename, "r"); variable
492 TEST_ASSERT_NULL(f);
506 esp_spiffs_format(part->label);
515 FILE* f = fopen(filename, "r"); variable
516 TEST_ASSERT_NULL(f);
537 size_t max_files = FOPEN_MAX - 3; /* account for stdin, stdout, stderr */
545 test_spiffs_open_max_files("/spiffs/f", max_files);
609 test_spiffs_concurrent("/spiffs/f");
632 FILE *f = fopen(filename, "a"); variable
634 TEST_ASSERT_EQUAL(0, fstat(fileno(f), &st));
638 fclose(f);
643 f = fopen(filename, "r");
644 TEST_ASSERT_EQUAL(0, fstat(fileno(f), &st));
649 fclose(f);
668 …// Setting up a false actual time - used when the file is created and for modification with the cu…
669 desired_tm.tm_mon = 10 - 1;
671 desired_tm.tm_year = 2018 - 1900;
684 desired_tm.tm_mon = 1 - 1;
697 desired_tm.tm_mon = 12 - 1;
699 desired_tm.tm_year = 2145 - 1900;
714 TEST_ASSERT(false_now - achieved_stat.st_mtime <= 2); // two seconds of tolerance are given