This commit is contained in:
2021-06-21 12:31:35 +02:00
parent bb91375533
commit 789d0df81c
4 changed files with 76 additions and 76 deletions

View File

@ -1,13 +1,12 @@
#include "catch.hpp"
#include "sls/file_utils.h"
#include <iostream>
#include <stdio.h>
#include <unistd.h>
#include <iostream>
#include <vector>
TEST_CASE("Get size of empty file") {
char fname[] = "temfile_XXXXXX";
int fh = mkstemp(fname);
std::ifstream ifs(fname);
auto size = sls::getFileSize(ifs);
REQUIRE(size == 0);
@ -23,6 +22,5 @@ TEST_CASE("Get size of file with data") {
std::ifstream ifs(fname);
auto size = sls::getFileSize(ifs);
REQUIRE(size == n_bytes);
REQUIRE(ifs.tellg() == 0); //getting size resets pos!
REQUIRE(ifs.tellg() == 0); // getting size resets pos!
}