Ejemplo n.º 1
0
// reads JAD and JAR from cwd, outputs COD file to s.dst.
void packageBlackberry(const SETTINGS& s, const RuntimeInfo& ri) {
	testDst(s);
	testName(s);
	std::stringstream cmd;
	cmd << "java -Xmx256m -classpath \""<<mosyncdir()<<"/bin/bb40/rapc.jar\""
		" net.rim.tools.compiler.Compiler"
		" \"import="<<mosyncdir()<<"/bin/bb40/net_rim_api.jar\""
		" \"codename="<<s.name<<"\" -midlet"
		" \"jad="<<s.name<<".jad\" \""<<s.name<<".jar\"";
	sh(cmd.str().c_str());

	std::string codName(s.name);
	codName += ".cod";
	int res = rename(codName.c_str(), (s.dst + ("/" + codName)).c_str());
	if(res != 0) {
		printf("rename error %i, %i\n", res, errno);
		exit(1);
	}
}
Ejemplo n.º 2
0
static void test_blender(std::string resourceName, skiatest::Reporter* reporter) {
    std::string fileName = resourceName + ".png";
    sk_sp<SkImage> image = GetResourceAsImage(fileName.c_str());
    if (image == nullptr) {
        ERRORF(reporter, "image is NULL");
        return;
    }
    SkBitmap bm;
    if (!as_IB(image)->getROPixels(&bm)) {
        ERRORF(reporter, "Could not read resource");
        return;
    }

    SkPixmap pixmap;
    bm.peekPixels(&pixmap);
    SkASSERTF(pixmap.colorType() == kN32_SkColorType, "colorType: %d", pixmap.colorType());
    SkASSERT(pixmap.alphaType() != kUnpremul_SkAlphaType);
    const uint32_t* src = pixmap.addr32();
    const int width = pixmap.rowBytesAsPixels();
    SkASSERT(width > 0);
    SkASSERT(width < 4000);
    SkAutoTArray<uint32_t> correctDst(width);
    SkAutoTArray<uint32_t> testDst(width);

    for (int y = 0; y < pixmap.height(); y++) {
        // TODO: zero is not the most interesting dst to test srcover...
        sk_bzero(correctDst.get(), width * sizeof(uint32_t));
        sk_bzero(testDst.get(), width * sizeof(uint32_t));
        brute_force_srcover_srgb_srgb(correctDst.get(), src, width, width);
        SkOpts::    srcover_srgb_srgb(   testDst.get(), src, width, width);
        for (int x = 0; x < width; x++) {
            REPORTER_ASSERT_MESSAGE(
                reporter, correctDst[x] == testDst[x],
                mismatch_message(resourceName, x, y, src[x], correctDst[x], testDst[x]));
            if (correctDst[x] != testDst[x]) break;
        }
        src += width;
    }
}