Exemple #1
0
TEST (LockRawTest, InvokeGc) {
    lock_core_m core(make_options(false, true));
    RawXct *xct = core.allocate_xct();
    // allocate many so that GC allocation and garbage collection kicks in
    for (int i = 0; i < 50; ++i) {
        RawLock *lock = NULL;
        EXPECT_EQ(w_error_ok, core.acquire_lock(xct, 123, ALL_S_GAP_S,
                                                true, true, true, 100, &lock));
        EXPECT_TRUE(lock != NULL);
        core.release_lock(lock);
    }
    core.deallocate_xct(xct);
}
Exemple #2
0
/*
 * Send an RRQ packet (write request).
 */
int
send_rrq(int peer, char *filename, char *mode)
{
	int n;
	struct tftphdr *tp;
	char *bp;
	char buf[MAXPKTSIZE];
	int size;

	if (debug&DEBUG_PACKETS)
		tftp_log(LOG_DEBUG, "Sending RRQ: filename: '%s', mode '%s'",
			filename, mode
		);

	DROPPACKETn("send_rrq", 1);

	tp = (struct tftphdr *)buf;
	tp->th_opcode = htons((u_short)RRQ);
	size = 2;

	bp = tp->th_stuff;
	strcpy(bp, filename);
	bp += strlen(filename);
	*bp = 0;
	bp++;
	size += strlen(filename) + 1;

	strcpy(bp, mode);
	bp += strlen(mode);
	*bp = 0;
	bp++;
	size += strlen(mode) + 1;

	if (options_rfc_enabled) {
		options[OPT_TSIZE].o_request = strdup("0");
		size += make_options(peer, bp, sizeof(buf) - size);
	}

	n = sendto(peer, buf, size, 0,
	    (struct sockaddr *)&peer_sock, peer_sock.ss_len);
	if (n != size) {
		tftp_log(LOG_ERR, "send_rrq: %d %s", n, strerror(errno));
		return (1);
	}
	return (0);
}
 //==============================================================================
 InstrumentBrowserApplication() : options_(make_options()) {}
Exemple #4
0
TEST (LockRawTest, CreateLarge) {
    lock_core_m core(make_options(false, false));
}
Exemple #5
0
TEST (LockRawTest, CreateNoInit) {
    lock_core_m core(make_options(false));
}
Exemple #6
0
TEST (LockRawTest, Create) {
    lock_core_m core(make_options());
}
TEST (BtreeBasicTest2, DoSomeLock) {
    test_env->empty_logdata_dir();
    EXPECT_EQ(test_env->runBtreeTest(dosome, true, make_options()), 0);
}