Bartleby 0.1.0
A symbol renaming toolkit
|
Unit tests for Bartleby. More...
#include "Bartleby/Bartleby.h"
#include "Bartleby-c/Bartleby.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Object/Binary.h"
#include "llvm/ObjectYAML/yaml2obj.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SmallVectorMemoryBuffer.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/YAMLParser.h"
#include "llvm/Support/YAMLTraits.h"
#include <unistd.h>
#include "gtest/gtest.h"
Macros | |
#define | TEST_DATA_BASE_DIR "bartleby/tests/Bartleby/testdata/yaml" |
Base directory for test data based on yaml files. | |
#define | ASSERT_SYM_RESOLVE(_b_, _name_) |
Resolves a symbol in the map of symbols. | |
#define | ASSERT_SYM_GLOBALNESS(_b_, _name_, _exp_) |
Asserts the globalness of a symbol. | |
#define | ASSERT_SYM_LOCAL(_b_, _name_) ASSERT_SYM_GLOBALNESS((_b_), (_name_), false) |
Asserts that a symbol is local. | |
#define | ASSERT_SYM_GLOBAL(_b_, _name_) ASSERT_SYM_GLOBALNESS((_b_), (_name_), true) |
Asserts that a symbol is local. | |
#define | ASSERT_SYM_DEFINEDNESS(_b_, _name_, _exp_) |
Asserts the definedness of a symbol. | |
#define | ASSERT_SYM_UNDEFINED(_b_, _name_) ASSERT_SYM_DEFINEDNESS((_b_), (_name_), false) |
Asserts that a symbol is undefined. | |
#define | ASSERT_SYM_DEFINED(_b_, _name_) ASSERT_SYM_DEFINEDNESS((_b_), (_name_), true) |
Asserts that a symbol is defined. | |
#define | ASSERT_SYM_OVERWRITTEN(_b_, _name_, _exp_) |
Asserts the overwrittenness of a symbol. | |
#define | ASSERT_SYM_WILL_BE_RENAMED(_b_, _name_) ASSERT_SYM_OVERWRITTEN((_b_), (_name_), true) |
Asserts that a symbol name will be overwritten. | |
#define | ASSERT_SYM_WILL_NOT_BE_RENAMED(_b_, _name_) ASSERT_SYM_OVERWRITTEN((_b_), (_name_), false) |
Asserts that a symbol name will NOT be overwritten. | |
Functions | |
TEST (BartleByObjectYamlELF, Object386) | |
TEST (BartleByObjectYamlError, ObjectTypeMisMatch) | |
Test that passing two objects with different format types is an error. | |
TEST (BartleByObjectYamlELF, SymbolInBSS) | |
Test that a symbol in a BSS section is well renamed. | |
TEST (BartlebyCAPI, CAPI) | |
Test the C API. | |
TEST (BartlebyCAPI, CAPI_Invalid_Input) | |
Test the C API with invalid inputs. | |
Unit tests for Bartleby.
#define ASSERT_SYM_DEFINED | ( | _b_, | |
_name_ | |||
) | ASSERT_SYM_DEFINEDNESS((_b_), (_name_), true) |
Asserts that a symbol is defined.
_b_ | Bartleby handle. |
_name_ | Name of the symbol. |
#define ASSERT_SYM_DEFINEDNESS | ( | _b_, | |
_name_, | |||
_exp_ | |||
) |
Asserts the definedness of a symbol.
_b_ | Bartleby handle. |
_name_ | Name of the symbol. |
#define ASSERT_SYM_GLOBAL | ( | _b_, | |
_name_ | |||
) | ASSERT_SYM_GLOBALNESS((_b_), (_name_), true) |
Asserts that a symbol is local.
_b_ | Bartleby handle. |
_name_ | Name of the symbol. |
#define ASSERT_SYM_GLOBALNESS | ( | _b_, | |
_name_, | |||
_exp_ | |||
) |
Asserts the globalness of a symbol.
_b_ | Bartleby handle. |
_name_ | Name of the symbol. |
#define ASSERT_SYM_LOCAL | ( | _b_, | |
_name_ | |||
) | ASSERT_SYM_GLOBALNESS((_b_), (_name_), false) |
Asserts that a symbol is local.
_b_ | Bartleby handle. |
_name_ | Name of the symbol. |
#define ASSERT_SYM_OVERWRITTEN | ( | _b_, | |
_name_, | |||
_exp_ | |||
) |
Asserts the overwrittenness of a symbol.
_b_ | Bartleby handle. |
_name_ | Name of the symbol. |
#define ASSERT_SYM_RESOLVE | ( | _b_, | |
_name_ | |||
) |
Resolves a symbol in the map of symbols.
_b_ | Bartleby handle. |
_name_ | Name of the symbol. |
#define ASSERT_SYM_UNDEFINED | ( | _b_, | |
_name_ | |||
) | ASSERT_SYM_DEFINEDNESS((_b_), (_name_), false) |
Asserts that a symbol is undefined.
_b_ | Bartleby handle. |
_name_ | Name of the symbol. |
#define ASSERT_SYM_WILL_BE_RENAMED | ( | _b_, | |
_name_ | |||
) | ASSERT_SYM_OVERWRITTEN((_b_), (_name_), true) |
Asserts that a symbol name will be overwritten.
_b_ | Bartleby handle. |
_name_ | Name of the symbol. |
#define ASSERT_SYM_WILL_NOT_BE_RENAMED | ( | _b_, | |
_name_ | |||
) | ASSERT_SYM_OVERWRITTEN((_b_), (_name_), false) |
Asserts that a symbol name will NOT be overwritten.
_b_ | Bartleby handle. |
_name_ | Name of the symbol. |
TEST | ( | BartlebyCAPI | , |
CAPI | |||
) |
Test the C API.
TEST | ( | BartlebyCAPI | , |
CAPI_Invalid_Input | |||
) |
Test the C API with invalid inputs.
TEST | ( | BartleByObjectYamlELF | , |
Object386 | |||
) |
TEST | ( | BartleByObjectYamlELF | , |
SymbolInBSS | |||
) |
Test that a symbol in a BSS section is well renamed.
TEST | ( | BartleByObjectYamlError | , |
ObjectTypeMisMatch | |||
) |
Test that passing two objects with different format types is an error.