skia2/tests/GrContextFactoryTest.cpp
tfarina 9ea53f93e7 Preprend Test to test function name generated by DEF_TEST() macro.
That way when declaring a test with DEF_TEST() macro, you don't have to
uniquify the test name because it might colide with the class it is
being testing.

For example, if you are testing SkBase64 and do:

DEF_TEST(SkBase64, reporter) {
}

That will generate an error because the macro will declare a function
named SkBase64 which colides with the type SkBase64.

By adding Test to the function name we avoid this problem.

Fixed the entries found with the following command line:

$ git grep "Test, r" | grep DEF

BUG=None
TEST=make tests && out/Debug/tests
R=mtklein@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/345753007
2014-06-24 06:50:39 -07:00

33 lines
1.1 KiB
C++

/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#if SK_SUPPORT_GPU
#include "GrContextFactory.h"
#include "Test.h"
DEF_GPUTEST(GrContextFactory, reporter, factory) {
// Reset in case some other test has been using it first.
factory->destroyContexts();
// Before we ask for a context, we expect the GL context to not be there.
REPORTER_ASSERT(reporter,
NULL == factory->getGLContext(GrContextFactory::kNative_GLContextType));
// After we ask for a context, we expect that the GL context to be there.
factory->get(GrContextFactory::kNative_GLContextType);
REPORTER_ASSERT(reporter,
factory->getGLContext(GrContextFactory::kNative_GLContextType) != NULL);
// If we did not ask for a context with the particular GL context, we would
// expect the particular GL context to not be there.
REPORTER_ASSERT(reporter,
NULL == factory->getGLContext(GrContextFactory::kNull_GLContextType));
}
#endif