diff options
Diffstat (limited to 'test/test-glAllocator.cpp')
| -rw-r--r-- | test/test-glAllocator.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/test-glAllocator.cpp b/test/test-glAllocator.cpp new file mode 100644 index 0000000..baf658c --- /dev/null +++ b/test/test-glAllocator.cpp @@ -0,0 +1,29 @@ +#define BOOST_TEST_MODULE glAllocator + +#include "testMainWindow.h" +#include <boost/test/data/test_case.hpp> +#include <boost/test/unit_test.hpp> + +#include "glAllocator.h" +#include <ranges> + +BOOST_GLOBAL_FIXTURE(TestMainWindowAppBase); + +namespace { + BOOST_AUTO_TEST_CASE(Simple) + { + GLuint name = 0; + { + glVector<long double> list; + BOOST_REQUIRE_EQUAL(list.begin().base().bufferName(), 0); + list.reserve(5); + name = list.begin().base().bufferName(); + BOOST_REQUIRE_GT(name, 0); + std::ranges::copy(std::views::iota(0, 10), std::back_inserter(list)); + BOOST_REQUIRE_EQUAL(10, list.size()); + BOOST_CHECK_EQUAL(0, list.front()); + BOOST_CHECK_EQUAL(9, list.back()); + } + BOOST_CHECK(!glIsBuffer(name)); + } +} |
