This commit is contained in:
David Given
2024-05-14 21:41:30 +02:00

View File

@@ -37,11 +37,39 @@ namespace
};
}
static std::ostream& operator<<(std::ostream& stream, const Bytes& bytes)
namespace snowhouse
{
template <>
struct Stringizer<std::vector<bool>>
{
static std::string ToString(const std::vector<bool>& vector)
{
std::stringstream stream;
stream << '{';
bool first = true;
for (const auto& item : vector)
{
if (!first)
stream << ", ";
stream << item;
first = false;
}
stream << '}';
return stream.str();
}
};
template <>
struct Stringizer<Bytes>
{
static std::string ToString(const Bytes& bytes)
{
std::stringstream stream;
stream << '\n';
hexdump(stream, bytes);
return stream;
return stream.str();
}
};
}
static Bytes createDirent(const std::string& filename,
@@ -154,6 +182,7 @@ static void testBitmap()
Equals(std::vector<bool>{
1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}));
}
#if 0
static void testPutGet()
{
@@ -271,6 +300,7 @@ static void testPutMetadata()
createDirent("FILE2", 0, 1, {19})));
}
#endif
int main(void)
{
try
@@ -306,12 +336,14 @@ int main(void)
testPartialExtent();
testLogicalExtents();
#if 0
testBitmap();
testPutGet();
testPutBigFile();
testDelete();
testMove();
testPutMetadata();
#endif
}
catch (const ErrorException& e)
{