diff options
| author | Nicky <nicky.dasmijn@gmail.com> | 2022-06-13 20:09:42 +0200 |
|---|---|---|
| committer | Nicky <nicky.dasmijn@gmail.com> | 2022-06-13 20:09:42 +0200 |
| commit | 1b73835d6e80bc64c520a8846aebdbe1b7c9705b (patch) | |
| tree | b972275919bf6c620bbbcb81dd6b12568494561e /indra/llcommon/tests/tuple_test.cpp | |
| parent | 78e069f5e8ef1ee312e709934482b23aa86a69c2 (diff) | |
| parent | c08a61453b21664da3687661512e2ea208f90d98 (diff) | |
Merge branch 'DRTVWR-543-maint_cmake' of bitbucket.org:NickyD/viewer-cmake into DRTVWR-543-maint_cmake
Diffstat (limited to 'indra/llcommon/tests/tuple_test.cpp')
| -rw-r--r-- | indra/llcommon/tests/tuple_test.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/indra/llcommon/tests/tuple_test.cpp b/indra/llcommon/tests/tuple_test.cpp new file mode 100644 index 0000000000..af94e2086c --- /dev/null +++ b/indra/llcommon/tests/tuple_test.cpp @@ -0,0 +1,47 @@ +/** + * @file tuple_test.cpp + * @author Nat Goodspeed + * @date 2021-10-04 + * @brief Test for tuple. + * + * $LicenseInfo:firstyear=2021&license=viewerlgpl$ + * Copyright (c) 2021, Linden Research, Inc. + * $/LicenseInfo$ + */ + +// Precompiled header +#include "linden_common.h" +// associated header +#include "tuple.h" +// STL headers +// std headers +// external library headers +// other Linden headers +#include "../test/lltut.h" + +/***************************************************************************** +* TUT +*****************************************************************************/ +namespace tut +{ + struct tuple_data + { + }; + typedef test_group<tuple_data> tuple_group; + typedef tuple_group::object object; + tuple_group tuplegrp("tuple"); + + template<> template<> + void object::test<1>() + { + set_test_name("tuple"); + std::tuple<std::string, int> tup{ "abc", 17 }; + std::tuple<int, std::string, int> ptup{ tuple_cons(34, tup) }; + std::tuple<std::string, int> tup2; + int i; + std::tie(i, tup2) = tuple_split(ptup); + ensure_equals("tuple_car() fail", i, 34); + ensure_equals("tuple_cdr() (0) fail", std::get<0>(tup2), "abc"); + ensure_equals("tuple_cdr() (1) fail", std::get<1>(tup2), 17); + } +} // namespace tut |
