blob: e50336ddba5109e7773cc02b28bb64dbe34702a4 [file] [log] [blame]
Karl Zhang3de5ab12021-05-31 11:45:48 +08001/*
Nik Dewallybacae6c2024-07-30 16:58:14 +01002 * Copyright (c) 2019-2024, Arm Limited. All rights reserved.
Karl Zhang3de5ab12021-05-31 11:45:48 +08003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
Nik Dewallybacae6c2024-07-30 16:58:14 +01008#include <cstdlib>
Karl Zhang3de5ab12021-05-31 11:45:48 +08009
Karl Zhang3de5ab12021-05-31 11:45:48 +080010#include "gibberish.hpp"
Karl Zhang3de5ab12021-05-31 11:45:48 +080011#include "data_blocks.hpp"
Karl Zhang3de5ab12021-05-31 11:45:48 +080012#include "template_line.hpp"
13#include "tf_fuzz.hpp"
Karl Zhang3de5ab12021-05-31 11:45:48 +080014#include "sst_template_line.hpp"
Karl Zhang3de5ab12021-05-31 11:45:48 +080015
16
17/**********************************************************************************
18 Methods of class set_sst_template_line follow:
19**********************************************************************************/
20
21//**************** set_sst_template_line methods ****************
22
23set_sst_template_line::set_sst_template_line (tf_fuzz_info *resources)
24 : sst_template_line (resources) // constructor)
25{
26 return; // just to have something to pin a breakpoint onto
27}
28
29
30// Default destructor:
31set_sst_template_line::~set_sst_template_line (void)
32{
33 return; // just to have something to pin a breakpoint onto
34}
35
36// (Default constructor not used)
37
38
39
40/**********************************************************************************
41 End of methods of class set_sst_template_line.
42**********************************************************************************/
43
44
45/**********************************************************************************
46 Methods of class read_sst_template_line follow:
47**********************************************************************************/
48
49read_sst_template_line::read_sst_template_line (tf_fuzz_info *resources)
50 : sst_template_line (resources) // (constructor)
51{
52 char gibberish_buffer[4096]; string databuff;
53 int data_length;
54 set_data.string_specified = (rand()%2) == 1? true : false;
55
56 // Go ahead and create a literal-data string even if not needed:
57 data_length = test_state->gibbergen.pick_sentence_len();
58 test_state->gibbergen.sentence (gibberish_buffer, gibberish_buffer + data_length);
59 databuff = gibberish_buffer; set_data.set (databuff);
60
61 set_data.file_specified
62 = (!set_data.string_specified && (rand()%2) == 1)? true : false;
63 set_data.file_path = ""; // can't really devise a random path
64}
65
66// Default destructor:
67read_sst_template_line::~read_sst_template_line (void)
68{
69 return; // just to have something to pin a breakpoint onto
70}
71
72// (Default constructor not used)
73
74
75/**********************************************************************************
76 End of methods of class read_sst_template_line.
77**********************************************************************************/
78
79
80/**********************************************************************************
81 Methods of class remove_sst_template_line follow:
82**********************************************************************************/
83
84remove_sst_template_line::remove_sst_template_line (tf_fuzz_info *resources)
85 : sst_template_line (resources) // (constructor)
86{
87 is_remove = true; // template_line's constructor defaults this to false
88}
89
90// Default destructor:
91remove_sst_template_line::~remove_sst_template_line (void)
92{
93 return; // just to have something to pin a breakpoint onto
94}
95
96// (Default constructor not used)
97
98
99/**********************************************************************************
100 End of methods of class remove_sst_template_line.
101**********************************************************************************/