gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Macros | Functions | Variables
exec_aout.test.cc File Reference
#include <gtest/gtest.h>
#include "base/loader/exec_aout.h"

Go to the source code of this file.

Macros

#define OMAGIC_STRUCT   (*((const aout_exechdr *)omagic))
 
#define NMAGIC_STRUCT   (*((const aout_exechdr *)nmagic))
 
#define ZMAGIC_STRUCT   (*((const aout_exechdr *)zmagic))
 
#define NO_MAGIC_STRUCT   (*((const aout_exechdr *)no_magic))
 

Functions

 TEST (ExecAoutTest, IsNotBadMagicNumber)
 
 TEST (ExecAoutTest, IsBadMagicNumber)
 
 TEST (ExecAoutTest, AlignNotZmagic)
 
 TEST (ExecAoutTest, AlignIsZmagic)
 
 TEST (ExecAoutTest, AlignIsZmagicNoRounding)
 

Variables

const uint8_t omagic []
 
const uint8_t nmagic []
 
const uint8_t zmagic []
 
const uint8_t no_magic []
 

Macro Definition Documentation

◆ NMAGIC_STRUCT

#define NMAGIC_STRUCT   (*((const aout_exechdr *)nmagic))

Definition at line 37 of file exec_aout.test.cc.

Referenced by TEST().

◆ NO_MAGIC_STRUCT

#define NO_MAGIC_STRUCT   (*((const aout_exechdr *)no_magic))

Definition at line 39 of file exec_aout.test.cc.

Referenced by TEST().

◆ OMAGIC_STRUCT

#define OMAGIC_STRUCT   (*((const aout_exechdr *)omagic))

Definition at line 36 of file exec_aout.test.cc.

Referenced by TEST().

◆ ZMAGIC_STRUCT

#define ZMAGIC_STRUCT   (*((const aout_exechdr *)zmagic))

Definition at line 38 of file exec_aout.test.cc.

Referenced by TEST().

Function Documentation

◆ TEST() [1/5]

TEST ( ExecAoutTest  ,
IsNotBadMagicNumber   
)

Definition at line 102 of file exec_aout.test.cc.

References EXPECT_FALSE, N_BADMAG, NMAGIC_STRUCT, OMAGIC_STRUCT, and ZMAGIC_STRUCT.

◆ TEST() [2/5]

TEST ( ExecAoutTest  ,
IsBadMagicNumber   
)

Definition at line 109 of file exec_aout.test.cc.

References EXPECT_TRUE, N_BADMAG, and NO_MAGIC_STRUCT.

◆ TEST() [3/5]

TEST ( ExecAoutTest  ,
AlignNotZmagic   
)

Definition at line 114 of file exec_aout.test.cc.

References EXPECT_EQ, N_ALIGN, NMAGIC_STRUCT, NO_MAGIC_STRUCT, OMAGIC_STRUCT, and X86ISA::x.

◆ TEST() [4/5]

TEST ( ExecAoutTest  ,
AlignIsZmagic   
)

Definition at line 126 of file exec_aout.test.cc.

References EXPECT_EQ, N_ALIGN, X86ISA::x, and ZMAGIC_STRUCT.

◆ TEST() [5/5]

TEST ( ExecAoutTest  ,
AlignIsZmagicNoRounding   
)

Definition at line 136 of file exec_aout.test.cc.

References EXPECT_EQ, N_ALIGN, X86ISA::x, and ZMAGIC_STRUCT.

Variable Documentation

◆ nmagic

const uint8_t nmagic[]
Initial value:
{
0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
}

Definition at line 50 of file exec_aout.test.cc.

◆ no_magic

const uint8_t no_magic[]
Initial value:
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x00
}

Definition at line 64 of file exec_aout.test.cc.

◆ omagic

const uint8_t omagic[]
Initial value:
{
0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
}

Definition at line 43 of file exec_aout.test.cc.

◆ zmagic

const uint8_t zmagic[]
Initial value:
{
0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
}

Definition at line 57 of file exec_aout.test.cc.


Generated on Fri Feb 28 2020 16:27:06 for gem5 by doxygen 1.8.13