summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorljfa-ag <ljfa-ag@web.de>2015-06-21 12:16:40 +0200
committerljfa-ag <ljfa-ag@web.de>2015-06-21 12:16:40 +0200
commit47fefee88e83425b9098293fa07877f7d41c18d6 (patch)
tree03fd54e5132c0c2905bb8fbe558b0526d0f90f0c /test
parent1a85198341c0f54493039c62b67e864d086c56af (diff)
downloadProject-Tick-47fefee88e83425b9098293fa07877f7d41c18d6.tar.gz
Project-Tick-47fefee88e83425b9098293fa07877f7d41c18d6.zip
Add tests for get_type
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();
}