40 #include <gtest/gtest.h> 51 TEST(AtomicioTest, AtomicReadBigBuffer)
56 std::string file_contents =
"This is just some test data to ensure that we" 57 " can read correctly from a file.";
59 fputs(file_contents.c_str(), file);
69 for (
unsigned int i = 0;
i < size;
i++) {
78 TEST(AtomicioTest, AtomicReadSmallBuffer)
83 std::string file_contents =
"This is just some test data to ensure that we" 84 " can read correctly from a file.";
86 fputs(file_contents.c_str(), file);
96 for (
unsigned int i = 0;
i < size;
i++) {
104 TEST(AtomicioTest, AtomicWrite)
109 std::string file_contents =
"This is just some test data to ensure that we" 110 " can write correctly to a file.";
113 file_contents.c_str(),
114 file_contents.size());
121 for (
unsigned int i = 0; (c = fgetc(file)) != EOF;
i++) {
ssize_t atomic_read(int fd, void *s, size_t n)
TEST(AtomicioTest, AtomicReadBigBuffer)
ssize_t atomic_write(int fd, const void *s, size_t n)
#define EXPECT_EQ(lhs, rhs)
A macro which verifies that lhs and rhs are equal to each other.