summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/microtest.h2
-rw-r--r--test/nbttest.cpp17
2 files changed, 15 insertions, 4 deletions
diff --git a/test/microtest.h b/test/microtest.h
index 8691ebb748..ec9309f8be 100644
--- a/test/microtest.h
+++ b/test/microtest.h
@@ -1,7 +1,7 @@
#ifndef MICROTEST_H
#define MICROTEST_H
-#include <type_traits>
+#include <iostream>
#define FAIL_TEST { std::cerr << "Assertion failed at " __FILE__ ":" << __LINE__ << std::endl; \
exit(EXIT_FAILURE); }
diff --git a/test/nbttest.cpp b/test/nbttest.cpp
index eead43efd0..23e6a1a80b 100644
--- a/test/nbttest.cpp
+++ b/test/nbttest.cpp
@@ -1,9 +1,20 @@
#include "microtest.h"
-#include "tag.h"
-#include <cstdlib>
+#include "libnbt.h"
#include <iostream>
+using namespace nbt;
+
+void test_get_type()
+{
+ ASSERT(tag_byte().get_type() == tag_type::Byte);
+ ASSERT(tag_short().get_type() == tag_type::Short);
+ ASSERT(tag_int().get_type() == tag_type::Int);
+ ASSERT(tag_long().get_type() == tag_type::Long);
+ ASSERT(tag_float().get_type() == tag_type::Float);
+ ASSERT(tag_double().get_type() == tag_type::Double);
+}
+
int main()
{
- return EXIT_SUCCESS;
+ test_get_type();
}