#include "model_material.hpp"
#include <gtest/gtest.h>
#include <stdexcept>
Go to the source code of this file.
|
| | TEST (TextureTypeEnum, VisitsEntireInclusiveRangeExactlyOnceAndTerminates) |
| |
| | TEST (TextureTypeEnum, PrefixAndPostfixHaveIteratorSemantics) |
| |
| | TEST (TextureTypeEnum, EndDereferenceThrowsAndIncrementStaysAtEnd) |
| |
◆ TEST() [1/3]
| TEST |
( |
TextureTypeEnum |
, |
|
|
EndDereferenceThrowsAndIncrementStaysAtEnd |
|
|
) |
| |
Definition at line 43 of file model_material_tests.cpp.
44{
46 auto end = range.
end();
47 EXPECT_THROW(*end, std::runtime_error);
48 ++end;
49 EXPECT_EQ(end, range.
end());
50 EXPECT_EQ(end++, range.
end());
51 EXPECT_EQ(end, range.
end());
52 EXPECT_THROW(*end, std::runtime_error);
53}
◆ TEST() [2/3]
| TEST |
( |
TextureTypeEnum |
, |
|
|
PrefixAndPostfixHaveIteratorSemantics |
|
|
) |
| |
Definition at line 28 of file model_material_tests.cpp.
29{
31 auto iterator = range.
begin();
32 auto copy = iterator;
33 EXPECT_EQ(copy, iterator);
34 EXPECT_EQ(&(++iterator), &iterator);
35 EXPECT_NE(copy, iterator);
36 EXPECT_EQ(*iterator,
static_cast<TextureType>(
static_cast<int>(TextureType::Begin) + 1));
37 auto previous = iterator++;
38 EXPECT_EQ(*previous,
static_cast<TextureType>(
static_cast<int>(TextureType::Begin) + 1));
39 EXPECT_EQ(*iterator,
static_cast<TextureType>(
static_cast<int>(TextureType::Begin) + 2));
40 EXPECT_EQ(*copy, TextureType::Begin);
41}
TextureType
Enumerates supported texture map types for imported materials.
◆ TEST() [3/3]
| TEST |
( |
TextureTypeEnum |
, |
|
|
VisitsEntireInclusiveRangeExactlyOnceAndTerminates |
|
|
) |
| |
Definition at line 12 of file model_material_tests.cpp.
13{
15 auto iterator = range.
begin();
16 ASSERT_NE(iterator, range.
end());
17 EXPECT_EQ(*iterator, TextureType::Begin);
18
19 for (int value = TextureType::Begin; value <= TextureType::End; ++value)
20 {
21 ASSERT_NE(iterator, range.
end());
22 EXPECT_EQ(*iterator,
static_cast<TextureType>(value));
23 ++iterator;
24 }
25 EXPECT_EQ(iterator, range.
end());
26}