Matthew Woehlke 612d6f29f8 Tests: Refactor GenerateExportHeader test code
Refactor the library code used in the GenerateExportHeader test to use
an improved naming convention that more directly identifies what it
being tested, making use of namespaces to avoid possible symbol
collisions. This also eliminates duplicate cases such as `libshared()`
and `libshared_not_exported()` which had the same decoration, and adds
consistent pairings of <name>_EXPORT and <name>_DEPRECATED_EXPORT which
were missing previously. The data tests from the previous commit are
also added to `libstatic` and `libshared_and_static` for consistency.

Note that there are no exported members of exported classes, as these
are not allowed on Windows.
2016-09-12 10:29:20 -04:00

83 lines
1.6 KiB
C++

#ifndef LIBSHARED_H
#define LIBSHARED_H
#include "libshared_export.h"
namespace libshared {
class Class
{
public:
int method() const;
int LIBSHARED_EXPORT method_exported() const;
int LIBSHARED_DEPRECATED method_deprecated() const;
int LIBSHARED_DEPRECATED_EXPORT method_deprecated_exported() const;
int LIBSHARED_NO_EXPORT method_excluded() const;
static int const data;
static int const LIBSHARED_EXPORT data_exported;
static int const LIBSHARED_NO_EXPORT data_excluded;
};
class LIBSHARED_EXPORT ExportedClass
{
public:
int method() const;
int LIBSHARED_DEPRECATED method_deprecated() const;
int LIBSHARED_NO_EXPORT method_excluded() const;
static int const data;
static int const LIBSHARED_NO_EXPORT data_excluded;
};
class LIBSHARED_NO_EXPORT ExcludedClass
{
public:
int method() const;
int LIBSHARED_EXPORT method_exported() const;
int LIBSHARED_DEPRECATED method_deprecated() const;
int LIBSHARED_DEPRECATED_EXPORT method_deprecated_exported() const;
int LIBSHARED_NO_EXPORT method_excluded() const;
static int const data;
static int const LIBSHARED_EXPORT data_exported;
static int const LIBSHARED_NO_EXPORT data_excluded;
};
int function();
int LIBSHARED_EXPORT function_exported();
int LIBSHARED_DEPRECATED function_deprecated();
int LIBSHARED_DEPRECATED_EXPORT function_deprecated_exported();
int LIBSHARED_NO_EXPORT function_excluded();
extern int const data;
extern int const LIBSHARED_EXPORT data_exported;
extern int const LIBSHARED_NO_EXPORT data_excluded;
} // namespace libshared
LIBSHARED_EXPORT void use_int(int);
#endif