summaryrefslogtreecommitdiff
path: root/test/resource_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/resource_test.cc')
-rw-r--r--test/resource_test.cc23
1 files changed, 20 insertions, 3 deletions
diff --git a/test/resource_test.cc b/test/resource_test.cc
index 2e88c45..28a244e 100644
--- a/test/resource_test.cc
+++ b/test/resource_test.cc
@@ -30,10 +30,12 @@
#include "drumkit_creator.h"
-class ResourceTester : public GUI::Resource {
+class ResourceTester
+ : public GUI::Resource
+{
public:
ResourceTester(const std::string& name)
- : Resource(name)
+ : GUI::Resource(name)
{}
bool probeIsInternal()
@@ -42,13 +44,15 @@ public:
}
};
-class ResourceTest : public DGUnit
+class ResourceTest
+ : public DGUnit
{
public:
ResourceTest()
{
DGUNIT_TEST(ResourceTest::externalReadTest);
DGUNIT_TEST(ResourceTest::internalReadTest);
+ DGUNIT_TEST(ResourceTest::failTest);
}
DrumkitCreator drumkit_creator;
@@ -70,6 +74,19 @@ public:
DGUNIT_ASSERT(rc.valid());
DGUNIT_ASSERT_EQUAL((size_t)1123, rc.size());
}
+
+ void failTest()
+ {
+ {
+ ResourceTester rc("/tmp/");
+ DGUNIT_ASSERT(!rc.valid());
+ }
+
+ {
+ ResourceTester rc("no_such_file");
+ DGUNIT_ASSERT(!rc.valid());
+ }
+ }
};
// Registers the fixture into the 'registry'