blob: 3501ae92fbab85f76a82f7fb4a3770890a918230 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#include <gtest/gtest.h>
extern "C" {
#include "gdt.h"
}
TEST(i686GDT, KnownAccessByteValues)
{
EXPECT_EQ(*(uint8_t *)&null_access, 0x00);
EXPECT_EQ(*(uint8_t *)&ktext_access, 0x9a);
EXPECT_EQ(*(uint8_t *)&kdata_access, 0x92);
}
TEST(i686GDT, NullSegmentDescriptor)
{
struct SegmentDescriptor_t d;
SegmentDescriptor(&d, 0, 0, 0);
EXPECT_EQ(*(uint64_t *)&d, 0);
}
TEST(i686GDT, SegmentIndex)
{
EXPECT_EQ(ktextDescriptor, 0x10);
EXPECT_EQ(kdataDescriptor, 0x18);
}
|