From 76113d7c6187548a523cf76737cc83a5ac105197 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 9 Dec 2015 23:02:54 +0000 Subject: Fix mismatched start and end test macros on Windows --- test/backupstore/testbackupstore.cpp | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'test') diff --git a/test/backupstore/testbackupstore.cpp b/test/backupstore/testbackupstore.cpp index c7320bbf..c7cfee6f 100644 --- a/test/backupstore/testbackupstore.cpp +++ b/test/backupstore/testbackupstore.cpp @@ -2431,29 +2431,23 @@ bool test_encoding() bool test_symlinks() { -#ifndef WIN32 // no symlinks on Win32 SETUP_TEST_BACKUPSTORE(); - // TODO FIXME indentation - - // Try out doing this on a symlink - { - UNLINK_IF_EXISTS("testfiles/testsymlink"); - TEST_THAT(::symlink("does/not/exist", "testfiles/testsymlink") == 0); - BackupStoreFilenameClear name("testsymlink"); - std::auto_ptr encoded(BackupStoreFile::EncodeFile("testfiles/testsymlink", 32, name)); - - // Can't decode it from the stream, because it's in file order, and doesn't have the - // required properties to be able to reorder it. So buffer it... - CollectInBufferStream b; - encoded->CopyStreamTo(b); - b.SetForReading(); - - // Decode it - UNLINK_IF_EXISTS("testfiles/testsymlink_2"); - BackupStoreFile::DecodeFile(b, "testfiles/testsymlink_2", IOStream::TimeOutInfinite); - } - teardown_test_backupstore(); +#ifndef WIN32 // no symlinks on Win32 + UNLINK_IF_EXISTS("testfiles/testsymlink"); + TEST_THAT(::symlink("does/not/exist", "testfiles/testsymlink") == 0); + BackupStoreFilenameClear name("testsymlink"); + std::auto_ptr encoded(BackupStoreFile::EncodeFile("testfiles/testsymlink", 32, name)); + + // Can't decode it from the stream, because it's in file order, and doesn't have the + // required properties to be able to reorder it. So buffer it... + CollectInBufferStream b; + encoded->CopyStreamTo(b); + b.SetForReading(); + + // Decode it + UNLINK_IF_EXISTS("testfiles/testsymlink_2"); + BackupStoreFile::DecodeFile(b, "testfiles/testsymlink_2", IOStream::TimeOutInfinite); #endif TEARDOWN_TEST_BACKUPSTORE(); -- cgit v1.2.3